From f283cae79a2805693e28b6c2891e6cab5e3e1413 Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 21 Jun 2020 08:18:18 +0200 Subject: [PATCH] Various improvements in the code --- core/state-manager.js | 2 +- modules/internal/helpers.js | 2 +- pages/options/options.js | 6 ++---- pages/popup/popup.js | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/state-manager.js b/core/state-manager.js index b45dcd61..1de7e892 100644 --- a/core/state-manager.js +++ b/core/state-manager.js @@ -179,7 +179,7 @@ stateManager._createTab = function (tab) { chrome.webRequest.onBeforeRequest.addListener(function (requestDetails) { - let tab = stateManager.tabs[tabIdentifier].details || {}; + tab = stateManager.tabs[tabIdentifier].details || {}; return interceptor.handleRequest(requestDetails, tabIdentifier, tab); }, requestFilters, [WebRequest.BLOCKING]); diff --git a/modules/internal/helpers.js b/modules/internal/helpers.js index a4114225..3084def5 100644 --- a/modules/internal/helpers.js +++ b/modules/internal/helpers.js @@ -29,7 +29,7 @@ var helpers = {}; helpers.insertI18nContentIntoDocument = function (document) { - let scriptDirection, defaultScriptDirection, i18nElements, translationComplete; + let scriptDirection, i18nElements, translationComplete; translationComplete = true; scriptDirection = helpers.determineScriptDirection(navigator.language); diff --git a/pages/options/options.js b/pages/options/options.js index ac0f0c88..44c389f6 100644 --- a/pages/options/options.js +++ b/pages/options/options.js @@ -217,11 +217,9 @@ options._onOptionChanged = function ({target}) { optionKey = target.getAttribute('data-option'); optionType = target.getAttribute('type'); - switch (optionType) { - case 'checkbox': + if (optionType === 'checkbox') { optionValue = target.checked; - break; - default: + } else { optionValue = target.value; } diff --git a/pages/popup/popup.js b/pages/popup/popup.js index 4df17de9..03e88688 100644 --- a/pages/popup/popup.js +++ b/pages/popup/popup.js @@ -52,7 +52,7 @@ popup._renderContents = function () { popup._renderNonContextualContents = function () { - let versionLabelElement, nameLabelElement, counterElement, testingUtilityLinkElement, optionsButtonElement, donationButtonElement, infoButtonLabel, infoButtonSVG; + let versionLabelElement, nameLabelElement, counterElement, testingUtilityLinkElement, optionsButtonElement, donationButtonElement, infoButtonLabel; versionLabelElement = document.getElementById('version-label'); nameLabelElement = document.getElementById('name-label');