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.
// PREFIX INDEX TOOLBOX LINK:

if (mw.config.get('wgNamespaceNumber') >= 0) {
    addOnloadHook(function () {
        mw.util.addPortletLink("p-tb", mw.config.get('wgServer') + mw.config.get('wgArticlePath').replace("$1", "Special:Prefixindex/" + mw.config.get('wgPageName')),
                       "Prefix index", "t-prefixindex", "List of pages beginning with " + mw.config.get('wgPageName'));
    });
}