Verified Commit 29a69426 authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Refactor existing codebase

parent 48a66145
......@@ -27,6 +27,8 @@ const Address = {
'EXAMPLE': 'example.org',
'HTTP': 'http:',
'HTTPS': 'https:',
'RESOURCE_PATH': '/resources',
'ROOT_PATH': '/',
'WWW_PREFIX': 'www.'
};
......
......@@ -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)) {
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment