From 33b30e158f09dc08040edd7d59c7aaaca4221ce7 Mon Sep 17 00:00:00 2001 From: kkapsner Date: Tue, 30 Apr 2019 23:37:41 +0200 Subject: [PATCH 1/3] Fixed typo Thanks to joaonsg --- .documentation/addon description/en/description.txt | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.documentation/addon description/en/description.txt b/.documentation/addon description/en/description.txt index ae0e5ad..b72220b 100644 --- a/.documentation/addon description/en/description.txt +++ b/.documentation/addon description/en/description.txt @@ -1,4 +1,4 @@ -This add-on allows users to prevent websites from using the some Javascript APIs to fingerprint them. Users can choose to block the APIs entirely on some or all websites (which may break some websites) or fake its fingerprinting-friendly readout API. +This add-on allows users to prevent websites from using some Javascript APIs to fingerprint them. Users can choose to block the APIs entirely on some or all websites (which may break some websites) or fake its fingerprinting-friendly readout API. IMPORTANT: you should only have ONE addon/setting set that protects an API. Otherwise you could face massive performance issues. (E.g. EclipsedMoon for Palemoon has 'canvas.poison' which is known to cause issues: https://github.com/kkapsner/CanvasBlocker/issues/253#issuecomment-459499290) But setting privacy.resistFingerprinting to true is fine. diff --git a/README.md b/README.md index 4d8e4f3..15e6876 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -This add-on allows users to prevent websites from using the some Javascript APIs to fingerprint them. Users can choose to block the APIs entirely on some or all websites (which may break some websites) or just block or fake its fingerprinting-friendly readout API. +This add-on allows users to prevent websites from using some Javascript APIs to fingerprint them. Users can choose to block the APIs entirely on some or all websites (which may break some websites) or just block or fake its fingerprinting-friendly readout API. **IMPORTANT**: you should only have ONE addon/setting set that protects an API. Otherwise you could face massive performance issues. (E.g. EclipsedMoon for Palemoon has 'canvas.poison' which is known to cause issues: https://github.com/kkapsner/CanvasBlocker/issues/253#issuecomment-459499290) But setting privacy.resistFingerprinting to true is fine. From 403885f42619f5aa2bbb6ed28a62f293571fc1b6 Mon Sep 17 00:00:00 2001 From: kkapsner Date: Tue, 30 Apr 2019 23:39:40 +0200 Subject: [PATCH 2/3] Don't break if browser API is not available --- lib/extension.js | 16 +++++++++++----- manifest.json | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/extension.js b/lib/extension.js index 4dbd06d..93b3108 100644 --- a/lib/extension.js +++ b/lib/extension.js @@ -20,20 +20,26 @@ browser.extension.getBackgroundPage() === window ); - scope.getTranslation = function getTranslation(id){ + scope.getTranslation = browserAvailable? function getTranslation(id){ return browser.i18n.getMessage(id); + }: function(id){ + return id; }; - scope.extensionID = browser.extension.getURL(""); + scope.extensionID = browserAvailable? browser.extension.getURL(""): "extensionID"; - scope.inIncognitoContext = browser.extension.inIncognitoContext; + scope.inIncognitoContext = browserAvailable? browser.extension.inIncognitoContext: false; scope.message = { - on: function(callback){ + on: browserAvailable? function(callback){ return browser.runtime.onMessage.addListener(callback); + }: function(){ + return false; }, - send: function(data){ + send: browserAvailable? function(data){ return browser.runtime.sendMessage(data); + }: function(){ + return false; } }; Object.seal(scope.message); diff --git a/manifest.json b/manifest.json index 9f127f2..9106968 100644 --- a/manifest.json +++ b/manifest.json @@ -10,6 +10,7 @@ "background": { "scripts": [ "lib/require.js", + "lib/extension.js", "lib/logging.js", "lib/settingDefinitions.js", "lib/settingContainers.js", From cd8c7bd71c335d3ff88d3af4ddb005046ba9d76b Mon Sep 17 00:00:00 2001 From: kkapsner Date: Tue, 30 Apr 2019 23:40:30 +0200 Subject: [PATCH 3/3] Removed last residue of browser.runtime.sendMessage --- options/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/options.js b/options/options.js index ecc3aeb..e66c4e6 100644 --- a/options/options.js +++ b/options/options.js @@ -30,7 +30,7 @@ logging.notice("empty storage"); settings.persistentRndStorage = ""; logging.notice("send message to main script"); - browser.runtime.sendMessage({"canvasBlocker-clear-domain-rnd": true}); + extension.message.send({"canvasBlocker-clear-domain-rnd": true}); }, inspectSettings: function(){ logging.verbose("open settings inspection");