ad pac file based proxy setting so it can be easy on Android

This commit is contained in:
idk
2019-03-16 11:28:20 -04:00
parent b03a223864
commit 2a3e6c736e
5 changed files with 32 additions and 19 deletions

View File

@@ -9,6 +9,14 @@ function isFirefox() {
}
return false
}
function isDroid() {
testPlain = navigator.userAgent.indexOf('Android') !== -1;
if (testPlain) {
return testPlain
}
return false
}
if (isFirefox()) {
browser.privacy.network.peerConnectionEnabled.set({value: false});
}
@@ -20,19 +28,24 @@ console.log("Preliminarily disabled WebRTC.")
var controlHost = "127.0.0.1" //getControlHost()
var controlPort = "7951" //getControlPort();
function setupProxy() {
var controlHost = getControlHost();
var controlPort = getControlPort();
if (isFirefox()) {
if (getScheme() == "http") {
var proxySettings = {
proxyType: "manual",
http: getHost()+":"+getPort(),
passthrough: "",
httpProxyAll: true
};
chrome.proxy.settings.set({value:proxySettings});
console.log("i2p settings created for Firefox")
if (isDroid()) {
browser.proxy.register("android.pac");
}else{
if (getScheme() == "http") {
var proxySettings = {
proxyType: "manual",
http: getHost()+":"+getPort(),
passthrough: "",
httpProxyAll: true
};
chrome.proxy.settings.set({value:proxySettings});
console.log("i2p settings created for Firefox")
}
}
}else{
var config = {