diff --git a/src/background/request_blocker.js b/src/background/request_blocker.js index 2a7a79f..71b05aa 100644 --- a/src/background/request_blocker.js +++ b/src/background/request_blocker.js @@ -1,19 +1,23 @@ -import requestListener from './request_listener.js'; -import Logger from '../shared/util/logger.js'; - /** * @see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeRequest */ + +import requestListener from './request_listener.js'; +import Logger from '../shared/util/logger.js'; + +const BLOCKING_FLAG = 'blocking'; +const ALL_URLS_FILTER = { urls: [''] }; + export default class RequestBlocker { static startMonitoring() { - const BLOCKING_FLAG = 'blocking'; - const URL_FILTER = { urls: [''] }; - - browser.webRequest.onErrorOccurred.addListener(Logger.error, URL_FILTER); + browser.webRequest.onErrorOccurred.addListener( + Logger.error, + ALL_URLS_FILTER + ); browser.webRequest.onBeforeRequest.addListener( requestListener, - URL_FILTER, + ALL_URLS_FILTER, [BLOCKING_FLAG] ); }