experimental .xpi version
This commit is contained in:
57
proxy.js
57
proxy.js
@@ -1,9 +1,50 @@
|
||||
function isFirefox() {
|
||||
testPlain = navigator.userAgent.indexOf('Firefox') !== -1;
|
||||
if (testPlain) {
|
||||
return testPlain
|
||||
}
|
||||
testTorBrowser = navigator.userAgent.indexOf('Tor') !== -1;
|
||||
if (testTorBrowser) {
|
||||
return testTorBrowser
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var proxySettings = {
|
||||
proxyType: "manual",
|
||||
http: "http://127.0.0.1:4444",
|
||||
passthrough: "",
|
||||
httpProxyAll: true
|
||||
};
|
||||
|
||||
browser.proxy.settings.set({value:proxySettings});
|
||||
if (isFirefox()) {
|
||||
var proxySettings = {
|
||||
proxyType: "manual",
|
||||
http: "http://127.0.0.1:4444",
|
||||
passthrough: "",
|
||||
httpProxyAll: true
|
||||
};
|
||||
browser.proxy.settings.set({value:proxySettings});
|
||||
}else{
|
||||
var config = {
|
||||
mode: "fixed_servers",
|
||||
rules: {
|
||||
proxyForHttp: {
|
||||
scheme: "http",
|
||||
host: "127.0.0.1",
|
||||
port: 4444
|
||||
},
|
||||
proxyForFtp: {
|
||||
scheme: "http",
|
||||
host: "127.0.0.1",
|
||||
port: 4444
|
||||
},
|
||||
proxyForHttps: {
|
||||
scheme: "http",
|
||||
host: "127.0.0.1",
|
||||
port: 4444
|
||||
},
|
||||
fallbackProxy: {
|
||||
scheme: "http",
|
||||
host: "127.0.0.1",
|
||||
port: 4444
|
||||
}
|
||||
}
|
||||
};
|
||||
chrome.proxy.settings.set(
|
||||
{value: config, scope: 'regular'},
|
||||
function() {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user