Merge pull request #65 from eyedeekay/snowflake
make it leave WebRTC alone by default if it detects that the user als…
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
"description": "WebRTC checkbox label."
|
||||
},
|
||||
"rtcDesc": {
|
||||
"message": "WebRTC is disabled by default, but you can turn it back on and force it to honor the proxy.",
|
||||
"message": "WebRTC is disabled by default, but you can turn it back on and force it to honor the proxy. If you are a user of the Snowflake browser extension, this option is disabled and WebRTC is turned on by default.",
|
||||
"description": "WebRTC action description"
|
||||
},
|
||||
"disableHistory": {
|
||||
|
9
info.js
9
info.js
@@ -1,4 +1,12 @@
|
||||
function checkPeerConnection() {
|
||||
function snowflake(snowflake) {
|
||||
console.log("snowflake plugin found, leaving WebRTC alone", snowflake);
|
||||
EnablePeerConnection();
|
||||
}
|
||||
var snowflakeInfo = browser.management.get(
|
||||
"{b11bea1f-a888-4332-8d8a-cec2be7d24b9}" // string
|
||||
);
|
||||
snowflakeInfo.then(snowflake);
|
||||
let getting = browser.privacy.network.peerConnectionEnabled.get({});
|
||||
getting.then(got => {
|
||||
let webrtc = got.value;
|
||||
@@ -79,6 +87,7 @@ document.addEventListener("click", clickEvent => {
|
||||
} else {
|
||||
browser.runtime.sendMessage({ rtc: "disableWebRTC" });
|
||||
}
|
||||
checkPeerConnection();
|
||||
return;
|
||||
} else if (clickEvent.target.id === "disable-history") {
|
||||
if (clickEvent.target.checked) {
|
||||
|
@@ -9,6 +9,7 @@
|
||||
"theme",
|
||||
"browsingData",
|
||||
"bookmarks",
|
||||
"management",
|
||||
"notifications",
|
||||
"proxy",
|
||||
"privacy",
|
||||
|
34
privacy.js
34
privacy.js
@@ -130,29 +130,31 @@ function setAllPrivacy() {
|
||||
setAllPrivacy();
|
||||
|
||||
function ResetPeerConnection() {
|
||||
var webrtc = false;
|
||||
var rtc = browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: webrtc
|
||||
});
|
||||
rtc.then(AssurePeerConnection);
|
||||
function reset(snowflake) {
|
||||
var webrtc = false;
|
||||
console.log("No snowflake plugin found, pre-disabled WebRTC");
|
||||
var rtc = browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: webrtc
|
||||
});
|
||||
rtc.then(AssurePeerConnection);
|
||||
}
|
||||
function snowflake(snowflake) {
|
||||
console.log("snowflake plugin found, leaving WebRTC alone", snowflake);
|
||||
EnablePeerConnection();
|
||||
}
|
||||
var snowflakeInfo = browser.management.get(
|
||||
"{b11bea1f-a888-4332-8d8a-cec2be7d24b9}" // string
|
||||
);
|
||||
snowflakeInfo.then(snowflake, reset);
|
||||
}
|
||||
|
||||
function EnablePeerConnection() {
|
||||
var webrtc = false;
|
||||
var webrtc = true;
|
||||
var rtc = browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: webrtc
|
||||
});
|
||||
rtc.then(SetupPeerConnection);
|
||||
console.log("Enabled WebRTC");
|
||||
}
|
||||
|
||||
function SetupPeerConnection() {
|
||||
var webrtc = true;
|
||||
console.log("Pre-disabled WebRTC");
|
||||
let rtc = browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: webrtc
|
||||
});
|
||||
rtc.then(AssurePeerConnection);
|
||||
console.log("Enabled WebRTC");
|
||||
}
|
||||
|
||||
function AssurePeerConnection() {
|
||||
|
Reference in New Issue
Block a user