mw.loader.using("mediawiki.util",function(){constaction=mw.config.get("wgAction");// e.g., 'view', 'edit', 'history'/* gets you the name of the current special page, e.g. 'AbuseLog'; if we're not on a special page, this returns null */constspecial_pagename=mw.config.get("wgCanonicalSpecialPageName");consttype_param=mw.util.getParamValue("type");// e.g., 'checkuser-temporary-account', nullif(special_pagename==="Log"&&type_param==="checkuser-temporary-account"){/* if we're on Special:Log *and* it has the ?type='checkuser-temporary-account' param, we quit. */return;}/* checks if the current page name is not null and matches any of these names in the array */constis_supported_page=special_pagename&&["Log","Listusers"].includes(special_pagename);if(!is_supported_page&&action!=="history"){/* if it's not one of the specified special pages AND not a history (?action=history) page, we quit.*/return;}// good to go, now we loop through <li>s that have '.mw-userlink' AND '.mw-usertoollinks' inside them$("li:has(.mw-userlink):has(.mw-usertoollinks)").each(function(){// pick the first `.mw-userlink`;// contrib link also has the class (is this a recent change?), so we ignore that.constrelevant_user=$(this).find(".mw-userlink").first().text();constencoded_username=encodeURIComponent(relevant_user);// generate all the links we want to appendconstblock_link=`<a href="https://en.wikipedia.org/wiki/Special:Block/${relevant_user}">block</a>`;// encoding IPs is a-okayconstpubliclog_link=`<a href="https://en.wikipedia.org/wiki/Special:Log?user=${encoded_username}">logs</a>`;constcheckuser_link=`<a href="https://en.wikipedia.org/w/index.php?title=Special:CheckUser&user=${encoded_username}">checkuser</a>`;constchecklog_link=`<a href="https://en.wikipedia.org/w/index.php?title=Special:CheckUserLog&cuSearchType=target&cuSearch=${encoded_username}">checks</a>`;constnew_links=[publiclog_link];if(mw.util.isIPAddress(relevant_user)){constwhois_link=`<a href="https://tools.wmflabs.org/whois-referral/gateway.py?lookup=true&ip=${encoded_username}">WHOIS</a>`;constgeolocate_link=`<a href="https://whatismyipaddress.com/ip/${relevant_user}">geolocate</a>`;constproxy_check_link=`<a href="https://spur.us/context/${relevant_user}">proxy</a>`;constbullseye_check_link=`<a href="https://bullseye.toolforge.org/ip/${relevant_user}">bullseye</a>`;new_links.push(whois_link,geolocate_link,proxy_check_link,bullseye_check_link);}new_links.push(checkuser_link,checklog_link,block_link);// these are appended after IP-related links// turn the array of links into "link1 | link2..."constnew_links_str=new_links.join(" | ");// append to the existing content of .mw-usertoollinks instead of overwriting it$(this).find("span.mw-usertoollinks").first().append(` |${new_links_str}`);});});