Hey it works with chrome too, mostly

This commit is contained in:
idk
2019-03-15 21:45:59 -04:00
parent cd2e3d0eec
commit 60b87aa20a
5 changed files with 40 additions and 45 deletions

View File

@@ -9,10 +9,11 @@ function isFirefox() {
}
return false
}
browser.privacy.network.peerConnectionEnabled.set({value: false});
browser.privacy.network.networkPredictionEnabled.set({value: false});
browser.privacy.network.webRTCIPHandlingPolicy.set({value: "disable_non_proxied_udp"});
if (isFirefox()) {
browser.privacy.network.peerConnectionEnabled.set({value: false});
}
chrome.privacy.network.networkPredictionEnabled.set({value: false});
chrome.privacy.network.webRTCIPHandlingPolicy.set({value: "disable_non_proxied_udp"});
console.log("Preliminarily disabled WebRTC.")
@@ -30,7 +31,7 @@ function setupProxy() {
passthrough: "",
httpProxyAll: true
};
browser.proxy.settings.set({value:proxySettings});
chrome.proxy.settings.set({value:proxySettings});
console.log("i2p settings created for Firefox")
}
}else{
@@ -66,15 +67,8 @@ function setupProxy() {
}
}
function RefreshIdentity(){
console.log("Generating new identity")
const Http = new XMLHttpRequest();
const url='http://' + controlHost + ":" + controlPort
Http.open("GET", url);
Http.send();
Http.onreadystatechange=(e)=>{
console.log(Http.responseText)
}
}
browser.browserAction.onClicked.addListener(RefreshIdentity);
if (isFirefox()){
// Theme all currently open windows
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
}