diff --git a/devtools/docs/backend/protocol.md b/devtools/docs/backend/protocol.md index 199a0f5ffedb1a78e557b39b32089ea9e29d0eca..2868b86b7c34920f0f39cce0235f834ecf97655c 100644 --- a/devtools/docs/backend/protocol.md +++ b/devtools/docs/backend/protocol.md @@ -709,14 +709,6 @@ This indicates that the tab has begun navigating to *newURL*; JavaScript executi where *newURL* and *newTitle* are the URL and title of the page the tab is now showing. The *tabThreadActor* given in the response to the original `"attach"` packet is now debugging the new page's code. -If the user closes a tab to which the client is attached, its *targetActor* sends a notification packet of the form: - -``` -{ "from":<targetActor>, "type":"tabDetached" } -``` - -The client is now detached from the tab. - ### Chrome Debugging If the server supports debugging chrome code, the root actor's reply to a `"listTabs"` request includes a property named `"chromeDebugger"`, whose value is the name of a thread-like actor to which the client can attach to debug chrome code. diff --git a/devtools/server/actors/targets/browsing-context.js b/devtools/server/actors/targets/browsing-context.js index 5ed4542ec73034dc0bd51c863c473ba4205d453b..f52712afed66c4d30b72c963fc16fd8b809c7a93 100644 --- a/devtools/server/actors/targets/browsing-context.js +++ b/devtools/server/actors/targets/browsing-context.js @@ -1066,8 +1066,6 @@ const browsingContextTargetPrototype = { return true; } - this.emit("tabDetached"); - return true; }, diff --git a/devtools/server/actors/targets/content-process.js b/devtools/server/actors/targets/content-process.js index 4ddac66e22fe75ba140e86810e840d9a0ca6c8ba..a9bffc9e1b33eabe54bdb7457b1a30c4b7b96fb9 100644 --- a/devtools/server/actors/targets/content-process.js +++ b/devtools/server/actors/targets/content-process.js @@ -207,10 +207,6 @@ const ContentProcessTargetActor = TargetActorMixin( } Resources.unwatchAllTargetResources(this); - // Notify the client that this target is being destroyed. - // So that we can destroy the target front and all its children. - this.emit("tabDetached"); - Actor.prototype.destroy.call(this); if (this.threadActor) { diff --git a/devtools/server/connectors/content-process-connector.js b/devtools/server/connectors/content-process-connector.js index 4f159acc3526aa7b68265d0e91d9e099fdeb513b..114d6bea4fabeac3a084bd34dcebf6f747272507 100644 --- a/devtools/server/connectors/content-process-connector.js +++ b/devtools/server/connectors/content-process-connector.js @@ -102,13 +102,6 @@ function connectToContentProcess(connection, mm, onDestroy) { const onMessageManagerClose = DevToolsUtils.makeInfallible( (subject, topic, data) => { if (subject == mm) { - // Send the "tabDetached" event before closing the connection which - // will destroy fronts on the client. - // Note that the content process may be destroyed before the actor is created. - // Avoid trying to send any tabDetached in such situation. - if (actor) { - connection.send({ from: actor.actor, type: "tabDetached" }); - } onClose(); } } diff --git a/devtools/server/connectors/frame-connector.js b/devtools/server/connectors/frame-connector.js index 4bb55edc4b3a380657abce22dd5982dc7aa714cf..62c3af07cd1df493966bd76d67669365df475e1e 100644 --- a/devtools/server/connectors/frame-connector.js +++ b/devtools/server/connectors/frame-connector.js @@ -217,10 +217,6 @@ function connectToFrame(connection, frame, onDestroy, { addonId } = {}) { spawnInParentActorPool.destroy(); if (actor) { - // The FrameTargetActor within the child process doesn't necessary - // have time to uninitialize itself when the frame is closed/killed. - // So ensure telling the client that the related actor is detached. - connection.send({ from: actor.actor, type: "tabDetached" }); actor = null; } diff --git a/devtools/server/connectors/js-window-actor/DevToolsFrameParent.jsm b/devtools/server/connectors/js-window-actor/DevToolsFrameParent.jsm index 4906a275dee833feb047e0bcbb0bdfa301226bc2..658652bb4855cd43e1e947ebb231d037e6540b52 100644 --- a/devtools/server/connectors/js-window-actor/DevToolsFrameParent.jsm +++ b/devtools/server/connectors/js-window-actor/DevToolsFrameParent.jsm @@ -197,14 +197,6 @@ class DevToolsFrameParent extends JSWindowActorParent { for (const { actor, connection, watcher } of this._connections.values()) { watcher.notifyTargetDestroyed(actor); - // XXX: we should probably get rid of this - if (actor && connection.transport) { - // The FrameTargetActor within the child process doesn't necessary - // have time to uninitialize itself when the frame is closed/killed. - // So ensure telling the client that the related actor is detached. - connection.send({ from: actor.actor, type: "tabDetached" }); - } - this._cleanupConnection(connection); } this._connections.clear(); diff --git a/devtools/shared/specs/targets/browsing-context.js b/devtools/shared/specs/targets/browsing-context.js index d30fcb2c84b1c701b271e465eb00fa6ef3c25e3e..1270d2657c3277d52de583cdb5bcd69990e2a598 100644 --- a/devtools/shared/specs/targets/browsing-context.js +++ b/devtools/shared/specs/targets/browsing-context.js @@ -141,12 +141,6 @@ const browsingContextTargetSpecPrototype = { selected: Option(0, "nullable:number"), destroyAll: Option(0, "nullable:boolean"), }, - tabDetached: { - type: "tabDetached", - // This is to make browser_dbg_navigation.js to work as it expect to - // see a packet object when listening for tabDetached - from: Option(0, "string"), - }, workerListChanged: { type: "workerListChanged", }, diff --git a/devtools/shared/specs/targets/content-process.js b/devtools/shared/specs/targets/content-process.js index 1c5c7b05905e25656e1c68f6c3a165ae24f08c4d..71d593c46ab0b6fc855e3729cecae9322b5f9855 100644 --- a/devtools/shared/specs/targets/content-process.js +++ b/devtools/shared/specs/targets/content-process.js @@ -37,10 +37,6 @@ const contentProcessTargetSpec = generateActorSpec({ workerListChanged: { type: "workerListChanged", }, - tabDetached: { - type: "tabDetached", - from: Option(0, "string"), - }, "resource-available-form": { type: "resource-available-form", resources: Arg(0, "array:json"),