feat: add menu link to source code
This commit is contained in:
parent
63bf02046a
commit
0522e5935c
2 changed files with 8 additions and 0 deletions
|
@ -5,6 +5,13 @@ const _GM = typeof GM == 'object' ? GM : undefined;
|
|||
const gmId = '' + Math.random();
|
||||
w[gmId] = _GM;
|
||||
|
||||
if (_GM && _GM.registerMenuCommand && _GM.openInTab) {
|
||||
// add buttons to the userscript manager menu
|
||||
_GM.registerMenuCommand(
|
||||
'** Source Code **',
|
||||
() => _GM.openInTab(_GM.info.script.homepage, { active: true })
|
||||
)
|
||||
}
|
||||
|
||||
// script loader
|
||||
new Promise(resolve => {
|
||||
|
|
|
@ -15,5 +15,6 @@
|
|||
// @grant unsafeWindow
|
||||
// @grant GM.registerMenuCommand
|
||||
// @grant GM.addElement
|
||||
// @grant GM.openInTab
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
|
|
Loading…
Reference in a new issue