1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Detect when browser.contextualIdentities.onRemoved is not supported

For #372
This commit is contained in:
kkapsner 2019-06-25 08:21:34 +02:00
parent 9ccaabd46a
commit 7cd89dec99
3 changed files with 21 additions and 6 deletions

View file

@ -59,11 +59,18 @@
settings.persistentRndStorage = newValue? JSON.stringify(scope.persistentRnd): "";
});
logging.message("register contextual identities removal");
browser.contextualIdentities.onRemoved.addListener(function(details){
logging.message("Contextual identity", details.contextualIdentity.cookieStoreId, "removed.");
clearContainerData(details.contextualIdentity.cookieStoreId);
});
if (browser.contextualIdentities && browser.contextualIdentities.onRemoved){
logging.message("register contextual identities removal");
browser.contextualIdentities.onRemoved.addListener(function(details){
logging.message("Contextual identity", details.contextualIdentity.cookieStoreId, "removed.");
clearContainerData(details.contextualIdentity.cookieStoreId);
});
}
else {
logging.error(
"Old Firefox does not support browser.contextualIdentities.onRemoved"
);
}
};
const getInterval = function(){