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

added "share persistent randomness between domains"

Fixes #290
This commit is contained in:
kkapsner 2018-10-25 13:42:18 +02:00
parent 9dcb1f8903
commit 947d9e0c59
9 changed files with 131 additions and 6 deletions

View File

@ -455,6 +455,18 @@
"message": "Leeren",
"description": ""
},
"sharePersistentRndBetweenDomains_title": {
"message": "Persistente Zufallszahlen zwischen Domains teilen",
"description": ""
},
"sharePersistentRndBetweenDomains_description": {
"message": "ACHTUNG: diese Einstellung macht den Browser 100% eindeutig identifizierbar und ist damit eine Gefährdung Ihrer Privatsphäre.",
"description": ""
},
"sharePersistentRndBetweenDomains_confirmMessage": {
"message": "Sind Sie sicher, dass sie die persistenten Zufallszahlen zwischen Domains teilen wollen?\nACHTUNG: dies macht den Browser 100% eindeutig identifizierbar und ist damit eine Gefährdung Ihrer Privatsphäre.",
"description": ""
},
"ignoreFrequentColors_title": {
"message": "Ignoriere die häufigsten Farben",
"description": ""
@ -1107,6 +1119,10 @@
"message": "Leistung",
"description": ""
},
"sanitation_ruleset.privacy": {
"message": "Privatsphäre",
"description": ""
},
"sanitation_error.unnecessaryURLValue": {
"message": "Der URL-Wert für \"{url}\" ist identisch zur globalen Einstellung für \"{setting-title}\".",
"description": ""
@ -1182,5 +1198,9 @@
"sanitation_error.storeImage": {
"message": "Bilder für Betrachtung zu speichern führt zu einem hohen RAM-Verbrauch.",
"description": ""
},
"sanitation_error.doNotSharePersistentRndBetweenDomains": {
"message": "Teilen Sie die persistenten Zufallszahlen nicht zwischen Domains, da dies den Browser 100% eindeutig identifizierbar macht.",
"description": ""
}
}

View File

@ -339,7 +339,7 @@
"description": ""
},
"protectedCanvasPart_description": {
"message": "readout: the readout features of the canvas API are protected.\n\ninput: the input features of the canvas API are protected. With blocking mode \"fake\" the drawn pixels get modified slightly when displaying text . This makes the detection of the add-on harder but is less secure. With WebGL canvases the behaviour is identical to \"readout\".\n\neverything: both the readout and input features are protected. It's not recommended to use this with \"fake\" block mode as it increases the probability to be detected.",
"message": "readout: the readout features of the canvas API are protected.\n\ninput: the input features of the canvas API are protected. With blocking mode \"fake\" the drawn pixels get modified slightly when displaying text. This makes the detection of the add-on harder but is less secure. With WebGL canvases the behaviour is identical to \"readout\".\n\neverything: both the readout and input features are protected. It's not recommended to use this with \"fake\" block mode as it increases the probability to be detected.",
"description": ""
},
"protectedCanvasPart_options.input": {
@ -480,6 +480,19 @@
"description": ""
},
"sharePersistentRndBetweenDomains_title": {
"message": "Share persistent randomness between domains",
"description": ""
},
"sharePersistentRndBetweenDomains_description": {
"message": "CAUTION: this setting makes the browser 100% trackable and is therefore a threat to your privacy.",
"description": ""
},
"sharePersistentRndBetweenDomains_confirmMessage": {
"message": "Are you really sure you want to share the persistent randomness between domains?\nCAUTION: this makes the browser 100% trackable and is therefore a threat to your privacy.",
"description": ""
},
"ignoreFrequentColors_title": {
"message": "Ignore the most frequent colors",
"description": ""
@ -1159,6 +1172,10 @@
"message": "Performance",
"description": ""
},
"sanitation_ruleset.privacy": {
"message": "Privacy",
"description": ""
},
"sanitation_error.unnecessaryURLValue": {
"message": "URL value for \"{url}\" is the same as the global setting for \"{setting-title}\".",
"description": ""
@ -1234,5 +1251,9 @@
"sanitation_error.storeImage": {
"message": "Storing the image for inspection has a high RAM footprint.",
"description": ""
},
"sanitation_error.doNotSharePersistentRndBetweenDomains": {
"message": "Do not share persistent randomness between domains because this makes the browser 100% trackable.",
"description": ""
}
}

View File

@ -66,6 +66,9 @@
const settings = require("./settings");
function getDomain(window){
if (settings.sharePersistentRndBetweenDomains){
return "shared://domain";
}
if (!window.location.href || window.location.href === "about:blank"){
if (window !== window.parent){
return getDomain(window.parent);

View File

@ -162,6 +162,10 @@
name: "lastPersistentRndClearing",
defaultValue: 0
},
{
name: "sharePersistentRndBetweenDomains",
defaultValue: false
},
{
name: "askOnlyOnce",
defaultValue: "individual",

View File

@ -254,6 +254,8 @@
};
addSection();
const beforeChangeEventListeners = {};
const {hide: hideContainer, expand: expandContainer} = settings.getContainers();
settingsDisplay.forEach(function(display){
if (typeof display === "string"){
@ -291,6 +293,22 @@
if (setting){
setting.display = display;
let originalSet = setting.set;
if (originalSet){
const eventListeners = [];
beforeChangeEventListeners[setting.name] = eventListeners;
setting.set = function(...args){
if (eventListeners.every(function(listener){
return listener.call(setting, ...args);
})){
return originalSet.apply(this, args);
}
else {
return false;
}
}
}
let hideChangeListeners = [];
setting.setHide = function setHide(value){
if (hideContainer){
@ -416,6 +434,14 @@
}
}
});
beforeChangeEventListeners.sharePersistentRndBetweenDomains.push(function(value){
if (value){
if (!confirm(browser.i18n.getMessage("sharePersistentRndBetweenDomains_confirmMessage"))){
return false;
}
}
return true;
});
});
searchInput.search();

View File

@ -128,9 +128,13 @@
setting.on(function(){type.updateCallback(input, setting.get(url));}, url);
input.addEventListener("change", function(){
var value = type.getValue(input);
setting.set(value, url);
logging.message("changed setting", setting.name, ":", value);
if (setting.set(value, url)){
logging.message("changed setting", setting.name, ":", value);
}
else {
type.updateCallback(input, setting.get(url));
logging.message("setting", setting.name, "was not changed");
}
});
}
else if (setting.keys){
@ -189,8 +193,20 @@
container = setting.defaultValue;
}
container[key] = value;
setting.set(container, url);
logging.message("changed setting", setting.name, "(", key, "):", value);
if (setting.set(container, url)){
logging.message("changed setting", setting.name, "(", key, "):", value);
}
else {
container = setting.get(url);
keyType.updateCallback(
keyInput,
container && container.hasOwnProperty(key)?
container[key]:
setting.defaultKeyValue,
url
);
logging.message("setting", setting.name, "(", key, ") was not changed");
}
});
input.appendChild(row);
});

View File

@ -279,5 +279,23 @@
}
}
},
{
name: "privacy",
check: function(errorCallback){
if (settings.sharePersistentRndBetweenDomains){
errorCallback({
message: browser.i18n.getMessage("sanitation_error.doNotSharePersistentRndBetweenDomains"),
severity: "high",
resolutions: [{
label: browser.i18n.getMessage("sanitation_resolution.disableFlag")
.replace(/{flag}/g, browser.i18n.getMessage("sharePersistentRndBetweenDomains_title")),
callback: function(){
settings.sharePersistentRndBetweenDomains = false;
}
}]
});
}
}
},
];
}());

View File

@ -99,6 +99,22 @@
}
]
},
{
"name": "sharePersistentRndBetweenDomains",
"displayDependencies": [
{
"blockMode": ["fake"],
"rng": ["persistent"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["ask"],
"askDenyMode": ["fake"],
"rng": ["persistent"],
"displayAdvancedSettings": [true]
}
]
},
"notifications",
{
"name": "showNotifications"

View File

@ -8,6 +8,7 @@ Version 0.5.6:
- highlight "hide" icon when "tabing" to it
- made url specific values manageable with "tabing"
- added setting "protected canvas part" to decouple block mode from part
- added "share persistent randomness between domains"
fixes:
- constant rng did not work properly when protecting input