experimental .xpi version

This commit is contained in:
idk
2019-02-05 17:27:39 -05:00
parent c2ee549700
commit 6c87a44cd9
5 changed files with 81 additions and 18 deletions

View File

@@ -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() {});
}