Verified Commit cab5666e authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Refactor existing codebase

parent f5df67f5
......@@ -22,6 +22,7 @@ const Address = {
'ANY_PATH': '/*',
'ANY_PROTOCOL': '*://',
'CHROME_EXTENSION': 'chrome-extension:',
'DECENTRALEYES': 'decentraleyes.org',
'EXAMPLE': 'example.org',
'HTTP': 'http:',
'HTTPS': 'https:',
......
......@@ -32,7 +32,7 @@ fileGuard._startListening = function () {
chrome.webRequest.onBeforeRequest.addListener(
fileGuard._verifyRequest,
{'urls': [`${fileGuard.path}/*`]},
{'urls': [fileGuard.path + Address.ANY_PATH]},
[WebRequest.BLOCKING]
);
};
......
......@@ -157,7 +157,7 @@ interceptor._handleStorageChanged = function (changes) {
*/
interceptor.amountInjected = 0;
interceptor.xhrTestDomain = 'decentraleyes.org';
interceptor.xhrTestDomain = Address.DECENTRALEYES;
interceptor.blockMissing = false;
interceptor.relatedSettings = [];
......@@ -169,7 +169,7 @@ interceptor.relatedSettings.push(Setting.BLOCK_MISSING);
chrome.storage.local.get(interceptor.relatedSettings, function (items) {
interceptor.amountInjected = items.amountInjected || 0;
interceptor.xhrTestDomain = items.xhrTestDomain || 'decentraleyes.org';
interceptor.xhrTestDomain = items.xhrTestDomain || Address.DECENTRALEYES;
interceptor.blockMissing = items.blockMissing || false;
});
......
......@@ -26,7 +26,7 @@ var main = {};
main._initializeOptions = function () {
let optionDefaults = {
[Setting.XHR_TEST_DOMAIN]: 'decentraleyes.org',
[Setting.XHR_TEST_DOMAIN]: Address.DECENTRALEYES,
[Setting.SHOW_ICON_BADGE]: true,
[Setting.BLOCK_MISSING]: false,
[Setting.DISABLE_PREFETCH]: true,
......
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