From 5f15ab1c379fcd254785a398775fe12ceefdbe60 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Tue, 29 Dec 2020 02:35:03 -0800 Subject: improve test reliability; try clear scriptsForTab (doesn't work yet) --- extension/background.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'extension') diff --git a/extension/background.js b/extension/background.js index ab15933..4de9b67 100644 --- a/extension/background.js +++ b/extension/background.js @@ -84,14 +84,13 @@ const BrowserState = { scriptsForTab: {} }; chrome.debugger.onEvent.addListener((source, method, params) => { console.log(source, method, params); - if (method === "Page.") { + if (method === "Page.frameStartedLoading") { // we're gonna assume we're always plugged into both Page and Debugger. BrowserState.scriptsForTab[source.tabId] = []; } else if (method === "Debugger.scriptParsed") { BrowserState.scriptsForTab[source.tabId] = BrowserState.scriptsForTab[source.tabId] || []; BrowserState.scriptsForTab[source.tabId].push(params); - // FIXME: clear these out when page changes in tab (how?) } }); })(); -- cgit v1.2.3