From 7daee86505d6ce2e3422c4935f660fa0e467c65a Mon Sep 17 00:00:00 2001 From: nobody Date: Fri, 24 Jul 2020 08:16:25 +0200 Subject: [PATCH] Show the rule set generator only when there are new CDNs --- core/main.js | 11 ++++------ pages/updates/updates.css | 10 +++++----- pages/updates/updates.html | 41 ++++++++++++++++++++------------------ pages/updates/updates.js | 6 ++++++ 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/core/main.js b/core/main.js index 9bce84ba..0d75c299 100644 --- a/core/main.js +++ b/core/main.js @@ -93,22 +93,19 @@ main._showReleaseNotes = function (details) { }); } else if (details.reason === chrome.runtime.OnInstalledReason.UPDATE) { - let newValue = lastMappingUpdate; - let oldValue = ""; - // If add-on update true, check last update of mappings.js chrome.storage.sync.get([Setting.LAST_MAPPING_UPDATE, Setting.HIDE_RELEASE_NOTES], function (items) { - oldValue = items.lastMappingUpdate; + let mappingUpdate = items.lastMappingUpdate !== lastMappingUpdate; - if (oldValue !== newValue || !items.hideReleaseNotes) { + if (mappingUpdate || !items.hideReleaseNotes) { // Updated mappings.js chrome.storage.sync.set({ - [Setting.LAST_MAPPING_UPDATE]: newValue + [Setting.LAST_MAPPING_UPDATE]: lastMappingUpdate }, function() { if (!items.hideReleaseNotes) { chrome.tabs.create({ - 'url': chrome.extension.getURL('pages/updates/updates.html'), + 'url': chrome.extension.getURL('pages/updates/updates.html?mappingupdate=' + mappingUpdate), 'active': false }); } diff --git a/pages/updates/updates.css b/pages/updates/updates.css index 67071067..69a8bc63 100644 --- a/pages/updates/updates.css +++ b/pages/updates/updates.css @@ -39,11 +39,11 @@ input[type=radio], label { } #history { - cursor: pointer; - font-size: 24px; - font-weight: bold; + cursor: pointer; + font-size: 24px; + font-weight: bold; } -#history-release-notes { - +#generator-section { + display: none; } diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 00863a03..8d96e91b 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -25,27 +25,30 @@ -
- Generate rule sets for uBlock or uMatrix +
+
+ Generate rule sets for uBlock or uMatrix +
+
+ +
+
+ +
+
+ + +
+
-
- -
-
- -
-
- - -
-
+ Previous Versions