diff --git a/_locales/en/messages.json b/_locales/en/messages.json index aede559..53f7d30 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -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": { diff --git a/info.js b/info.js index 551d082..efc24a0 100644 --- a/info.js +++ b/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) { diff --git a/manifest.json b/manifest.json index 9bd5a77..84e79f2 100644 --- a/manifest.json +++ b/manifest.json @@ -9,6 +9,7 @@ "theme", "browsingData", "bookmarks", + "management", "notifications", "proxy", "privacy", diff --git a/privacy.js b/privacy.js index 29d0d59..2f57657 100644 --- a/privacy.js +++ b/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() {