From 7b911c6e31ddfb79812055ae68d089a62e79d0b4 Mon Sep 17 00:00:00 2001 From: Thomas Rientjes Date: Mon, 25 Jun 2018 13:46:55 +0200 Subject: [PATCH] Refactor existing codebase --- core/constants.js | 1 + core/state-manager.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/constants.js b/core/constants.js index 6731979..f5e2f71 100644 --- a/core/constants.js +++ b/core/constants.js @@ -64,6 +64,7 @@ const WebRequest = { }; const WebRequestType = { + 'MAIN_FRAME': 'main_frame', 'XHR': 'xmlhttprequest' }; diff --git a/core/state-manager.js b/core/state-manager.js index dc543ca..31a021f 100644 --- a/core/state-manager.js +++ b/core/state-manager.js @@ -105,7 +105,6 @@ stateManager._createTab = function (tab) { }; requestFilters = { - 'tabId': tabIdentifier, 'urls': stateManager.validHosts }; @@ -226,7 +225,7 @@ chrome.webRequest.onBeforeRequest.addListener(function (requestDetails) { }; } -}, {'types': ['main_frame'], 'urls': [Address.ANY]}); +}, {'types': [WebRequestType.MAIN_FRAME], 'urls': [Address.ANY]}); chrome.webNavigation.onCommitted.addListener(stateManager._updateTab, { 'url': [{'urlContains': ':'}]