Jump to content

User:Blablubbs/moremenu-proxy.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Blablubbs (talk | contribs) at 18:10, 1 January 2022 (adapt to new censys URL scheme). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// Forked from [[User:GeneralNotability/moremenu-proxy.js]]
$(function () {
  mw.hook('moremenu.ready').add(function (config) {
    const isip = mw.util.isIPAddress(config.targetUser.name, false);
	// Things that only work on single IP addresses
      if (isip) {
        MoreMenu.addSubmenuLink('user', 'ip-lookup', 'Bullseye', 'https://bullseye.toolforge.org/ip/' + config.targetUser.encodedName);
        MoreMenu.addSubmenuLink('user', 'ip-lookup', 'Spur API', 'https://spur.us/app/context?q=' + config.targetUser.encodedName);
        MoreMenu.addSubmenuLink('user', 'ip-lookup', 'Rangeblock finder', 'https://rangeblockfinder.toolforge.org/?ip=' + config.targetUser.encodedName);
        if (mw.util.isIPv4Address(config.targetUser.name, false)) {
            MoreMenu.addSubmenuLink('user', 'ip-lookup', 'Censys', 'https://search.censys.io/hosts/' + config.targetUser.encodedName);
			MoreMenu.addSubmenuLink('user', 'ip-lookup', 'Shodan', 'https://www.shodan.io/search?query=' + config.targetUser.encodedName);
        }
      }
    if (isip || config.targetUser.ipRange) {
      MoreMenu.addSubmenuLink('user', 'ip-lookup', 'Stalktoy', 'https://tools.wmflabs.org/meta/stalktoy/' + config.targetUser.encodedName);
    }
    if (config.targetUser.ipRange) {
      MoreMenu.addSubmenuLink('user', 'ip-lookup', 'Shodan', 'https://www.shodan.io/search?query=net:' + config.targetUser.encodedName);
      MoreMenu.addSubmenuLink('user', 'ip-lookup', 'Robtex', 'https://www.robtex.com/cidr/' + config.targetUser.encodedName);
    }
  });
});