title: How to change proxy IP of selenium webdriver dynamically？Like some js plugins
body: <p>Some js plugins can indeed do. How?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  js_code = f"""
              var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
              prefs.setIntPref("network.proxy.type", 1);
              prefs.setCharPref("network.proxy.http", "${host}");
              prefs.setIntPref("network.proxy.http_port", "${port}");
              prefs.setCharPref("network.proxy.ssl", "${host}");
              prefs.setIntPref("network.proxy.ssl_port", "${port}");
              prefs.setCharPref("network.proxy.ftp", "${host}");
              prefs.setIntPref("network.proxy.ftp_port", "${port}");   
              """</code></pre>
  </div>
  </div>
  
  It is not effict。</p>