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

Refactor existing codebase

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