mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
parent
895c7a36d7
commit
03524fd789
@ -491,6 +491,14 @@
|
||||
"message": "Leeren",
|
||||
"description": ""
|
||||
},
|
||||
"clearPersistentRndForContainer_label": {
|
||||
"message": "Container leeren",
|
||||
"description": ""
|
||||
},
|
||||
"clearPersistentRndForContainer_title": {
|
||||
"message": "Container auswählen",
|
||||
"description": ""
|
||||
},
|
||||
"sharePersistentRndBetweenDomains_title": {
|
||||
"message": "Persistente Zufallszahlen zwischen Domains teilen",
|
||||
"description": ""
|
||||
|
@ -515,6 +515,14 @@
|
||||
"message": "Clear",
|
||||
"description": ""
|
||||
},
|
||||
"clearPersistentRndForContainer_label": {
|
||||
"message": "Clear container",
|
||||
"description": ""
|
||||
},
|
||||
"clearPersistentRndForContainer_title": {
|
||||
"message": "Select container",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
"sharePersistentRndBetweenDomains_title": {
|
||||
"message": "Share persistent randomness between domains",
|
||||
|
@ -41,6 +41,12 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (data["canvasBlocker-clear-container-rnd"]){
|
||||
persistentRndStorage.clearContainerData(data["canvasBlocker-clear-container-rnd"]);
|
||||
if (keys.length === 1){
|
||||
return;
|
||||
}
|
||||
}
|
||||
notice("pass the message to the tabs");
|
||||
browser.tabs.query({}).then(function(tabs){
|
||||
tabs.forEach(function(tab){
|
||||
|
20
lib/modal.js
20
lib/modal.js
@ -118,6 +118,8 @@
|
||||
window.addEventListener("scroll", positionDialog);
|
||||
window.addEventListener("resize", positionDialog);
|
||||
}
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
scope.confirm = function(text, parent){
|
||||
@ -128,4 +130,22 @@
|
||||
], parent);
|
||||
});
|
||||
};
|
||||
|
||||
scope.select = function(text, options, parent){
|
||||
return new Promise(function(resolve, reject){
|
||||
const select = document.createElement("select");
|
||||
options.forEach(function(option){
|
||||
const optionNode = document.createElement("option");
|
||||
optionNode.text = option.name;
|
||||
optionNode.object = option.object;
|
||||
select.appendChild(optionNode);
|
||||
});
|
||||
|
||||
const container = openDialog(text, [
|
||||
{text: extension.getTranslation("cancel"), default: true, callback: ()=>reject(false)},
|
||||
{text: extension.getTranslation("OK"), focused: true, callback: ()=>resolve(select.options[select.selectedIndex].object)}
|
||||
], parent);
|
||||
container.querySelector(".text").insertAdjacentElement("afterend", select);
|
||||
});
|
||||
};
|
||||
}());
|
@ -34,6 +34,21 @@
|
||||
logging.notice("send message to main script");
|
||||
extension.message.send({"canvasBlocker-clear-domain-rnd": true});
|
||||
},
|
||||
clearPersistentRndForContainer: function(){
|
||||
browser.contextualIdentities.query({}).then(function(identities){
|
||||
modal.select(
|
||||
extension.getTranslation("clearPersistentRndForContainer_title"),
|
||||
identities.map(function(identity){
|
||||
return {
|
||||
name: `${identity.name} (${identity.cookieStoreId})`,
|
||||
object: identity
|
||||
};
|
||||
})
|
||||
).then(function(identity){
|
||||
extension.message.send({"canvasBlocker-clear-container-rnd": identity.cookieStoreId});
|
||||
}, ()=>{});
|
||||
});
|
||||
},
|
||||
inspectSettings: function(){
|
||||
logging.verbose("open settings inspection");
|
||||
window.open("export.html", "_blank");
|
||||
|
@ -85,6 +85,7 @@
|
||||
},
|
||||
{
|
||||
"name": "clearPersistentRnd",
|
||||
"actions": ["clearPersistentRnd", "clearPersistentRndForContainer"],
|
||||
"displayDependencies": [
|
||||
{
|
||||
"blockMode": ["fake"],
|
||||
|
@ -6,6 +6,7 @@ Version 0.5.11:
|
||||
- added auto update for beta versions
|
||||
- options: made sections collapsible
|
||||
- clear persistent rng data if a container is deleted
|
||||
- added tool to clear persistent rng for a specific container
|
||||
|
||||
fixes:
|
||||
- improved protection of (i)frame properties
|
||||
|
Loading…
x
Reference in New Issue
Block a user