mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 21:00:23 +01:00
parent
1556ee45c2
commit
9353f71455
@ -83,6 +83,10 @@
|
|||||||
"message": "Bei Aktualisierung nicht wieder anzeigen.",
|
"message": "Bei Aktualisierung nicht wieder anzeigen.",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
"resistFingerprintingNotice": {
|
||||||
|
"message": "Sie haben privacy.resistFingerprinting aktiviert. Dies verändert das Verhalten von CanvasBlocker ein wenig. Weitere Informationen finden Sie {link:hier:https://github.com/kkapsner/CanvasBlocker/issues/158} und {link:hier:https://github.com/ghacksuserjs/ghacks-user.js/issues/767}.",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
"openInTab": {
|
"openInTab": {
|
||||||
"message": "In separatem Tab öffnen",
|
"message": "In separatem Tab öffnen",
|
||||||
"description": ""
|
"description": ""
|
||||||
@ -1543,4 +1547,4 @@
|
|||||||
"message": "Der window-API-Schutz macht reCAPTCHA unbenutzbar. Diese Voreinstellung erlaubt die Benutzung der window.name-API in eingebetteten Seiten. Dadurch funktioniert es wieder.",
|
"message": "Der window-API-Schutz macht reCAPTCHA unbenutzbar. Diese Voreinstellung erlaubt die Benutzung der window.name-API in eingebetteten Seiten. Dadurch funktioniert es wieder.",
|
||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -88,6 +88,10 @@
|
|||||||
"message": "Don't show up again after update.",
|
"message": "Don't show up again after update.",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
"resistFingerprintingNotice": {
|
||||||
|
"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": ""
|
||||||
|
},
|
||||||
"openInTab": {
|
"openInTab": {
|
||||||
"message": "Open in separate tab",
|
"message": "Open in separate tab",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
@ -27,6 +27,38 @@
|
|||||||
return id;
|
return id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scope.parseTranslation = function parseTranslation(message){
|
||||||
|
const container = document.createDocumentFragment();
|
||||||
|
|
||||||
|
message.split(/(\{[^}]+\})/).forEach(function(part){
|
||||||
|
if (part.startsWith("{") && part.endsWith("}")){
|
||||||
|
part = part.substring(1, part.length - 1);
|
||||||
|
const args = part.split(":");
|
||||||
|
switch (args[0]){
|
||||||
|
case "image": {
|
||||||
|
const image = document.createElement("img");
|
||||||
|
image.className = "noticeImage";
|
||||||
|
image.src = args.slice(1).join(":");
|
||||||
|
container.appendChild(image);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "link": {
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.target = "_blank";
|
||||||
|
link.textContent = args[1];
|
||||||
|
link.href = args.slice(2).join(":");
|
||||||
|
container.appendChild(link);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
container.appendChild(document.createTextNode(part));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return container;
|
||||||
|
};
|
||||||
|
|
||||||
scope.extensionID = browserAvailable? browser.extension.getURL(""): "extensionID";
|
scope.extensionID = browserAvailable? browser.extension.getURL(""): "extensionID";
|
||||||
|
|
||||||
scope.inIncognitoContext = browserAvailable? browser.extension.inIncognitoContext: false;
|
scope.inIncognitoContext = browserAvailable? browser.extension.inIncognitoContext: false;
|
||||||
|
@ -91,7 +91,8 @@
|
|||||||
"webRequest",
|
"webRequest",
|
||||||
"webRequestBlocking",
|
"webRequestBlocking",
|
||||||
"contextualIdentities",
|
"contextualIdentities",
|
||||||
"cookies"
|
"cookies",
|
||||||
|
"privacy"
|
||||||
],
|
],
|
||||||
|
|
||||||
"applications": {
|
"applications": {
|
||||||
|
@ -37,6 +37,12 @@ header .bookmarkNotice .dontShowOptionsOnUpdate input {
|
|||||||
vertical-align: sub;
|
vertical-align: sub;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.resistFingerprintingNotice {
|
||||||
|
margin: 0.5em 0;
|
||||||
|
padding: 0.5em;
|
||||||
|
border: 1px solid var(--input-error-background-color);
|
||||||
|
}
|
||||||
|
|
||||||
.settings {
|
.settings {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
|
@ -228,6 +228,29 @@
|
|||||||
groupTabs.classList = "groupTabs";
|
groupTabs.classList = "groupTabs";
|
||||||
document.body.appendChild(groupTabs);
|
document.body.appendChild(groupTabs);
|
||||||
|
|
||||||
|
if (
|
||||||
|
browser.privacy &&
|
||||||
|
browser.privacy.websites &&
|
||||||
|
browser.privacy.websites.resistFingerprinting &&
|
||||||
|
browser.privacy.websites.resistFingerprinting.get
|
||||||
|
){
|
||||||
|
browser.privacy.websites.resistFingerprinting.get({}).then(function({value}){
|
||||||
|
if (value){
|
||||||
|
const rfpNotice = document.createElement("div");
|
||||||
|
rfpNotice.className = "resistFingerprintingNotice";
|
||||||
|
rfpNotice.appendChild(
|
||||||
|
extension.parseTranslation(
|
||||||
|
extension.getTranslation("resistFingerprintingNotice")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
document.body.insertBefore(rfpNotice, 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";
|
||||||
groupTabs.appendChild(groups);
|
groupTabs.appendChild(groups);
|
||||||
|
@ -141,32 +141,7 @@
|
|||||||
if (noticeText){
|
if (noticeText){
|
||||||
const notice = document.createElement("div");
|
const notice = document.createElement("div");
|
||||||
notice.className = noticeName + " notice";
|
notice.className = noticeName + " notice";
|
||||||
noticeText.split(/(\{[^}]+\})/).forEach(function(part){
|
notice.appendChild(extension.parseTranslation(noticeText));
|
||||||
if (part.startsWith("{") && part.endsWith("}")){
|
|
||||||
part = part.substring(1, part.length - 1);
|
|
||||||
const args = part.split(":");
|
|
||||||
switch (args[0]){
|
|
||||||
case "image": {
|
|
||||||
const image = document.createElement("img");
|
|
||||||
image.className = "noticeImage";
|
|
||||||
image.src = args[1];
|
|
||||||
notice.appendChild(image);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "link": {
|
|
||||||
const link = document.createElement("a");
|
|
||||||
link.target = "_blank";
|
|
||||||
link.textContent = args[1];
|
|
||||||
link.href = args[2];
|
|
||||||
notice.appendChild(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
notice.appendChild(document.createTextNode(part));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
head.appendChild(notice);
|
head.appendChild(notice);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user