User:Polygnotus/Scripts/ToolsLink.js

This is an old revision of this page, as edited by Polygnotus (talk | contribs) at 14:03, 9 July 2025 (Created page with 'mw.hook('wikipage.content').add(function() { mw.loader.using(['mediawiki.util'], function() { // Only add the link if it doesn't already exist if (!document.getElementById('t-mycustomtool2')) { //linkid mw.util.addPortletLink( 'p-tb', //Target portlet ID (Tools menu) 'https://tools.wmflabs.org/', //linkurl 'Wikimedia Tools', //linktext...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(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.
mw.hook('wikipage.content').add(function() {
    mw.loader.using(['mediawiki.util'], function() {
        
        // Only add the link if it doesn't already exist
        if (!document.getElementById('t-mycustomtool2')) {	//linkid
            mw.util.addPortletLink(
                'p-tb',										//Target portlet ID (Tools menu)
                'https://tools.wmflabs.org/',				//linkurl
                'Wikimedia Tools',							//linktext
                't-mycustomtool2',							//linkid
                'Access Wikimedia developer tools'			//tooltip
            );
        }
    });
});