From e8e8c3772acca20d4c2576ee3b09ad0271d48148 Mon Sep 17 00:00:00 2001 From: otsune Date: Sun, 26 Oct 2008 18:13:46 +0000 Subject: fix scope. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22194 d0d07461-0603-4401-acd4-de1884942a52 --- proxy.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'proxy.js') diff --git a/proxy.js b/proxy.js index d99b0f1..2a0ff9a 100644 --- a/proxy.js +++ b/proxy.js @@ -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); -- cgit v1.2.3