User:Blablubbs/moremenu-64.js
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)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
// Adds a link to MoreMenu's "user" tab to jump to the contributions of the corresponding /64 when looking at an individual IPv6 address. /64 conversion method borrowed from [[w:en:MediaWiki:Gadget-twinkleblock.js]]
$(function () {
mw.hook('moremenu.ready').add(function (config) {
const isipv6 = mw.util.isIPv6Address(config.targetUser.name, true) && !config.targetUser.ipRange;
if (isipv6)
MoreMenu.addLink('user', '/64',
mw.util.getUrl('Special:Contributions/') +
Morebits.ip.get64(mw.config.get('wgRelevantUserName')));
});
});