Last active
February 26, 2019 19:38
-
-
Save bhackett1024/3cd7899c96aa343f8bd3717f35f57bb3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/devtools/client/debugger/new/src/client/firefox.js b/devtools/client/debugger/new/src/client/firefox.js | |
--- a/devtools/client/debugger/new/src/client/firefox.js | |
+++ b/devtools/client/debugger/new/src/client/firefox.js | |
@@ -35,9 +35,7 @@ export async function onConnect(connecti | |
supportsWasm | |
}); | |
- if (actions) { | |
- setupEvents({ threadClient, actions, supportsWasm }); | |
- } | |
+ setupEvents({ threadClient, tabTarget, actions, supportsWasm }); | |
tabTarget.on("will-navigate", actions.willNavigate); | |
tabTarget.on("navigate", actions.navigated); | |
diff --git a/devtools/client/debugger/new/src/client/firefox/events.js b/devtools/client/debugger/new/src/client/firefox/events.js | |
--- a/devtools/client/debugger/new/src/client/firefox/events.js | |
+++ b/devtools/client/debugger/new/src/client/firefox/events.js | |
@@ -9,7 +9,8 @@ import type { | |
ResumedPacket, | |
PausedPacket, | |
ThreadClient, | |
- Actions | |
+ Actions, | |
+ TabTarget | |
} from "./types"; | |
import { createPause, createSource } from "./create"; | |
@@ -19,6 +20,7 @@ const CALL_STACK_PAGE_SIZE = 1000; | |
type Dependencies = { | |
threadClient: ThreadClient, | |
+ tabTarget: TabTarget, | |
actions: Actions, | |
supportsWasm: boolean | |
}; | |
@@ -35,26 +37,13 @@ function addThreadEventListeners(client: | |
function setupEvents(dependencies: Dependencies) { | |
const threadClient = dependencies.threadClient; | |
+ const tabTarget = dependencies.tabTarget; | |
actions = dependencies.actions; | |
supportsWasm = dependencies.supportsWasm; | |
sourceQueue.initialize(actions); | |
- if (threadClient) { | |
- addThreadEventListeners(threadClient); | |
- | |
- if (threadClient._parent) { | |
- // Parent may be BrowsingContextTargetFront/WorkerTargetFront and | |
- // be protocol.js. Or DebuggerClient and still be old fashion actor. | |
- if (threadClient._parent.on) { | |
- threadClient._parent.on("workerListChanged", workerListChanged); | |
- } else { | |
- threadClient._parent.addListener( | |
- "workerListChanged", | |
- workerListChanged | |
- ); | |
- } | |
- } | |
- } | |
+ addThreadEventListeners(threadClient); | |
+ tabTarget.on("workerListChanged", workerListChanged); | |
} | |
async function paused( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment