MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
No edit summary |
No edit summary |
||
| Line 237: | Line 237: | ||
sortAndRank(); | sortAndRank(); | ||
}); | |||
/* Open YouTube links in new tab */ | |||
mw.hook('wikipage.content').add(function ($content) { | |||
$content.find('a[href*="youtube.com"], a[href*="youtu.be"]').each(function () { | |||
this.setAttribute("target", "_blank"); | |||
this.setAttribute("rel", "noopener noreferrer"); | |||
}); | |||
}); | }); | ||