diff options
author | otsune | 2008-10-26 18:13:46 +0000 |
---|---|---|
committer | otsune | 2008-10-26 18:13:46 +0000 |
commit | e8e8c3772acca20d4c2576ee3b09ad0271d48148 (patch) | |
tree | ba854b3b58820ae8732d9b7beb41dacf37177587 /proxy.js | |
parent | ad2729d10d6b3f8e55301ed15c2b66154c4b40c7 (diff) | |
download | vimperator-plugins-e8e8c3772acca20d4c2576ee3b09ad0271d48148.tar.bz2 |
fix scope.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22194 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'proxy.js')
-rw-r--r-- | proxy.js | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -5,7 +5,7 @@ * @description-ja プロクシ設定 * @minVersion 0.6pre * @author cho45, halt feits - * @version 0.6 + * @version 0.6.1 * ==/VimperatorPlugin== * * Usage: @@ -88,10 +88,11 @@ var proxy_settings = liberator.globalVariables.proxy_settings; - liberator.commands.addUserCommand(["proxy"], 'Proxy settings', function (args) { + commands.addUserCommand(["proxy"], 'Proxy settings', function (args) { const prefs = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefService); - var name = args; + .getService(Components.interfaces.nsIPrefService); + var name = (args.arguments.length > 1) ? args.arguments[0].toString() : args.string; + if (!name) { liberator.echo("Usage: proxy {setting name}"); } @@ -107,7 +108,7 @@ }); proxy_setting.settings.forEach(function (conf) { - liberator.options.setPref('network.proxy.' + conf.label, conf.param); + options.setPref('network.proxy.' + conf.label, conf.param); }); liberator.echo("Set config: " + name); |