Page MenuHomePhabricator

Feature request: open external links in a new window (user preference)
Closed, DeclinedPublic

Description

Author: eran_roz

Description:
Some people prefere that external links would open in a new window. so it would
be useful to be able to set this in user preferences.


Version: unspecified
Severity: enhancement

Details

Reference
bz3213

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 8:44 PM
bzimport set Reference to bz3213.
bzimport added a subscriber: Unknown Object (MLST).

You can get this behavior by putting this in your User:username/monobook.js:

window.onload=replaceLinks;
function replaceLinks() {

var x,i; 
x=document.links; 
for(i=0;i<x.length;++i) { 
  if(x[i].className=='external text') {
    x[i].target="_blank"; 
  } 
}

}

(Be sure to clean your cache after changing your user script or it won't take
effect.)

I hope this will not be included in MediaWiki because this is not html-compatible.

fred_chessplayer wrote:

This feature was one I wanted when I first noticed wikipedia in early 2005. I
think it would be an enhancement.

You can always open links in a new window from the browser,
quite easily. There's no particular reason to discriminate
automatically based on how the link was generated.

ayg wrote:

*** This bug has been marked as a duplicate of 1055 ***

ayg wrote:

*** Bug 9811 has been marked as a duplicate of this bug. ***