注意:在您儲存之後您必須清除瀏覽器快取才可看到最新的變動。
?_=1
來訪問最新頁面。
Promise.all( ['moeskin.instance', 'moeskin.stores'].map(function (name) { return new Promise(mw.hook(name).add) }) ).then(function (payload) { var skin = payload[0] var stores = payload[1] var conf = mw.config.get() var nav = stores.useNavigationStore(skin.pinia) nav.topbar.push({ id: 'custom-things', text: '自定義工具', href: 'javascript:;', children: [ { id: 'custom-things-prefixindex', href: mw.util.getUrl('Special:PrefixIndex/' + conf.wgPageName), text: '前綴索引', }, { id: 'custom-things-whatlinkshere', text: '鏈入頁面', href: mw.util.getUrl('Special:WhatLinksHere/' + conf.wgPageName), }, { id: 'custom-things-userrights', text: '用戶權限', href: mw.util.getUrl('Special:UserRights/' + conf.wgUserName), }, ], }) })