diff --git a/devtools/server/actors/targets/window-global.js b/devtools/server/actors/targets/window-global.js index e9972ab45d11..d3d42a8e5cad 100644 --- a/devtools/server/actors/targets/window-global.js +++ b/devtools/server/actors/targets/window-global.js @@ -141,13 +141,8 @@ const windowGlobalTargetPrototype = { * * ### Main requests: * - * `attach`/`detach` requests: - * - start/stop document watching: - * Starts watching for new documents and emits `tabNavigated` and - * `frameUpdate` over RDP. - * - retrieve the thread actor: - * Instantiates a ThreadActor that can be later attached to in order to - * debug JS sources in the document. + * `detach`: + * Stop document watching and cleanup everything that the target and its children actors created. * `switchToFrame`: * Change the targeted document of the whole actor, and its child target-scoped actors * to an iframe or back to its original document. @@ -1152,18 +1147,6 @@ const windowGlobalTargetPrototype = { // Protocol Request Handlers - attach(request) { - if (this.isDestroyed()) { - throw { - error: "destroyed", - }; - } - - return { - threadActor: this.threadActor.actorID, - }; - }, - detach(request) { if (!this._detach()) { throw { diff --git a/devtools/server/tests/xpcshell/testactors.js b/devtools/server/tests/xpcshell/testactors.js index cf6df1c3440d..2d9f4abdd25c 100644 --- a/devtools/server/tests/xpcshell/testactors.js +++ b/devtools/server/tests/xpcshell/testactors.js @@ -154,7 +154,6 @@ const TestTargetActor = protocol.ActorClassWithSpec(windowGlobalTargetSpec, { this._global.wrappedJSObject = global; this.threadActor = new ThreadActor(this, this._global); this.conn.addActor(this.threadActor); - this._attached = false; this._extraActors = {}; // This is a hack in order to enable threadActor to be accessed from getFront this._extraActors.threadActor = this.threadActor; @@ -210,16 +209,7 @@ const TestTargetActor = protocol.ActorClassWithSpec(windowGlobalTargetSpec, { return { ...response, ...actors }; }, - attach: function(request) { - this._attached = true; - - return { threadActor: this.threadActor.actorID }; - }, - detach: function(request) { - if (!this._attached) { - return { error: "wrongState" }; - } this.threadActor.destroy(); return { type: "detached" }; },