מדיה ויקי:Gadget-ExternalLinkNewTab.js
הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload), או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh), או ללחוץ על צירוף המקשים Ctrl-F5.
- אופרה: ללחוץ על Ctrl-F5.
/*** SOURCE: mediawiki.org/wiki/Snippets/Open_external_links_in_new_window ***/ mw.hook( 'wikipage.content' ).add( function( $content ) { $content.find( 'a.external, a[rel="mw:ExtLink"], a[rel="nofollow"]' ).each( function () { if ( this.href.indexOf( location.protocol + '//' + location.hostname ) !== 0 ) { this.target = '_blank'; if ( this.rel.indexOf( 'noopener' ) < 0 ) { this.rel += ' noopener'; // the leading space matters, rel attributes have space-separated tokens } if ( this.rel.indexOf( 'noreferrer' ) < 0 ) { this.rel += ' noreferrer'; // the leading space matters, rel attributes have space-separated tokens } } } ); } );