1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-06-01 19:08:06 +02:00

Added notice when dom.webAudio.enabled is set to false

Fixes #592
This commit is contained in:
kkapsner 2022-01-30 17:50:59 +01:00
parent d4fc7027eb
commit 3d603b84d4
4 changed files with 38 additions and 23 deletions

View File

@ -100,6 +100,10 @@
"message": "You have privacy.resistFingerprinting enabled. This slightly changes the behaviour of CanvasBlocker. See further information {link:here:https://github.com/kkapsner/CanvasBlocker/issues/158} and {link:here:https://github.com/ghacksuserjs/ghacks-user.js/issues/767}.", "message": "You have privacy.resistFingerprinting enabled. This slightly changes the behaviour of CanvasBlocker. See further information {link:here:https://github.com/kkapsner/CanvasBlocker/issues/158} and {link:here:https://github.com/ghacksuserjs/ghacks-user.js/issues/767}.",
"description": "" "description": ""
}, },
"settingsNotice.dom.webAudio.enabled": {
"message": "You have dom.webAudio.enabled disabled. This makes you more trackable as very few people do this.",
"description": ""
},
"openInTab": { "openInTab": {
"message": "Open in separate tab", "message": "Open in separate tab",
"description": "" "description": ""

View File

@ -37,7 +37,7 @@ header .bookmarkNotice .dontShowOptionsOnUpdate input {
vertical-align: sub; vertical-align: sub;
} }
.resistFingerprintingNotice { .resistFingerprintingNotice, .settingsNotice {
margin: 0.5em 0; margin: 0.5em 0;
padding: 0.5em; padding: 0.5em;
border: 1px solid var(--input-error-background-color); border: 1px solid var(--input-error-background-color);

View File

@ -234,28 +234,38 @@
groupTabs.classList = "groupTabs"; groupTabs.classList = "groupTabs";
document.body.appendChild(groupTabs); document.body.appendChild(groupTabs);
[
{
check: async function(){
if ( if (
browser.privacy && browser.privacy &&
browser.privacy.websites && browser.privacy.websites &&
browser.privacy.websites.resistFingerprinting && browser.privacy.websites.resistFingerprinting &&
browser.privacy.websites.resistFingerprinting.get browser.privacy.websites.resistFingerprinting.get
){ ){
browser.privacy.websites.resistFingerprinting.get({}).then(function({value}){ return (await browser.privacy.websites.resistFingerprinting.get({})).value;
if (value){ }
const rfpNotice = document.createElement("div"); return false;
rfpNotice.className = "resistFingerprintingNotice"; },
rfpNotice.appendChild( className: "resistFingerprintingNotice",
text: "resistFingerprintingNotice"
},
{
check: () => !window.AudioContext,
text: "settingsNotice.dom.webAudio.enabled"
},
].forEach(async function(settingsCheck){
if (await settingsCheck.check()){
const settingsNotice = document.createElement("div");
settingsNotice.className = settingsCheck.className || "settingsNotice";
settingsNotice.appendChild(
extension.parseTranslation( extension.parseTranslation(
extension.getTranslation("resistFingerprintingNotice") extension.getTranslation(settingsCheck.text)
) )
); );
document.body.insertBefore(rfpNotice, groupTabs); document.body.insertBefore(settingsNotice, groupTabs);
} }
return undefined;
}).catch(function(error){
logging.warning("Unable to read resistFingerprinting:", error);
}); });
}
const groups = document.createElement("ul"); const groups = document.createElement("ul");
groups.className = "groups"; groups.className = "groups";

View File

@ -4,6 +4,7 @@ Version 1.8:
new features: new features:
- added SVG protection - added SVG protection
- added notice when dom.webAudio.enabled is set to false
fixes: fixes:
- errors in URL regular expressions broke CB - errors in URL regular expressions broke CB