mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-16 23:25:03 +00:00
Bug 257758 Add UI for WPAD and option for using the configured SOCKS proxy for DNS lookups to proxy preferences
r=neil, sr=shaver
This commit is contained in:
parent
dd97b9e981
commit
23d7b616b9
148
suite/common/pref/pref-proxies-advanced.js
Normal file
148
suite/common/pref/pref-proxies-advanced.js
Normal file
@ -0,0 +1,148 @@
|
||||
var httpParent;
|
||||
var httpPortParent;
|
||||
var sslParent;
|
||||
var sslPortParent;
|
||||
var ftpParent;
|
||||
var ftpPortParent;
|
||||
var gopherParent;
|
||||
var gopherPortParent;
|
||||
var socksParent;
|
||||
var socksPortParent;
|
||||
var socksVersionParent;
|
||||
var socksRemoteDNSParent;
|
||||
var shareSettingsParent;
|
||||
|
||||
var http;
|
||||
var httpPort;
|
||||
var ssl;
|
||||
var sslPort;
|
||||
var ftp;
|
||||
var ftpPort;
|
||||
var gopher;
|
||||
var gopherPort;
|
||||
var socks;
|
||||
var socksPort;
|
||||
var socksVersion;
|
||||
var socksRemoteDNS;
|
||||
var shareSettings;
|
||||
|
||||
var settings;
|
||||
var parentSettings;
|
||||
|
||||
function onLoad()
|
||||
{
|
||||
initElementVars();
|
||||
receiveSettingsFromProxyPanel();
|
||||
DoEnabling();
|
||||
}
|
||||
|
||||
function initElementVars()
|
||||
{
|
||||
httpParent = opener.document.getElementById("networkProxyHTTP");
|
||||
httpPortParent = opener.document.getElementById("networkProxyHTTP_Port");
|
||||
sslParent = opener.document.getElementById("networkProxySSL");
|
||||
sslPortParent = opener.document.getElementById("networkProxySSL_Port");
|
||||
ftpParent = opener.document.getElementById("networkProxyFTP");
|
||||
ftpPortParent = opener.document.getElementById("networkProxyFTP_Port");
|
||||
gopherParent = opener.document.getElementById("networkProxyGopher");
|
||||
gopherPortParent = opener.document.getElementById("networkProxyGopher_Port");
|
||||
socksParent = opener.document.getElementById("networkProxySOCKS");
|
||||
socksPortParent = opener.document.getElementById("networkProxySOCKS_Port");
|
||||
socksVersionParent = opener.document.getElementById("networkProxySOCKSVersion");
|
||||
socksRemoteDNSParent = opener.document.getElementById("networkProxySOCKSRemoteDNS");
|
||||
shareSettingsParent = opener.document.getElementById("networkProxyShareSettings");
|
||||
|
||||
http = document.getElementById("networkProxyHTTP");
|
||||
httpPort = document.getElementById("networkProxyHTTP_Port");
|
||||
ssl = document.getElementById("networkProxySSL");
|
||||
sslPort = document.getElementById("networkProxySSL_Port");
|
||||
ftp = document.getElementById("networkProxyFTP");
|
||||
ftpPort = document.getElementById("networkProxyFTP_Port");
|
||||
gopher = document.getElementById("networkProxyGopher");
|
||||
gopherPort = document.getElementById("networkProxyGopher_Port");
|
||||
socks = document.getElementById("networkProxySOCKS");
|
||||
socksPort = document.getElementById("networkProxySOCKS_Port");
|
||||
socksVersion = document.getElementById("networkProxySOCKSVersion");
|
||||
socksRemoteDNS = document.getElementById("networkProxySOCKSRemoteDNS");
|
||||
shareSettings = document.getElementById("networkProxyShareSettings");
|
||||
|
||||
// Convenience Arrays
|
||||
settings = [http, httpPort, ssl, sslPort, ftp, ftpPort, gopher, gopherPort,
|
||||
socks, socksPort, socksVersion, socksRemoteDNS, shareSettings];
|
||||
parentSettings = [httpParent, httpPortParent, sslParent, sslPortParent,
|
||||
ftpParent, ftpPortParent, gopherParent, gopherPortParent,
|
||||
socksParent, socksPortParent, socksVersionParent,
|
||||
socksRemoteDNSParent, shareSettingsParent];
|
||||
}
|
||||
|
||||
// Use "" instead of "0" as the default for the port number.
|
||||
// "0" doesn't make sense as a port number.
|
||||
function replaceZero(value)
|
||||
{
|
||||
return (value == "0") ? "" : value;
|
||||
}
|
||||
|
||||
function receiveSettingsFromProxyPanel()
|
||||
{
|
||||
// <textbox>es do have a "value" property ...
|
||||
http.value = httpParent.value;
|
||||
httpPort.value = httpPortParent.value;
|
||||
|
||||
// ... <data> elements only a "value" attribute.
|
||||
ssl.value = sslParent.getAttribute("value");
|
||||
sslPort.value = replaceZero(sslPortParent.getAttribute("value"));
|
||||
ftp.value = ftpParent.getAttribute("value");
|
||||
ftpPort.value = replaceZero(ftpPortParent.getAttribute("value"));
|
||||
gopher.value = gopherParent.getAttribute("value");
|
||||
gopherPort.value = replaceZero(gopherPortParent.getAttribute("value"));
|
||||
socks.value = socksParent.getAttribute("value");
|
||||
socksPort.value = replaceZero(socksPortParent.getAttribute("value"));
|
||||
socksVersion.value = socksVersionParent.getAttribute("value");
|
||||
socksRemoteDNS.checked = (socksRemoteDNSParent.getAttribute("value") == "true");
|
||||
shareSettings.checked = (shareSettingsParent.getAttribute("value") == "true");
|
||||
}
|
||||
|
||||
function sendSettingsToProxyPanel()
|
||||
{
|
||||
// <textbox>es do have a "value" property ...
|
||||
httpParent.value = http.value;
|
||||
httpPortParent.value = httpPort.value;
|
||||
|
||||
// ... <data> elements only a "value" attribute.
|
||||
sslParent.setAttribute("value", ssl.value);
|
||||
sslPortParent.setAttribute("value", sslPort.value);
|
||||
ftpParent.setAttribute("value", ftp.value);
|
||||
ftpPortParent.setAttribute("value", ftpPort.value);
|
||||
gopherParent.setAttribute("value", gopher.value);
|
||||
gopherPortParent.setAttribute("value", gopherPort.value);
|
||||
socksParent.setAttribute("value", socks.value);
|
||||
socksPortParent.setAttribute("value", socksPort.value);
|
||||
socksVersionParent.setAttribute("value", socksVersion.value);
|
||||
socksRemoteDNSParent.setAttribute("value", socksRemoteDNS.checked);
|
||||
shareSettingsParent.setAttribute("value", shareSettings.checked);
|
||||
}
|
||||
|
||||
function DoProxyCopy()
|
||||
{
|
||||
if (shareSettings.checked)
|
||||
{
|
||||
ftp.value = gopher.value = ssl.value = http.value;
|
||||
ftpPort.value = gopherPort.value = sslPort.value = httpPort.value;
|
||||
}
|
||||
}
|
||||
|
||||
function DoEnabling()
|
||||
{
|
||||
ftp.disabled = gopher.disabled = ssl.disabled =
|
||||
ftpPort.disabled = gopherPort.disabled = sslPort.disabled =
|
||||
shareSettings.checked;
|
||||
|
||||
disableLockedElements();
|
||||
}
|
||||
|
||||
function disableLockedElements()
|
||||
{
|
||||
for (var i = 0; i < parentSettings.length; i++)
|
||||
if (parentSettings[i].getAttribute("disabled") == "true")
|
||||
settings[i].disabled = true;
|
||||
}
|
202
suite/common/pref/pref-proxies-advanced.xul
Normal file
202
suite/common/pref/pref-proxies-advanced.xul
Normal file
@ -0,0 +1,202 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Netscape Communications Corporation.
|
||||
Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Stefan Borggraefe <Stefan.Borggraefe@gmx.de>
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
of those above. If you wish to allow use of your version of this file only
|
||||
under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
use your version of this file under the terms of the MPL, indicate your
|
||||
decision by deleting the provisions above and replace them with the notice
|
||||
and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the MPL, the GPL or the LGPL.
|
||||
|
||||
***** END LICENSE BLOCK ***** -->
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
|
||||
<!DOCTYPE dialog SYSTEM "chrome://communicator/locale/pref/pref-proxies-advanced.dtd" >
|
||||
|
||||
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
id="advancedProxyPreferences"
|
||||
title="&pref.proxies.advanced.title;"
|
||||
onload="onLoad();"
|
||||
buttons="accept,cancel,help"
|
||||
ondialogaccept="return sendSettingsToProxyPanel();"
|
||||
ondialoghelp="openHelp('advanced_pref_proxies');"
|
||||
style="width: 33em;"
|
||||
persist="screenX,screenY">
|
||||
|
||||
<script type="application/x-javascript"
|
||||
src="chrome://help/content/contextHelp.js"/>
|
||||
<script type="application/x-javascript"
|
||||
src="chrome://communicator/content/pref/pref-proxies-advanced.js"/>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&protocols.caption;"/>
|
||||
<description>&protocols.description;</description>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&http.label;" accesskey="&http.accesskey;"
|
||||
control="networkProxyHTTP"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<textbox id="networkProxyHTTP" preftype="string"
|
||||
prefstring="network.proxy.http"
|
||||
flex="1" class="uri-element" oninput="DoProxyCopy();"/>
|
||||
<label value="&port.label;" accesskey="&HTTPport.accesskey;"
|
||||
control="networkProxyHTTP_Port"/>
|
||||
<textbox id="networkProxyHTTP_Port" preftype="int"
|
||||
prefstring="network.proxy.http_port"
|
||||
size="5" oninput="DoProxyCopy();"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<spacer/>
|
||||
<hbox align="left">
|
||||
<checkbox id="networkProxyShareSettings" label="&reuseProxy.label;"
|
||||
accesskey="&reuseProxy.accesskey;"
|
||||
oncommand="DoEnabling(); DoProxyCopy();"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<separator class="thin"/>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&ssl.label;" accesskey="&ssl.accesskey;"
|
||||
control="networkProxySSL"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<textbox id="networkProxySSL" preftype="string"
|
||||
prefstring="network.proxy.ssl"
|
||||
flex="1" class="uri-element"/>
|
||||
<label value="&port.label;" accesskey="&SSLport.accesskey;"
|
||||
control="networkProxySSL_Port"/>
|
||||
<textbox id="networkProxySSL_Port" preftype="int"
|
||||
prefstring="network.proxy.ssl_port" size="5"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&ftp.label;" accesskey="&ftp.accesskey;"
|
||||
control="networkProxyFTP"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<textbox id="networkProxyFTP" preftype="string"
|
||||
prefstring="network.proxy.ftp" flex="1"
|
||||
class="uri-element"/>
|
||||
<label value="&port.label;" accesskey="&FTPport.accesskey;"
|
||||
control="networkProxyFTP_Port"/>
|
||||
<textbox id="networkProxyFTP_Port" preftype="int"
|
||||
prefstring="network.proxy.ftp_port" size="5"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&gopher.label;" accesskey="&gopher.accesskey;"
|
||||
control="networkProxyGopher"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<textbox id="networkProxyGopher" preftype="string"
|
||||
prefstring="network.proxy.gopher"
|
||||
flex="1" class="uri-element"/>
|
||||
<label value="&port.label;" control="networkProxyGopher_Port"/>
|
||||
<textbox id="networkProxyGopher_Port" preftype="int"
|
||||
prefstring="network.proxy.gopher_port"
|
||||
prefattribute="value" size="5"/>
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&socks.caption;"/>
|
||||
<description>&socks.description;</description>
|
||||
|
||||
<grid>
|
||||
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&socks.label;" accesskey="&socks.accesskey;"
|
||||
control="networkProxySOCKS"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<textbox id="networkProxySOCKS" preftype="string"
|
||||
prefstring="network.proxy.socks"
|
||||
flex="1" class="uri-element"/>
|
||||
<label value="&port.label;" accesskey="&SOCKSport.accesskey;"
|
||||
control="networkProxySOCKS_Port"/>
|
||||
<textbox id="networkProxySOCKS_Port" preftype="int"
|
||||
prefstring="network.proxy.socks_port"
|
||||
size="5"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<spacer/>
|
||||
<radiogroup id="networkProxySOCKSVersion" orient="horizontal"
|
||||
prefstring="network.proxy.socks_version">
|
||||
<radio id="networkProxySOCKSVersion4" value="4"
|
||||
label="&socks4.label;" accesskey="&socks4.accesskey;"/>
|
||||
<radio id="networkProxySOCKSVersion5" value="5"
|
||||
label="&socks5.label;" accesskey="&socks5.accesskey;"/>
|
||||
</radiogroup>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<spacer/>
|
||||
<hbox align="left">
|
||||
<checkbox id="networkProxySOCKSRemoteDNS"
|
||||
label="&socksRemoteDNS.label;"
|
||||
accesskey="&socksRemoteDNS.accesskey;"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
|
||||
</dialog>
|
@ -1,108 +1,158 @@
|
||||
var http;
|
||||
var httpPort;
|
||||
var noProxy;
|
||||
var ssl;
|
||||
var sslPort;
|
||||
var ftp;
|
||||
var ftpPort;
|
||||
var gopher;
|
||||
var gopherPort;
|
||||
var socks;
|
||||
var socksPort;
|
||||
var socksVersion;
|
||||
var socksRemoteDNS;
|
||||
var advancedButton;
|
||||
var autoURL;
|
||||
var autoReload;
|
||||
var radiogroup;
|
||||
var shareSettings;
|
||||
|
||||
function Startup()
|
||||
{
|
||||
initElementVars();
|
||||
|
||||
// Calculate a sane default for network.proxy.share_proxy_settings.
|
||||
if (shareSettings.getAttribute("value") == "")
|
||||
shareSettings.setAttribute("value", defaultForShareSettingsPref());
|
||||
|
||||
DoEnabling();
|
||||
|
||||
// Use "" instead of "0" as the default for the port number.
|
||||
// "0" doesn't make sense as a port number.
|
||||
if (httpPort.value == "0")
|
||||
httpPort.setAttribute("value", "");
|
||||
|
||||
// The pref value 3 for network.proxy.type is unused to maintain
|
||||
// backwards compatibility. Treat 3 equally to 0. See bug 115720.
|
||||
if (radiogroup.value == 3)
|
||||
radiogroup.selectedIndex = 0;
|
||||
}
|
||||
|
||||
function initElementVars()
|
||||
{
|
||||
http = document.getElementById("networkProxyHTTP");
|
||||
httpPort = document.getElementById("networkProxyHTTP_Port");
|
||||
ssl = document.getElementById("networkProxySSL");
|
||||
sslPort = document.getElementById("networkProxySSL_Port");
|
||||
ftp = document.getElementById("networkProxyFTP");
|
||||
ftpPort = document.getElementById("networkProxyFTP_Port");
|
||||
gopher = document.getElementById("networkProxyGopher");
|
||||
gopherPort = document.getElementById("networkProxyGopher_Port");
|
||||
socks = document.getElementById("networkProxySOCKS");
|
||||
socksPort = document.getElementById("networkProxySOCKS_Port");
|
||||
socksVersion = document.getElementById("networkProxySOCKSVersion");
|
||||
socksRemoteDNS = document.getElementById("networkProxySOCKSRemoteDNS");
|
||||
noProxy = document.getElementById("networkProxyNone");
|
||||
advancedButton = document.getElementById("advancedButton");
|
||||
autoURL = document.getElementById("networkProxyAutoconfigURL");
|
||||
autoReload = document.getElementById("autoReload");
|
||||
radiogroup = document.getElementById("networkProxyType");
|
||||
shareSettings = document.getElementById("networkProxyShareSettings");
|
||||
}
|
||||
|
||||
// Returns true if all protocol specific proxies and all their
|
||||
// ports are set to the same value, false otherwise.
|
||||
function defaultForShareSettingsPref()
|
||||
{
|
||||
return http.value == ftp.getAttribute("value") &&
|
||||
http.value == gopher.getAttribute("value") &&
|
||||
http.value == ssl.getAttribute("value") &&
|
||||
httpPort.value == ftpPort.getAttribute("value") &&
|
||||
httpPort.value == sslPort.getAttribute("value") &&
|
||||
httpPort.value == gopherPort.getAttribute("value");
|
||||
}
|
||||
|
||||
function DoEnabling()
|
||||
{
|
||||
var i;
|
||||
var ftp = document.getElementById("networkProxyFTP");
|
||||
var ftpPort = document.getElementById("networkProxyFTP_Port");
|
||||
var gopher = document.getElementById("networkProxyGopher");
|
||||
var gopherPort = document.getElementById("networkProxyGopher_Port");
|
||||
var http = document.getElementById("networkProxyHTTP");
|
||||
var httpPort = document.getElementById("networkProxyHTTP_Port");
|
||||
var socks = document.getElementById("networkProxySOCKS");
|
||||
var socksPort = document.getElementById("networkProxySOCKS_Port");
|
||||
var socksVersion = document.getElementById("networkProxySOCKSVersion");
|
||||
var socksVersion4 = document.getElementById("networkProxySOCKSVersion4");
|
||||
var socksVersion5 = document.getElementById("networkProxySOCKSVersion5");
|
||||
var ssl = document.getElementById("networkProxySSL");
|
||||
var sslPort = document.getElementById("networkProxySSL_Port");
|
||||
var noProxy = document.getElementById("networkProxyNone");
|
||||
var autoURL = document.getElementById("networkProxyAutoconfigURL");
|
||||
var autoReload = document.getElementById("autoReload");
|
||||
var copyButton = document.getElementById("reuseProxy");
|
||||
|
||||
{
|
||||
// convenience arrays
|
||||
var manual = [ftp, ftpPort, gopher, gopherPort, http, httpPort, socks, socksPort, socksVersion, socksVersion4, socksVersion5, ssl, sslPort, noProxy, copyButton];
|
||||
var manual = [ftp, ftpPort, gopher, gopherPort, http, httpPort, socks,
|
||||
socksPort, socksVersion, socksRemoteDNS, ssl, sslPort, noProxy,
|
||||
advancedButton, shareSettings];
|
||||
var auto = [autoURL, autoReload];
|
||||
|
||||
// radio buttons
|
||||
var radiogroup = document.getElementById("networkProxyType");
|
||||
|
||||
var prefstring;
|
||||
switch ( radiogroup.value ) {
|
||||
switch (radiogroup.value)
|
||||
{
|
||||
case "0":
|
||||
for (i = 0; i < manual.length; i++)
|
||||
manual[i].setAttribute( "disabled", "true" );
|
||||
for (i = 0; i < auto.length; i++)
|
||||
auto[i].setAttribute( "disabled", "true" );
|
||||
case "4":
|
||||
disable(manual);
|
||||
disable(auto);
|
||||
break;
|
||||
case "1":
|
||||
for (i = 0; i < auto.length; i++)
|
||||
auto[i].setAttribute( "disabled", "true" );
|
||||
disable(auto);
|
||||
if (!radiogroup.disabled)
|
||||
for (i = 0; i < manual.length; i++) {
|
||||
prefstring = manual[i].getAttribute( "prefstring" );
|
||||
if (!parent.hPrefWindow.getPrefIsLocked(prefstring))
|
||||
manual[i].removeAttribute( "disabled" );
|
||||
}
|
||||
enableUnlockedElements(manual);
|
||||
break;
|
||||
case "2":
|
||||
default:
|
||||
for (i = 0; i < manual.length; i++)
|
||||
manual[i].setAttribute( "disabled", "true" );
|
||||
disable(manual);
|
||||
if (!radiogroup.disabled)
|
||||
for (i = 0; i < auto.length; i++) {
|
||||
prefstring = manual[i].getAttribute( "prefstring" );
|
||||
if (!parent.hPrefWindow.getPrefIsLocked(prefstring))
|
||||
auto[i].removeAttribute( "disabled" );
|
||||
}
|
||||
enableUnlockedElements(auto);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function disable(elements)
|
||||
{
|
||||
for (var i = 0; i < elements.length; i++)
|
||||
elements[i].setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
function enableUnlockedElements(elements)
|
||||
{
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var prefstring = elements[i].getAttribute("prefstring");
|
||||
if (!parent.hPrefWindow.getPrefIsLocked(prefstring))
|
||||
elements[i].removeAttribute("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
const nsIProtocolProxyService = Components.interfaces.nsIProtocolProxyService;
|
||||
const kPROTPROX_CID = '{e9b301c0-e0e4-11D3-a1a8-0050041caf44}';
|
||||
|
||||
function ReloadPAC() {
|
||||
var autoURL = document.getElementById("networkProxyAutoconfigURL");
|
||||
var pps = Components.classesByID[kPROTPROX_CID]
|
||||
.getService(nsIProtocolProxyService);
|
||||
pps.configureFromPAC(autoURL.value);
|
||||
}
|
||||
|
||||
function DoProxyCopy()
|
||||
{
|
||||
var http = document.getElementById("networkProxyHTTP");
|
||||
var httpPort = document.getElementById("networkProxyHTTP_Port");
|
||||
var httpValue = http.value;
|
||||
var httpPortValue = httpPort.value;
|
||||
if (httpValue && httpPortValue && parseInt(httpPortValue) > 0) {
|
||||
var ftp = document.getElementById("networkProxyFTP");
|
||||
var gopher = document.getElementById("networkProxyGopher");
|
||||
var ssl = document.getElementById("networkProxySSL");
|
||||
var ftpPort = document.getElementById("networkProxyFTP_Port");
|
||||
var gopherPort = document.getElementById("networkProxyGopher_Port");
|
||||
var sslPort = document.getElementById("networkProxySSL_Port");
|
||||
ftp.value = httpValue;
|
||||
gopher.value = httpValue;
|
||||
ssl.value = httpValue;
|
||||
ftpPort.value = httpPortValue;
|
||||
gopherPort.value = httpPortValue;
|
||||
sslPort.value = httpPortValue;
|
||||
}
|
||||
}
|
||||
|
||||
function FixProxyURL()
|
||||
{
|
||||
const nsIURIFixup = Components.interfaces.nsIURIFixup;
|
||||
var proxyURL = document.getElementById("networkProxyAutoconfigURL");
|
||||
try {
|
||||
var URIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
|
||||
.getService(nsIURIFixup);
|
||||
proxyURL.value = URIFixup.createFixupURI(proxyURL.value,
|
||||
nsIURIFixup.FIXUP_FLAG_NONE).spec;
|
||||
autoURL.value = URIFixup.createFixupURI(autoURL.value,
|
||||
nsIURIFixup.FIXUP_FLAG_NONE).spec;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function openAdvancedDialog()
|
||||
{
|
||||
openDialog("chrome://communicator/content/pref/pref-proxies-advanced.xul",
|
||||
"AdvancedProxyPreferences",
|
||||
"chrome,titlebar,centerscreen,resizable=no,modal");
|
||||
}
|
||||
|
||||
function DoProxyCopy()
|
||||
{
|
||||
if (shareSettings.getAttribute("value") != "true")
|
||||
return;
|
||||
|
||||
ftp.setAttribute("value", http.value);
|
||||
ssl.setAttribute("value", http.value);
|
||||
gopher.setAttribute("value", http.value);
|
||||
|
||||
ftpPort.setAttribute("value", httpPort.value);
|
||||
sslPort.setAttribute("value", httpPort.value);
|
||||
gopherPort.setAttribute("value", httpPort.value);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Stefan Borggraefe <Stefan.Borggraefe@gmx.de>
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
@ -44,12 +45,12 @@
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["networkProxyType",
|
||||
var _elementIDs = ["networkProxyType", "networkProxyShareSettings",
|
||||
"networkProxyFTP", "networkProxyFTP_Port",
|
||||
"networkProxyGopher", "networkProxyGopher_Port",
|
||||
"networkProxyHTTP", "networkProxyHTTP_Port",
|
||||
"networkProxySOCKS", "networkProxySOCKS_Port",
|
||||
"networkProxySOCKSVersion",
|
||||
"networkProxySOCKSVersion", "networkProxySOCKSRemoteDNS",
|
||||
"networkProxySSL", "networkProxySSL_Port",
|
||||
"networkProxyNone", "networkProxyAutoconfigURL"];
|
||||
]]>
|
||||
@ -58,14 +59,40 @@
|
||||
<stringbundle id="bundle_prefutilities"
|
||||
src="chrome://pref/locale/prefutilities.properties"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/pref/pref-proxies.js"/>
|
||||
|
||||
<groupbox flex="1">
|
||||
<caption label="&proxyTitle.label;"/>
|
||||
|
||||
<description>&proxy.description;</description>
|
||||
<groupbox>
|
||||
<caption label="&proxyTitle.label;"/>
|
||||
<radiogroup id="networkProxyType" prefstring="network.proxy.type" align="stretch">
|
||||
<radio value="0" label="&directTypeRadio.label;" accesskey="&directTypeRadio.accesskey;" oncommand="DoEnabling();"/>
|
||||
<radio value="1" label="&manualTypeRadio.label;" accesskey="&manualTypeRadio.accesskey;" oncommand="DoEnabling();"/>
|
||||
<grid class="indent" flex="1">
|
||||
<vbox align="left">
|
||||
<radio value="0" label="&directTypeRadio.label;"
|
||||
accesskey="&directTypeRadio.accesskey;"
|
||||
oncommand="DoEnabling();"/>
|
||||
|
||||
<radio value="4" label="&wpadTypeRadio.label;"
|
||||
accesskey="&wpadTypeRadio.accesskey;"
|
||||
oncommand="DoEnabling();"/>
|
||||
|
||||
<radio value="2" label="&autoTypeRadio.label;"
|
||||
accesskey="&autoTypeRadio.accesskey;"
|
||||
oncommand="DoEnabling();"/>
|
||||
</vbox>
|
||||
|
||||
<hbox class="indent" flex="1" align="center">
|
||||
<textbox id="networkProxyAutoconfigURL" flex="1" preftype="string" class="uri-element"
|
||||
prefstring="network.proxy.autoconfig_url" onchange="FixProxyURL();"/>
|
||||
<button id="autoReload" label="&reload.label;" accesskey="&reload.accesskey;"
|
||||
oncommand="ReloadPAC();"
|
||||
prefstring="pref.advanced.proxies.disable_button.reload"/>
|
||||
</hbox>
|
||||
|
||||
<vbox align="left">
|
||||
<radio value="1" label="&manualTypeRadio.label;"
|
||||
accesskey="&manualTypeRadio.accesskey;"
|
||||
oncommand="DoEnabling();"/>
|
||||
</vbox>
|
||||
|
||||
<grid class="indent">
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
@ -78,75 +105,15 @@
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<textbox id="networkProxyHTTP" preftype="string" prefstring="network.proxy.http"
|
||||
flex="1" class="uri-element"/>
|
||||
flex="1" class="uri-element" onchange="DoProxyCopy();"/>
|
||||
<label value="&port.label;" accesskey="&HTTPport.accesskey;" control="networkProxyHTTP_Port"/>
|
||||
<textbox id="networkProxyHTTP_Port" preftype="int" prefstring="network.proxy.http_port"
|
||||
size="5"/>
|
||||
size="5" onchange="DoProxyCopy();"/>
|
||||
<button id="advancedButton" label="&advanced.label;"
|
||||
accesskey="&advanced.accesskey;"
|
||||
oncommand="openAdvancedDialog();"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row>
|
||||
<spacer/>
|
||||
<hbox align="center">
|
||||
<button id="reuseProxy" label="&reuseProxy.label;" accesskey="&reuseProxy.accesskey;" oncommand="DoProxyCopy();" />
|
||||
</hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&ssl.label;" accesskey="&ssl.accesskey;" control="networkProxySSL"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<textbox id="networkProxySSL" preftype="string" prefstring="network.proxy.ssl"
|
||||
flex="1" class="uri-element"/>
|
||||
<label value="&port.label;" accesskey="&SSLport.accesskey;" control="networkProxySSL_Port"/>
|
||||
<textbox id="networkProxySSL_Port" preftype="int" prefstring="network.proxy.ssl_port"
|
||||
size="5"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&ftp.label;" accesskey="&ftp.accesskey;" control="networkProxyFTP"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<textbox id="networkProxyFTP" preftype="string" prefstring="network.proxy.ftp"
|
||||
flex="1" class="uri-element"/>
|
||||
<label value="&port.label;" accesskey="&FTPport.accesskey;" control="networkProxyFTP_Port"/>
|
||||
<textbox id="networkProxyFTP_Port" preftype="int" prefstring="network.proxy.ftp_port"
|
||||
size="5"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&gopher.label;" accesskey="&gopher.accesskey;" control="networkProxyGopher"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<textbox id="networkProxyGopher" preftype="string" prefstring="network.proxy.gopher"
|
||||
flex="1" class="uri-element"/>
|
||||
<!-- gopher port doesn't have an accesskey because the window needs a redesign - bbaetz -->
|
||||
<label value="&port.label;" accesskey="&gopherPort.accesskey;" control="networkProxyGopher_Port"/>
|
||||
<textbox id="networkProxyGopher_Port" preftype="int" prefstring="network.proxy.gopher_port"
|
||||
prefattribute="value" size="5"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&socks.label;" accesskey="&socks.accesskey;" control="networkProxySOCKS"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<textbox id="networkProxySOCKS" preftype="string" prefstring="network.proxy.socks"
|
||||
flex="1" class="uri-element"/>
|
||||
<label value="&port.label;" accesskey="&SOCKSport.accesskey;" control="networkProxySOCKS_Port"/>
|
||||
<textbox id="networkProxySOCKS_Port" preftype="int" prefstring="network.proxy.socks_port"
|
||||
size="5"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row>
|
||||
<spacer/>
|
||||
<radiogroup id="networkProxySOCKSVersion" orient="horizontal"
|
||||
prefstring="network.proxy.socks_version">
|
||||
<radio id="networkProxySOCKSVersion4" value="4" label="&socks4.label;" accesskey="&socks4.accesskey;" />
|
||||
<radio id="networkProxySOCKSVersion5" value="5" label="&socks5.label;" accesskey="&socks5.accesskey;" />
|
||||
</radiogroup>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
@ -160,16 +127,35 @@
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;" oncommand="DoEnabling();"/>
|
||||
<hbox class="indent" flex="1" align="center">
|
||||
<textbox id="networkProxyAutoconfigURL" flex="1" preftype="string" class="uri-element"
|
||||
prefstring="network.proxy.autoconfig_url" onchange="FixProxyURL();"/>
|
||||
<button id="autoReload" label="&reload.label;" accesskey="&reload.accesskey;"
|
||||
oncommand="ReloadPAC();"
|
||||
prefstring="pref.advanced.proxies.disable_button.reload"/>
|
||||
</hbox>
|
||||
</radiogroup>
|
||||
|
||||
</groupbox>
|
||||
</page>
|
||||
|
||||
<!-- Data elements for data transfer to and from the "Advanced" dialog. -->
|
||||
<data id="networkProxySSL" prefattribute="value"
|
||||
preftype="string" prefstring="network.proxy.ssl"/>
|
||||
<data id="networkProxySSL_Port" prefattribute="value"
|
||||
preftype="int" prefstring="network.proxy.ssl_port"/>
|
||||
|
||||
<data id="networkProxyFTP" prefattribute="value"
|
||||
preftype="string" prefstring="network.proxy.ftp"/>
|
||||
<data id="networkProxyFTP_Port" prefattribute="value"
|
||||
preftype="int" prefstring="network.proxy.ftp_port"/>
|
||||
|
||||
<data id="networkProxyGopher" prefattribute="value"
|
||||
preftype="string" prefstring="network.proxy.gopher"/>
|
||||
<data id="networkProxyGopher_Port" prefattribute="value"
|
||||
preftype="int" prefstring="network.proxy.gopher_port"/>
|
||||
|
||||
<data id="networkProxySOCKS" prefattribute="value"
|
||||
preftype="string" prefstring="network.proxy.socks"/>
|
||||
<data id="networkProxySOCKS_Port" prefattribute="value"
|
||||
preftype="int" prefstring="network.proxy.socks_port"/>
|
||||
<data id="networkProxySOCKSVersion" prefattribute="value"
|
||||
preftype="int" prefstring="network.proxy.socks_version"/>
|
||||
<data id="networkProxySOCKSRemoteDNS" prefattribute="value"
|
||||
preftype="bool" prefstring="network.proxy.socks_remote_dns"/>
|
||||
|
||||
<data id="networkProxyShareSettings" prefattribute="value"
|
||||
preftype="bool" prefdefval=""
|
||||
prefstring="network.proxy.share_proxy_settings"/>
|
||||
</page>
|
||||
|
@ -0,0 +1,30 @@
|
||||
<!--LOCALIZATION NOTE : FILE The Advanced Proxy Preferences dialog -->
|
||||
<!ENTITY pref.proxies.advanced.title "Advanced Proxy Preferences">
|
||||
<!ENTITY protocols.caption "Protocol-Specific Proxies">
|
||||
<!ENTITY protocols.description "Normally the same proxy can handle all protocols listed here.">
|
||||
<!ENTITY ftp.label "FTP Proxy:">
|
||||
<!ENTITY ftp.accesskey "F">
|
||||
<!ENTITY gopher.label "Gopher Proxy:">
|
||||
<!ENTITY gopher.accesskey "G">
|
||||
<!ENTITY http.label "HTTP Proxy:">
|
||||
<!ENTITY http.accesskey "T">
|
||||
<!ENTITY reuseProxy.label "Use HTTP Proxy settings for all protocols">
|
||||
<!ENTITY reuseProxy.accesskey "U">
|
||||
<!ENTITY ssl.label "SSL Proxy:">
|
||||
<!ENTITY ssl.accesskey "S">
|
||||
<!ENTITY socks.caption "Generic Proxy">
|
||||
<!ENTITY socks.description "A SOCKS proxy is a generic proxy sometimes used in corporate or similar environments.">
|
||||
<!ENTITY socks.label "SOCKS Proxy:">
|
||||
<!ENTITY socks.accesskey "O">
|
||||
<!ENTITY socks4.label "SOCKS v4">
|
||||
<!ENTITY socks4.accesskey "C">
|
||||
<!ENTITY socks5.label "SOCKS v5">
|
||||
<!ENTITY socks5.accesskey "K">
|
||||
<!ENTITY socksRemoteDNS.label "Use for resolving hostnames (recommended for SOCKS v5)">
|
||||
<!ENTITY socksRemoteDNS.accesskey "e">
|
||||
<!ENTITY port.label "Port:">
|
||||
<!ENTITY HTTPport.accesskey "P">
|
||||
<!ENTITY SSLport.accesskey "o">
|
||||
<!ENTITY FTPport.accesskey "r">
|
||||
<!-- No accesskey for gopher (':' doesn't go well) -->
|
||||
<!ENTITY SOCKSport.accesskey "t">
|
@ -3,39 +3,23 @@
|
||||
<!--LOCALIZATION NOTE : FILE The Proxies preferences dialog -->
|
||||
<!ENTITY lHeader "Proxies">
|
||||
<!ENTITY proxyTitle.label "Configure Proxies to Access the Internet">
|
||||
<!ENTITY proxy.description "A Proxy is a network service that can filter and speed up your Internet connection.">
|
||||
<!ENTITY directTypeRadio.label "Direct connection to the Internet">
|
||||
<!ENTITY directTypeRadio.accesskey "d">
|
||||
<!ENTITY manualTypeRadio.label "Manual proxy configuration">
|
||||
<!ENTITY manualTypeRadio.accesskey "m">
|
||||
<!ENTITY directTypeRadio.accesskey "D">
|
||||
<!ENTITY manualTypeRadio.label "Manual proxy configuration:">
|
||||
<!ENTITY manualTypeRadio.accesskey "M">
|
||||
<!ENTITY wpadTypeRadio.label "Automatically discover the proxy configuration">
|
||||
<!ENTITY wpadTypeRadio.accesskey "A">
|
||||
<!ENTITY autoTypeRadio.label "Automatic proxy configuration URL:">
|
||||
<!ENTITY autoTypeRadio.accesskey "a">
|
||||
<!ENTITY configAutoconfigText.label "Configuration location (URL):">
|
||||
<!ENTITY configAutoconfigText.accesskey "u">
|
||||
<!ENTITY autoTypeRadio.accesskey "c">
|
||||
<!ENTITY reload.label "Reload">
|
||||
<!ENTITY reload.accesskey "l">
|
||||
<!ENTITY ftp.label "FTP Proxy:">
|
||||
<!ENTITY ftp.accesskey "f">
|
||||
<!ENTITY gopher.label "Gopher Proxy:">
|
||||
<!ENTITY gopher.accesskey "g">
|
||||
<!ENTITY http.label "HTTP Proxy:">
|
||||
<!ENTITY http.accesskey "x">
|
||||
<!ENTITY reuseProxy.label "Use these settings for SSL, FTP and Gopher">
|
||||
<!ENTITY reuseProxy.accesskey "e">
|
||||
<!ENTITY ssl.label "SSL Proxy:">
|
||||
<!ENTITY ssl.accesskey "s">
|
||||
<!ENTITY socks.label "SOCKS Host:">
|
||||
<!ENTITY socks.accesskey "c">
|
||||
<!ENTITY socks4.label "SOCKS v4">
|
||||
<!ENTITY socks4.accesskey "k">
|
||||
<!ENTITY socks5.label "SOCKS v5">
|
||||
<!ENTITY socks5.accesskey "v">
|
||||
<!ENTITY reload.accesskey "R">
|
||||
<!ENTITY http.label "Proxy:">
|
||||
<!ENTITY http.accesskey "P">
|
||||
<!ENTITY port.label "Port:">
|
||||
<!ENTITY HTTPport.accesskey "p">
|
||||
<!ENTITY SSLport.accesskey "o">
|
||||
<!ENTITY FTPport.accesskey "r">
|
||||
<!-- No accesskey for gopher (':' doesn't go well) - mpt's going to redesign the window -->
|
||||
<!ENTITY gopherPort.accesskey "">
|
||||
<!ENTITY SOCKSport.accesskey "t">
|
||||
<!ENTITY HTTPport.accesskey "o">
|
||||
<!ENTITY advanced.label "Advanced...">
|
||||
<!ENTITY advanced.accesskey "v">
|
||||
<!ENTITY noproxy.label "No Proxy for:">
|
||||
<!ENTITY noproxy.accesskey "n">
|
||||
<!ENTITY noproxyExplain.label "Example: .mozilla.org, .net.nz">
|
||||
<!ENTITY noproxy.accesskey "N">
|
||||
<!ENTITY noproxyExplain.label "Example: .mozilla.org, .net.nz, 192.168.1.0/24">
|
||||
|
Loading…
x
Reference in New Issue
Block a user