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 28, 2018
1 parent 182ee17 commit 3a2b0ab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
1 change: 1 addition & 0 deletions core/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const Address = {
'ANY': '*://*/*',
'ANY_PATH': '/*',
'ANY_PROTOCOL': '*://',
'CHROME': 'chrome:',
'CHROME_EXTENSION': 'chrome-extension:',
'DECENTRALEYES': 'decentraleyes.org',
'EXAMPLE': 'example.org',
Expand Down
21 changes: 0 additions & 21 deletions core/state-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ stateManager._updateTab = function (details) {
'tabId': tabIdentifier,
'title': 'Decentraleyes (–)'
});

} else {
stateManager._setIconDefault(tabIdentifier);
}

if (stateManager.showIconBadge === true) {
Expand Down Expand Up @@ -213,14 +210,6 @@ stateManager._domainIsWhitelisted = function (domain) {
return false;
};

stateManager._setIconDefault = function (tabIdentifier) {

wrappers.setIcon({
'path': stateManager.defaultIconPath,
'tabId': tabIdentifier
});
};

stateManager._setIconDisabled = function (tabIdentifier) {

wrappers.setIcon({
Expand All @@ -236,16 +225,6 @@ stateManager._setIconDisabled = function (tabIdentifier) {
stateManager.requests = {};
stateManager.tabs = {};

stateManager.defaultIconPath = {
'16': chrome.runtime.getURL('icons/action/icon16-default.png'),
'18': chrome.runtime.getURL('icons/action/icon18-default.png'),
'19': chrome.runtime.getURL('icons/action/icon19-default.png'),
'32': chrome.runtime.getURL('icons/action/icon32-default.png'),
'36': chrome.runtime.getURL('icons/action/icon36-default.png'),
'38': chrome.runtime.getURL('icons/action/icon38-default.png'),
'64': chrome.runtime.getURL('icons/action/icon64-default.png')
};

stateManager.disabledIconPath = {
'16': chrome.runtime.getURL('icons/action/icon16-disabled.png'),
'18': chrome.runtime.getURL('icons/action/icon18-disabled.png'),
Expand Down
4 changes: 4 additions & 0 deletions modules/internal/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ helpers.extractDomainFromUrl = function (url, normalize) {
extractedDomain = null;
}

if (url.startsWith(Address.CHROME)) {
extractedDomain = null;
}

if (extractedDomain === '') {
extractedDomain = null;
}
Expand Down

0 comments on commit 3a2b0ab

Please sign in to comment.