Skip to content
This repository has been archived by the owner on Jun 8, 2018. It is now read-only.

Commit

Permalink
Refactor existing codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Synzvato committed Jun 29, 2018
1 parent 48a6614 commit 29a6942
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions core/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const Address = {
'EXAMPLE': 'example.org',
'HTTP': 'http:',
'HTTPS': 'https:',
'RESOURCE_PATH': '/resources',
'ROOT_PATH': '/',
'WWW_PREFIX': 'www.'
};

Expand Down
4 changes: 2 additions & 2 deletions core/file-guard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion core/state-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 29a6942

Please sign in to comment.