firefox代理设置的源码

如何通过修改firefox的源码来设置firefox的代理,即找到下图代理设置界面所对应的源码

通过分析firefox源码知道,该部分的源码在browser/components/preferences/connection.xul文件中.用户可以根据需求,通过修改connection.xul的源码,来实现定制firefox浏览器的目的

firefox有个autoproxy插件很好用

恩,这个我知道,现在想研究下如何在代码里面把代理写死

在browser/components/preferences/connection.js文件中,将 checkForSystemProxy: function ()中的代码修改为下面的代码所示,即可将默认配置写入到源代码中

  proxyTypeChanged: function ()
  {
   var proxyTypePref = document.getElementById("network.proxy.type");
   proxyTypePref.value =1;
   
   // Update http
   var httpProxyURLPref = document.getElementById("network.proxy.http");
   httpProxyURLPref.value="172.19.4.68";
   
   httpProxyURLPref.disabled = proxyTypePref.value == 1;
   var httpProxyPortPref = document.getElementById("network.proxy.http_port");
   httpProxyPortPref.value="3128";
   httpProxyPortPref.disabled = proxyTypePref.value == 1;

   // Now update the other protocols
   this.updateProtocolPrefs();

   var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
   shareProxiesPref.disabled = proxyTypePref.value == 1;
   
   var noProxiesPref = document.getElementById("network.proxy.no_proxies_on");
   noProxiesPref.disabled = proxyTypePref.value == 1;
   
   var autoconfigURLPref = document.getElementById("network.proxy.autoconfig_url");
   autoconfigURLPref.disabled = proxyTypePref.value == 2;

   this.updateReloadButton();
  },