From 2d66565c3578388492426575b65acc55a1a079cf Mon Sep 17 00:00:00 2001 From: wanhose Date: Mon, 5 Jul 2021 18:07:37 +0200 Subject: [PATCH 1/4] feat(scripts): clear storage when update --- scripts/background.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/background.js b/scripts/background.js index 05363d9..daed699 100644 --- a/scripts/background.js +++ b/scripts/background.js @@ -204,7 +204,7 @@ const updateState = (tabId, state) => { }; /** - * @description Listens to content messages + * @description Listens to messages */ chrome.runtime.onMessage.addListener((request, sender, responseCallback) => { @@ -252,3 +252,13 @@ chrome.runtime.onMessage.addListener((request, sender, responseCallback) => { return true; }); + +/** + * @description Listens to updates + */ + +chrome.runtime.onInstalled.addListener((reason) => { + if (reason === chrome.runtime.OnInstalledReason.UPDATE) { + chrome.storage.local.clear(); + } +}); From 2f8ef099c35feaba555b706b41f1de2f9fc3c9b9 Mon Sep 17 00:00:00 2001 From: wanhose Date: Mon, 5 Jul 2021 18:08:05 +0200 Subject: [PATCH 2/4] fix(styles): display bug --- styles/content.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/content.css b/styles/content.css index 7112b79..036a83d 100644 --- a/styles/content.css +++ b/styles/content.css @@ -1,5 +1,5 @@ body { - display: none !important; + opacity: 0; } @media (prefers-color-scheme: dark) { From d1ad9bbe42751418d52c92c7a3bf8beedd9c9d3c Mon Sep 17 00:00:00 2001 From: wanhose Date: Mon, 5 Jul 2021 18:08:37 +0200 Subject: [PATCH 3/4] feat(manifest): upgrade version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index b8ece86..acf7503 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Do Not Consent", - "version": "4.1.2", + "version": "4.2.0", "default_locale": "en", "description": "__MSG_appDesc__", "icons": { From 0539e4fb85cb3355e69acb337a80c51546e4b0ad Mon Sep 17 00:00:00 2001 From: wanhose Date: Mon, 5 Jul 2021 18:17:52 +0200 Subject: [PATCH 4/4] fix(scripts): accessing wrong to on installed reason --- scripts/background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/background.js b/scripts/background.js index daed699..cf721ed 100644 --- a/scripts/background.js +++ b/scripts/background.js @@ -257,7 +257,7 @@ chrome.runtime.onMessage.addListener((request, sender, responseCallback) => { * @description Listens to updates */ -chrome.runtime.onInstalled.addListener((reason) => { +chrome.runtime.onInstalled.addListener(({ reason }) => { if (reason === chrome.runtime.OnInstalledReason.UPDATE) { chrome.storage.local.clear(); }