diff --git a/devtools/client/debugger/src/actions/navigation.js b/devtools/client/debugger/src/actions/navigation.js index 8cf194376725..afc33d9d1163 100644 --- a/devtools/client/debugger/src/actions/navigation.js +++ b/devtools/client/debugger/src/actions/navigation.js @@ -5,10 +5,8 @@ import { clearDocuments } from "../utils/editor"; import sourceQueue from "../utils/source-queue"; -import { evaluateExpressions } from "./expressions"; - import { clearWasmStates } from "../utils/wasm"; -import { getMainThread, getThreadContext } from "../selectors"; +import { getMainThread } from "../selectors"; /** * Redux actions for the navigation state @@ -35,18 +33,6 @@ export function willNavigate(event) { }; } -export function connect(url, actor) { - return async function({ dispatch, getState }) { - dispatch({ - type: "CONNECT", - mainThreadActorID: actor, - }); - - const cx = getThreadContext(getState()); - dispatch(evaluateExpressions(cx)); - }; -} - /** * @memberof actions/navigation * @static diff --git a/devtools/client/debugger/src/client/firefox.js b/devtools/client/debugger/src/client/firefox.js index 7c3736174ae6..c39b036bf7b3 100644 --- a/devtools/client/debugger/src/client/firefox.js +++ b/devtools/client/debugger/src/client/firefox.js @@ -8,6 +8,7 @@ import { features } from "../utils/prefs"; import { recordEvent } from "../utils/telemetry"; import sourceQueue from "../utils/source-queue"; +import { getContext } from "../selectors"; let actions; let commands; @@ -60,11 +61,11 @@ export async function onConnect(_commands, _resourceCommand, _actions, store) { }; await commands.threadConfigurationCommand.updateConfiguration(options); - // We should probably only pass descriptor informations from here - // so only pass if that's a WebExtension toolbox. - // And let actions.willNavigate/NAVIGATE pass the current/selected thread - // from onTargetAvailable - await actions.connect(targetFront.url, targetFront.threadFront.actor); + // Select the top level target by default + await actions.selectThread( + getContext(store.getState()), + targetFront.threadFront.actor + ); await targetCommand.watchTargets({ types: targetCommand.ALL_TYPES, diff --git a/devtools/client/debugger/src/reducers/pause.js b/devtools/client/debugger/src/reducers/pause.js index 944129dfa942..615d0c2b79e1 100644 --- a/devtools/client/debugger/src/reducers/pause.js +++ b/devtools/client/debugger/src/reducers/pause.js @@ -236,11 +236,6 @@ function update(state = initialPauseState(), action) { case "SELECT_FRAME": return updateThreadState({ selectedFrameId: action.frame.id }); - case "CONNECT": - return { - ...initialPauseState(action.mainThreadActorID), - }; - case "PAUSE_ON_EXCEPTIONS": { const { shouldPauseOnExceptions, shouldPauseOnCaughtExceptions } = action;