diff options
author | hogelog | 2008-12-12 13:43:12 +0000 |
---|---|---|
committer | hogelog | 2008-12-12 13:43:12 +0000 |
commit | 4295a51e3ce40603bedaced566c88688b728b4a6 (patch) | |
tree | add10e951325a663f27c2d02c63c297b5ab9cd17 /gmperator.js | |
parent | 2257511008ee6d3e54b122db65c2afa5761f52fb (diff) | |
download | vimperator-plugins-4295a51e3ce40603bedaced566c88688b728b4a6.tar.bz2 |
* fix :gmcommand
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@26588 d0d07461-0603-4401-acd4-de1884942a52
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" } ); //}}} |