From 7cd89dec997919f0b1617634e75adc68eaf830f1 Mon Sep 17 00:00:00 2001 From: kkapsner Date: Tue, 25 Jun 2019 08:21:34 +0200 Subject: [PATCH] Detect when browser.contextualIdentities.onRemoved is not supported For #372 --- lib/persistentRndStorage.js | 17 ++++++++++++----- releaseNotes.txt | 2 +- versions/updates.json | 8 ++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/persistentRndStorage.js b/lib/persistentRndStorage.js index 9aa1a79..8ef0809 100644 --- a/lib/persistentRndStorage.js +++ b/lib/persistentRndStorage.js @@ -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(){ diff --git a/releaseNotes.txt b/releaseNotes.txt index 0877570..756fabf 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -6,7 +6,7 @@ Version 0.5.12: - fixes: - - + - detect when browser.contextualIdentities.onRemoved is not supported known issues: - if a data URL is blocked the page action button does not appear diff --git a/versions/updates.json b/versions/updates.json index 61608ec..6985f7e 100644 --- a/versions/updates.json +++ b/versions/updates.json @@ -29,6 +29,14 @@ { "version": "0.5.12Alpha20190623", "update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-0.5.12Alpha20190623-an+fx.xpi" + }, + { + "version": "0.5.12Alpha20190624", + "update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-0.5.12Alpha20190624-an+fx.xpi" + }, + { + "version": "0.5.12Alpha20190625", + "update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-0.5.12Alpha20190625-an+fx.xpi" } ] }