diff --git a/core/constants.js b/core/constants.js index 8bbb06981861e0d1495fadb0cf9fc6fb685ae87e..5bbc13e9d0dfefe99b3f150c615880496d10ecff 100644 --- a/core/constants.js +++ b/core/constants.js @@ -27,6 +27,8 @@ const Address = { 'EXAMPLE': 'example.org', 'HTTP': 'http:', 'HTTPS': 'https:', + 'RESOURCE_PATH': '/resources', + 'ROOT_PATH': '/', 'WWW_PREFIX': 'www.' }; diff --git a/core/file-guard.js b/core/file-guard.js index 6f5e6966b0ec9006384044f3007b2785af065e08..fc71543aca1ee4d36442fdb7f988991712d08e05 100644 --- a/core/file-guard.js +++ b/core/file-guard.js @@ -39,7 +39,7 @@ fileGuard._startListening = function () { fileGuard._verifyRequest = function (requestDetails) { - let redirectUrl = chrome.runtime.getURL('/'); + let redirectUrl = chrome.runtime.getURL(Address.ROOT_PATH); if (!requestDetails.url.endsWith(fileGuard.secret)) { return {redirectUrl}; @@ -50,7 +50,7 @@ fileGuard._verifyRequest = function (requestDetails) { * Initializations */ -fileGuard.path = chrome.runtime.getURL('/resources'); +fileGuard.path = chrome.runtime.getURL(Address.RESOURCE_PATH); fileGuard.secret = ''; if (fileGuard.path.startsWith(Address.CHROME_EXTENSION)) { diff --git a/core/state-manager.js b/core/state-manager.js index 44301339b814e73e572154816ef620ed3d09d183..0620c341fbf19ddb77f86d4662d8af0842c37b8b 100644 --- a/core/state-manager.js +++ b/core/state-manager.js @@ -123,7 +123,7 @@ stateManager._removeTab = function (tabIdentifier) { stateManager._updateTab = function (details) { - let tabDomain, domainIsWhitelisted, tabIdentifier, frameIdentifier; + let tabDomain, domainIsWhitelisted, frameIdentifier, tabIdentifier; tabDomain = helpers.extractDomainFromUrl(details.url); domainIsWhitelisted = stateManager._domainIsWhitelisted(tabDomain);