finally a semi-universal fix for the android issues

This commit is contained in:
idk
2019-05-03 18:40:46 -04:00
parent d3caa41ead
commit 0ab95a5cb4
3 changed files with 48 additions and 29 deletions

View File

@@ -46,3 +46,11 @@ profile-install:
sudo cp ./i2psetproxy.js@eyedeekay.github.io.xpi /usr/local/lib/firefox.profile.i2p/firefox.profile.i2p/extensions/
pi: profile-install
DESC="A simple plugin for configuring an i2p browser."
release:
gothub release -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n $(VERSION) -d $(DESC)
upload:
gothub upload -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n "i2psetproxy.js@eyedeekay.github.io.xpi" -f "../i2psetproxy.js@eyedeekay.github.io.xpi"

View File

@@ -119,23 +119,27 @@ function setupProxy() {
//var controlPort = getControlPort()
var Host = getHost()
var Port = getPort()
console.log("Setting up Firefox Desktop proxy")
var proxySettings = {
proxyType: "manual",
http: Host+":"+Port,
passthrough: "",
httpProxyAll: true
};
browser.proxy.settings.set({value:proxySettings});
console.log("i2p settings created for Firefox Desktop")
if (isDroid()) {
console.log("Setting up Firefox Android proxy")
if (Port == "7950") {
browser.proxy.register("android-ext.pac");
}else{
browser.proxy.register("android.pac");
function handleProxyRequest(requestInfo) {
if (shouldProxyRequest(requestInfo)) {
console.log(`Proxying: ${requestInfo.url}`);
return {type: "http", host: Host, port: Port};
}
return {type: "http", host: Host, port: Port};
}
browser.proxy.onRequest.addListener(handleProxyRequest, {urls: ["<all_urls>"]});
console.log("i2p settings created for Firefox Android")
}else{
console.log("Setting up Firefox Desktop proxy")
var proxySettings = {
proxyType: "manual",
http: Host+":"+Port,
passthrough: "",
httpProxyAll: true
};
browser.proxy.settings.set({value:proxySettings});
console.log("i2p settings created for Firefox Desktop")
}
}

View File

@@ -24,28 +24,36 @@ chrome.privacy.network.webRTCIPHandlingPolicy.set({value: "disable_non_proxied_u
console.log("Preliminarily disabled WebRTC.")
function shouldProxyRequest(requestInfo) {
return true; //requestInfo.parentFrameId != -1;
}
function setupProxy() {
var controlHost = "127.0.0.1" //getControlHost()
var controlPort = "7951" //getControlPort();
var Host = getHost()
var Port = getPort()
console.log("Setting up Firefox Desktop proxy")
var proxySettings = {
proxyType: "manual",
http: Host+":"+Port,
passthrough: "",
httpProxyAll: true
};
browser.proxy.settings.set({value:proxySettings});
console.log("i2p settings created for Firefox Desktop")
var Host = "127.0.0.1" //getHost()
var Port = "4444" //getPort()
if (isDroid()) {
console.log("Setting up Firefox Android proxy")
if (Port == "7950") {
browser.proxy.register("android-ext.pac");
}else{
browser.proxy.register("android.pac");
function handleProxyRequest(requestInfo) {
if (shouldProxyRequest(requestInfo)) {
console.log(`Proxying: ${requestInfo.url}`);
return {type: "http", host: Host, port: Port};
}
return {type: "http", host: Host, port: Port};
}
browser.proxy.onRequest.addListener(handleProxyRequest, {urls: ["<all_urls>"]});
console.log("i2p settings created for Firefox Android")
}else{
console.log("Setting up Firefox Desktop proxy")
var proxySettings = {
proxyType: "manual",
http: Host+":"+Port,
passthrough: "",
httpProxyAll: true
};
browser.proxy.settings.set({value:proxySettings});
console.log("i2p settings created for Firefox Desktop")
}
}
@@ -55,6 +63,5 @@ if (isFirefox()){
}
if (isFirefox()) {
setAllPrivacy()
setupProxy()
}