1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 12:50:36 +01:00

Typos and linting

This commit is contained in:
kkapsner 2018-08-22 22:16:49 +02:00
parent f873bd84e5
commit 4a043b2c78
16 changed files with 101 additions and 75 deletions

View File

@ -2,7 +2,7 @@ Dieses Add-on ermöglicht es Nutzern, Webseiten davon abzuhalten, sie über die
Die verschiedenen Blockiermodi sind: Die verschiedenen Blockiermodi sind:
<ul> <ul>
<li>Auslese-API blockieren: Alle Webseiten, die nicht auf der Whitelist oder Blacklist gelistet sind, können die canvas-API zur Darstellung verwenden, aber die Auslese-API darf nicht verwendet werden. Dies kann das korrekte Funktionieren von Webseiten wie z.B. Google Maps verhinden.</li> <li>Auslese-API blockieren: Alle Webseiten, die nicht auf der Whitelist oder Blacklist gelistet sind, können die canvas-API zur Darstellung verwenden, aber die Auslese-API darf nicht verwendet werden. Dies kann das korrekte Funktionieren von Webseiten wie z.B. Google Maps verhindern.</li>
<li>Auslese-API vortäuschen: Standardeinstellung und mein Favorit! Alle Webseiten, die nicht auf der Whitelist oder Blacklist gelistet sind, können die canvas-API zur Darstellung verwenden, aber die Auslese-API gibt zufällige Werte zurück, sodass das Fingerprinting immer einen anderen Wert liefert.</li> <li>Auslese-API vortäuschen: Standardeinstellung und mein Favorit! Alle Webseiten, die nicht auf der Whitelist oder Blacklist gelistet sind, können die canvas-API zur Darstellung verwenden, aber die Auslese-API gibt zufällige Werte zurück, sodass das Fingerprinting immer einen anderen Wert liefert.</li>
<li>Bei Ausgabe vortäuschen: Bei der Darstellung von Text werden die beschriebenen Pixel leicht verändert. Dies erschwert die Detektion des Add-ons, aber ist weniger sicher. Bei WebGL-Canvas ist das Verhalten identisch zu "Auslese-API vortäuschen".</li> <li>Bei Ausgabe vortäuschen: Bei der Darstellung von Text werden die beschriebenen Pixel leicht verändert. Dies erschwert die Detektion des Add-ons, aber ist weniger sicher. Bei WebGL-Canvas ist das Verhalten identisch zu "Auslese-API vortäuschen".</li>
<li>bei Auslese-API um Erlaubnis fragen: Alle Webseiten, die nicht auf der Whitelist oder Blacklist gelistet sind, können die canvas-API zur Darstellung verwenden, aber der Nutzer wird jedes Mal um Erlaubnis gefragt, wenn die Webseite die Readout-API verwenden möchte.</li> <li>bei Auslese-API um Erlaubnis fragen: Alle Webseiten, die nicht auf der Whitelist oder Blacklist gelistet sind, können die canvas-API zur Darstellung verwenden, aber der Nutzer wird jedes Mal um Erlaubnis gefragt, wenn die Webseite die Readout-API verwenden möchte.</li>

25
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,25 @@
{
"cSpell.words": [
"Blockiermodi",
"Blockiermodus",
"Ignorierliste",
"Maleficient",
"Nachfrageverweigerungsmodus",
"Oakenpants",
"PDFs",
"Spoofer",
"Thorin",
"Vortäuschaktion",
"Vortäuschgröße",
"Vortäuschrate",
"Waterfox",
"collapser",
"fakeable",
"fragmenter",
"ignorelist",
"onloaded",
"prefs",
"webgl"
],
"cSpell.language": "en,de"
}

View File

@ -309,7 +309,7 @@
}, },
"rng_description": { "rng_description": {
"message": "nichts (komplett weiß): es wird immer ein weißes Bild zurückgegeben. Hierbei sollte die Option \"Alpha-Kanal auch vortäuchen\" aktiviert werden. ACHTUNG: Nicht im Modus \"Bei Ausgabe vortäuschen\" verwenden.\nnicht persistent: die Zufallszahlen werden bei jeder Vortäuschaktion neu bestimmt.\nkonstant: innerhalb einer Webseite wird eine Farbe immer gleich verändert.\npersistent: für jede Domain werden die Zufallszahlen nur einmal bestimmt.", "message": "nichts (komplett weiß): es wird immer ein weißes Bild zurückgegeben. Hierbei sollte die Option \"Alpha-Kanal auch vortäuschen\" aktiviert werden. ACHTUNG: Nicht im Modus \"Bei Ausgabe vortäuschen\" verwenden.\nnicht persistent: die Zufallszahlen werden bei jeder Vortäuschaktion neu bestimmt.\nkonstant: innerhalb einer Webseite wird eine Farbe immer gleich verändert.\npersistent: für jede Domain werden die Zufallszahlen nur einmal bestimmt.",
"description": "" "description": ""
}, },
"rng_options.persistent": { "rng_options.persistent": {
@ -680,79 +680,79 @@
"description": "" "description": ""
}, },
"protectaudio_title": { "protectAudio_title": {
"message": "Audio-API beschützen", "message": "Audio-API beschützen",
"description": "" "description": ""
}, },
"protectaudio_description": { "protectAudio_description": {
"message": "Ob die Audio-API auch beschützt werden soll.", "message": "Ob die Audio-API auch beschützt werden soll.",
"description": "" "description": ""
}, },
"audiofakerate_title": { "audioFakeRate_title": {
"message": "Buffer Vortäuschrate", "message": "Buffer Vortäuschrate",
"description": "" "description": ""
}, },
"audiofakerate_description": { "audioFakeRate_description": {
"message": "Wie viele Werte pro Leseanfrage vorgetäuscht werden sollen.", "message": "Wie viele Werte pro Leseanfrage vorgetäuscht werden sollen.",
"description": "" "description": ""
}, },
"audiofakerate_options.1": { "audioFakeRate_options.1": {
"message": "1 Wert", "message": "1 Wert",
"description": "" "description": ""
}, },
"audiofakerate_options.10": { "audioFakeRate_options.10": {
"message": "10 Werte", "message": "10 Werte",
"description": "" "description": ""
}, },
"audiofakerate_options.100": { "audioFakeRate_options.100": {
"message": "100 Werte", "message": "100 Werte",
"description": "" "description": ""
}, },
"audiofakerate_options.1000": { "audioFakeRate_options.1000": {
"message": "1000 Werte", "message": "1000 Werte",
"description": "" "description": ""
}, },
"audiofakerate_options.0.1%": { "audioFakeRate_options.0.1%": {
"message": "0.1% der Werte", "message": "0.1% der Werte",
"description": "" "description": ""
}, },
"audiofakerate_options.1%": { "audioFakeRate_options.1%": {
"message": "1% der Werte", "message": "1% der Werte",
"description": "" "description": ""
}, },
"audiofakerate_options.10%": { "audioFakeRate_options.10%": {
"message": "10% der Werte", "message": "10% der Werte",
"description": "" "description": ""
}, },
"audiofakerate_options.100%": { "audioFakeRate_options.100%": {
"message": "100% der Werte", "message": "100% der Werte",
"description": "" "description": ""
}, },
"audionoiselevel_title": { "audioNoiseLevel_title": {
"message": "Rauschlevel", "message": "Rauschlevel",
"description": "" "description": ""
}, },
"audionoiselevel_description": { "audioNoiseLevel_description": {
"message": "", "message": "",
"description": "" "description": ""
}, },
"audionoiselevel_options.minimal": { "audioNoiseLevel_options.minimal": {
"message": "minimal", "message": "minimal",
"description": "" "description": ""
}, },
"audionoiselevel_options.low": { "audioNoiseLevel_options.low": {
"message": "niedrig", "message": "niedrig",
"description": "" "description": ""
}, },
"audionoiselevel_options.medium": { "audioNoiseLevel_options.medium": {
"message": "mittel", "message": "mittel",
"description": "" "description": ""
}, },
"audionoiselevel_options.high": { "audioNoiseLevel_options.high": {
"message": "hoch", "message": "hoch",
"description": "" "description": ""
}, },
"audionoiselevel_options.maximal": { "audioNoiseLevel_options.maximal": {
"message": "maximal", "message": "maximal",
"description": "" "description": ""
}, },
@ -764,19 +764,19 @@
"message": "Aktiviert den Audio-Zwischenspeicher. Dies kann die Detektion des Addons verhindern aber reduziert die Geschwindigkeit des Addons.", "message": "Aktiviert den Audio-Zwischenspeicher. Dies kann die Detektion des Addons verhindern aber reduziert die Geschwindigkeit des Addons.",
"description": "" "description": ""
}, },
"audiousefixedindices_title": { "audioUseFixedIndices_title": {
"message": "Feste Indizes verwenden", "message": "Feste Indizes verwenden",
"description": "" "description": ""
}, },
"audiousefixedindices_description": { "audioUseFixedIndices_description": {
"message": "Ob einige der Indizes immer vorgetäuscht werden sollen.", "message": "Ob einige der Indizes immer vorgetäuscht werden sollen.",
"description": "" "description": ""
}, },
"audiofixedindices_title": { "audioFixedIndices_title": {
"message": "Feste Indizes", "message": "Feste Indizes",
"description": "" "description": ""
}, },
"audiofixedindices_description": { "audioFixedIndices_description": {
"message": "Die Indizes, die immer vorgetäuscht werden sollen. Kommasepariert eingeben.", "message": "Die Indizes, die immer vorgetäuscht werden sollen. Kommasepariert eingeben.",
"description": "" "description": ""
}, },

View File

@ -169,7 +169,7 @@
"description": "" "description": ""
}, },
"askOnlyOnce_description": { "askOnlyOnce_description": {
"message": "When Canvas Blocker's Block mode is set to 'ask permission' or 'ask permission for readout API', a confirm message will appear every time a page tries to access the API or readout API. This setting tries to display the confirm message only once for each page regardless of how many times the page tries to access the API. Nevertheless, multiple confirm messages may still be displayed on some pages.\nNo: asking every time\nIndividual: each API-type (context, input, readout) has to be confirmed seperately\ncombined: all API-types get confirmed together", "message": "When Canvas Blocker's Block mode is set to 'ask permission' or 'ask permission for readout API', a confirm message will appear every time a page tries to access the API or readout API. This setting tries to display the confirm message only once for each page regardless of how many times the page tries to access the API. Nevertheless, multiple confirm messages may still be displayed on some pages.\nNo: asking every time\nIndividual: each API-type (context, input, readout) has to be confirmed separately\ncombined: all API-types get confirmed together",
"description": "" "description": ""
}, },
"askOnlyOnce_options.no": { "askOnlyOnce_options.no": {
@ -680,103 +680,103 @@
"description": "" "description": ""
}, },
"protectaudio_title": { "protectAudio_title": {
"message": "Protect audio API", "message": "Protect audio API",
"description": "" "description": ""
}, },
"protectaudio_description": { "protectAudio_description": {
"message": "If the audio API should be protected as well", "message": "If the audio API should be protected as well",
"description": "" "description": ""
}, },
"audiofakerate_title": { "audioFakeRate_title": {
"message": "Buffer fake rate", "message": "Buffer fake rate",
"description": "" "description": ""
}, },
"audiofakerate_description": { "audioFakeRate_description": {
"message": "How many of the values per read request should be faked.", "message": "How many of the values per read request should be faked.",
"description": "" "description": ""
}, },
"audiofakerate_options.1": { "audioFakeRate_options.1": {
"message": "1 value", "message": "1 value",
"description": "" "description": ""
}, },
"audiofakerate_options.10": { "audioFakeRate_options.10": {
"message": "10 values", "message": "10 values",
"description": "" "description": ""
}, },
"audiofakerate_options.100": { "audioFakeRate_options.100": {
"message": "100 values", "message": "100 values",
"description": "" "description": ""
}, },
"audiofakerate_options.1000": { "audioFakeRate_options.1000": {
"message": "1000 values", "message": "1000 values",
"description": "" "description": ""
}, },
"audiofakerate_options.0.1%": { "audioFakeRate_options.0.1%": {
"message": "0.1% of the values", "message": "0.1% of the values",
"description": "" "description": ""
}, },
"audiofakerate_options.1%": { "audioFakeRate_options.1%": {
"message": "1% of the values", "message": "1% of the values",
"description": "" "description": ""
}, },
"audiofakerate_options.10%": { "audioFakeRate_options.10%": {
"message": "10% of the values", "message": "10% of the values",
"description": "" "description": ""
}, },
"audiofakerate_options.100%": { "audioFakeRate_options.100%": {
"message": "100% of the values", "message": "100% of the values",
"description": "" "description": ""
}, },
"audionoiselevel_title": { "audioNoiseLevel_title": {
"message": "Noise level", "message": "Noise level",
"description": "" "description": ""
}, },
"audionoiselevel_description": { "audioNoiseLevel_description": {
"message": "", "message": "",
"description": "" "description": ""
}, },
"audionoiselevel_options.minimal": { "audioNoiseLevel_options.minimal": {
"message": "minimal", "message": "minimal",
"description": "" "description": ""
}, },
"audionoiselevel_options.low": { "audioNoiseLevel_options.low": {
"message": "low", "message": "low",
"description": "" "description": ""
}, },
"audionoiselevel_options.medium": { "audioNoiseLevel_options.medium": {
"message": "medium", "message": "medium",
"description": "" "description": ""
}, },
"audionoiselevel_options.high": { "audioNoiseLevel_options.high": {
"message": "high", "message": "high",
"description": "" "description": ""
}, },
"audionoiselevel_options.maximal": { "audioNoiseLevel_options.maximal": {
"message": "maximal", "message": "maximal",
"description": "" "description": ""
}, },
"useaudiocache_title": { "useAudioCache_title": {
"message": "Use audio cache", "message": "Use audio cache",
"description": "" "description": ""
}, },
"useaudiocache_description": { "useAudioCache_description": {
"message": "Enables the audio cache. This can prevent detection but decreases the performance.", "message": "Enables the audio cache. This can prevent detection but decreases the performance.",
"description": "" "description": ""
}, },
"audiousefixedindices_title": { "audioUseFixedIndices_title": {
"message": "Use fixed indices", "message": "Use fixed indices",
"description": "" "description": ""
}, },
"audiousefixedindices_description": { "audioUseFixedIndices_description": {
"message": "If some of the used indices should be always faked.", "message": "If some of the used indices should be always faked.",
"description": "" "description": ""
}, },
"audiofixedindices_title": { "audioFixedIndices_title": {
"message": "Fixed indices", "message": "Fixed indices",
"description": "" "description": ""
}, },
"audiofixedindices_description": { "audioFixedIndices_description": {
"message": "The indices that are always faked. Enter separated by comma.", "message": "The indices that are always faked. Enter separated by comma.",
"description": "" "description": ""
}, },

View File

@ -50,7 +50,7 @@
setHeader(headers, { setHeader(headers, {
name: "Content-Security-Policy", name: "Content-Security-Policy",
value: `object-src ${cspMatch}; frame-src ${cspMatch}` value: `object-src ${cspMatch}; frame-src ${cspMatch}`
// + "; report-to https://canvasblocker.invalid/; report-uri https://canvasblocker.invalid/" // + "; report-to https://canvasblocker.invalid/; report-uri https://canvasblocker.invalid/"
}); });
} }
return { return {

View File

@ -108,7 +108,7 @@
"contentWindow", "contentWindow",
{ {
enumerable: true, enumerable: true,
configureable: true, configurable: true,
get: exportFunction(function(){ get: exportFunction(function(){
var window = oldContentWindowGetter.call(this); var window = oldContentWindowGetter.call(this);
if (window){ if (window){
@ -124,7 +124,7 @@
"contentDocument", "contentDocument",
{ {
enumerable: true, enumerable: true,
configureable: true, configurable: true,
get: exportFunction(function(){ get: exportFunction(function(){
var document = oldContentDocumentGetter.call(this); var document = oldContentDocumentGetter.call(this);
if (document){ if (document){

View File

@ -66,7 +66,7 @@
scope.intercept({subject: window}, apis); scope.intercept({subject: window}, apis);
} }
else { else {
logging.message("settings not loaded -> need to pre intercep"); logging.message("settings not loaded -> need to pre intercept");
let forceLoad = true; let forceLoad = true;
let preIntercepted = false; let preIntercepted = false;
let intercepted = false; let intercepted = false;
@ -97,7 +97,7 @@
name, name,
{ {
enumerable: true, enumerable: true,
configureable: true, configurable: true,
get: exportFunction(function(){ get: exportFunction(function(){
if (forceLoad){ if (forceLoad){
logging.warning("force load the settings. Calling stack:", (new Error()).stack); logging.warning("force load the settings. Calling stack:", (new Error()).stack);

View File

@ -86,7 +86,7 @@
"fillText", "strokeText", "fillText", "strokeText",
{name: "webGL", level: 2}, {name: "webGL", level: 2},
"readPixels", "readPixels",
{name: "Audio-API", leve: 1}, {name: "Audio-API", level: 1},
"getFloatFrequencyData", "getByteFrequencyData", "getFloatTimeDomainData", "getByteTimeDomainData", "getFloatFrequencyData", "getByteFrequencyData", "getFloatTimeDomainData", "getByteTimeDomainData",
"getChannelData", "copyFromChannel", "getChannelData", "copyFromChannel",
"getFrequencyResponse" "getFrequencyResponse"

View File

@ -376,7 +376,7 @@
return foundDefinition.set(...args); return foundDefinition.set(...args);
} }
else { else {
logging.error("Try to set unkown setting:", name); logging.error("Try to set unknown setting:", name);
} }
}; };
scope.get = function(name, ...args){ scope.get = function(name, ...args){
@ -385,7 +385,7 @@
return foundDefinition.get(...args); return foundDefinition.get(...args);
} }
else { else {
logging.error("Try to get unkown setting:", name); logging.error("Try to get unknown setting:", name);
} }
}; };

View File

@ -1,6 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint max-lines: off*/
(function(){ (function(){
"use strict"; "use strict";
var settingsDisplay = [ var settingsDisplay = [

View File

@ -49,7 +49,7 @@
DomainNotification.prototype.node = function node(){ DomainNotification.prototype.node = function node(){
const node = document.createElement("li"); const node = document.createElement("li");
node.className = "domainPrints collapsable collapsed"; node.className = "domainPrints collapsible collapsed";
node.appendChild(this.textNode()); node.appendChild(this.textNode());
node.appendChild(document.createElement("br")); node.appendChild(document.createElement("br"));
createCollapser(node); createCollapser(node);

View File

@ -30,7 +30,7 @@
collapser.addEventListener("click", function(){ collapser.addEventListener("click", function(){
container.classList.toggle("collapsed"); container.classList.toggle("collapsed");
}); });
container.classList.add("collapsable"); container.classList.add("collapsible");
container.classList.add("collapsed"); container.classList.add("collapsed");
}; };
}(); }();

View File

@ -25,7 +25,7 @@
node.appendChild(document.createTextNode(this.timestamp.toLocaleString() + ": ")); node.appendChild(document.createTextNode(this.timestamp.toLocaleString() + ": "));
node.appendChild(this.textNode()); node.appendChild(this.textNode());
if (this.dataURL){ if (this.dataURL){
node.className = "notification collapsable collapsed"; node.className = "notification collapsible collapsed";
node.appendChild(document.createElement("br")); node.appendChild(document.createElement("br"));
createCollapser(node); createCollapser(node);
const img = document.createElement("img"); const img = document.createElement("img");

View File

@ -84,40 +84,40 @@ button.action img {
padding: 0 0 20px 1em; padding: 0 0 20px 1em;
} }
.collapsable { .collapsible {
position: relative; position: relative;
margin: 0; margin: 0;
} }
.collapsable.collapsed .collapser { .collapsible.collapsed .collapser {
display: inline-block; display: inline-block;
width: 20px; width: 20px;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
box-sizing: border-box; box-sizing: border-box;
} }
.collapsable .collapser { .collapsible .collapser {
cursor: pointer; cursor: pointer;
color: blue; color: blue;
text-decoration: underline; text-decoration: underline;
} }
.collapsable .collapser .more { .collapsible .collapser .more {
display: none; display: none;
} }
.collapsable.collapsed .collapser .more { .collapsible.collapsed .collapser .more {
display: inline; display: inline;
} }
.collapsable.collapsed .collapser .less { .collapsible.collapsed .collapser .less {
display: none; display: none;
} }
.collapsable .collapser .less { .collapsible .collapser .less {
display: inline; display: inline;
} }
.collapsable.collapsed .collapsing { .collapsible.collapsed .collapsing {
height: 0px; height: 0px;
overflow: hidden; overflow: hidden;
padding: 0; padding: 0;
} }
.collapsable .collapsing { .collapsible .collapsing {
height: initial; height: initial;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;

View File

@ -280,7 +280,7 @@ Version 0.4.0:
fixes: fixes:
- ask mode did not work for input types - ask mode did not work for input types
- allow page scripts to overwrite the faked funtions - allow page scripts to overwrite the faked functions
- getImageData also faked when using fakeInput mode - getImageData also faked when using fakeInput mode
Version 0.3.8: Version 0.3.8:

View File

@ -39,11 +39,11 @@
// Start audio processing // Start audio processing
pxi_oscillator.start(0); pxi_oscillator.start(0);
context.startRendering(); context.startRendering();
context.oncomplete = function(evnt) { context.oncomplete = function(event) {
var str = ""; var str = "";
var copyTest = new Float32Array(44100); var copyTest = new Float32Array(44100);
evnt.renderedBuffer.copyFromChannel(copyTest, 0); event.renderedBuffer.copyFromChannel(copyTest, 0);
var getTest = evnt.renderedBuffer.getChannelData(0); var getTest = event.renderedBuffer.getChannelData(0);
Promise.all([ Promise.all([
crypto.subtle.digest("SHA-256", getTest), crypto.subtle.digest("SHA-256", getTest),
crypto.subtle.digest("SHA-256", copyTest), crypto.subtle.digest("SHA-256", copyTest),