From 40092dffc90fc09a557780a548e46b961f6b2cb9 Mon Sep 17 00:00:00 2001 From: nobody Date: Fri, 5 Jun 2020 07:28:26 +0200 Subject: [PATCH] Fixed: Keep 'Tweak HTML source code' enabled after browser restart (#15) --- core/messenger.js | 2 +- core/request-analyzer.js | 4 ++-- core/state-manager.js | 6 +++--- pages/updates/updates.html | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/messenger.js b/core/messenger.js index feafe62e..399502da 100644 --- a/core/messenger.js +++ b/core/messenger.js @@ -64,7 +64,7 @@ messenger._handleMessageReceived = function (message, sender, sendResponse) { if (topic === 'domain:fetch-is-manipulateDOM') { - let manipulateDOMRecord = requestAnalyzer.domainsManipulateDOMlist[value]; + let manipulateDOMRecord = requestAnalyzer.domainsManipulateDOM[value]; sendResponse({'value': Boolean(manipulateDOMRecord)}); return MessageResponse.SYNCHRONOUS; diff --git a/core/request-analyzer.js b/core/request-analyzer.js index 28945795..83c6e654 100644 --- a/core/request-analyzer.js +++ b/core/request-analyzer.js @@ -175,7 +175,7 @@ requestAnalyzer._applyWhitelistedDomains = function () { requestAnalyzer._applyManipulateDOMDomains = function () { chrome.storage.local.get(Setting.DOMAINS_MANIPULATE_DOM, function (items) { - requestAnalyzer.manipulateDOMDomains = items.domainsManipulateDOM || {}; + requestAnalyzer.domainsManipulateDOM = items.domainsManipulateDOM || {}; }); }; @@ -186,7 +186,7 @@ requestAnalyzer._applyManipulateDOMDomains = function () { requestAnalyzer.whitelistedDomains = {}; requestAnalyzer._applyWhitelistedDomains(); -requestAnalyzer.domainsManipulateDOMlist = {}; +requestAnalyzer.domainsManipulateDOM = {}; requestAnalyzer._applyManipulateDOMDomains(); /** * Event Handlers diff --git a/core/state-manager.js b/core/state-manager.js index 2e8571f0..05648a3c 100644 --- a/core/state-manager.js +++ b/core/state-manager.js @@ -139,7 +139,7 @@ stateManager.addDomainToManipulateDOMlist = function (domain) { return new Promise((resolve) => { - let domainsManipulateDOM = requestAnalyzer.domainsManipulateDOMlist; + let domainsManipulateDOM = requestAnalyzer.domainsManipulateDOM; domainsManipulateDOM[domain] = true; chrome.storage.local.set({domainsManipulateDOM}, resolve); @@ -150,7 +150,7 @@ stateManager.removeDomainFromManipulateDOMlist = function (domain) { return new Promise((resolve) => { - let domainsManipulateDOM = requestAnalyzer.domainsManipulateDOMlist; + let domainsManipulateDOM = requestAnalyzer.domainsManipulateDOM; delete domainsManipulateDOM[domain]; chrome.storage.local.set({domainsManipulateDOM}, resolve); @@ -288,7 +288,7 @@ stateManager._domainIsListed = function (domain, listname) { let whitelistRecord, isWhitelisted; if (listname === "manipulate-dom") { - whitelistRecord = requestAnalyzer.manipulateDOMDomains[domain]; + whitelistRecord = requestAnalyzer.domainsManipulateDOM[domain]; isWhitelisted = Boolean(whitelistRecord); } else { whitelistRecord = requestAnalyzer.whitelistedDomains[domain]; diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 089792a9..f4b16209 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -31,6 +31,7 @@
  • Added note about missing translation in popup
  • Toggle for manipulate DOM removed for Chromium (not supported by Chromium)
  • Donation methods updated (+Bitcoin, +Ether)
  • +
  • Fixed: Keep 'Tweak HTML source code' enabled after browser restart (#15)
  • Please update your uBlock/uMatrix rules