MediaWiki:Common.js

From MEG Core
Revision as of 13:29, 6 November 2025 by Nugenta (talk | contribs) (Created page with "mw.hook('wikipage.content').add(function($c){ $c.find('a[target="_blank"]').each(function(){ if (!this.rel || this.rel.indexOf('noopener') === -1) this.rel = (this.rel ? this.rel + ' ' : '') + 'noopener'; if (this.rel.indexOf('noreferrer') === -1) this.rel += ' noreferrer'; }); });")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
mw.hook('wikipage.content').add(function($c){
  $c.find('a[target="_blank"]').each(function(){
    if (!this.rel || this.rel.indexOf('noopener') === -1) this.rel = (this.rel ? this.rel + ' ' : '') + 'noopener';
    if (this.rel.indexOf('noreferrer') === -1) this.rel += ' noreferrer';
  });
});