diff options
Diffstat (limited to 'gmperator.js')
-rw-r--r-- | gmperator.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gmperator.js b/gmperator.js index eb24311..c0bd165 100644 --- a/gmperator.js +++ b/gmperator.js @@ -351,14 +351,15 @@ commands.addUserCommand(['gmset'],'change settings for Greasemonkey scripts', // commands.addUserCommand(['gmcommand','gmcmd'],'run Greasemonkey Command', //{{{ function(args,special){ var commander = GM_BrowserUI.getCommander(content); + var commandName = args[0]; for (let i=0,l=commander.menuItems.length; i<l; i++){ let menuItem = commander.menuItems[i]; - if (menuItem.getAttribute('label') == args.string){ + if (menuItem.getAttribute('label') == commandName){ menuItem._commandFunc(); return; } } - liberator.echoerr(args.string + ' is not defined userscript command.'); + liberator.echoerr(commandName + ' is not defined userscript command.'); }, { completer: function(context){ @@ -369,7 +370,8 @@ commands.addUserCommand(['gmcommand','gmcmd'],'run Greasemonkey Command', //{{{ context.completions = [[items[i].getAttribute('label'),'-'] for (i in items)].filter(function(item){ return this.test(item[0]); },exp); - } + }, + argCount: "1" } ); //}}} |