Bug 1820737 - [devtools] Remove backward compatibility for lastPrivateContextExited r=devtools-reviewers,devtools-backward-compat-reviewers,jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D171844
This commit is contained in:
Hubert Boma Manilla 2023-03-07 15:14:53 +00:00
parent 448187bbe9
commit 92c40b4c19
6 changed files with 0 additions and 91 deletions

View File

@ -174,24 +174,6 @@ The ``getCachedMessages`` packet allows one to retrieve the cached messages from
Each message in the array is of the same type as when we send typical page errors and console API calls. These will be explained in the following sections of this document.
Private browsing
----------------
The Browser Console can be used while the user has private windows open. Each page error, console API message and network request is annotated with a ``private`` flag. Private messages are cleared whenever the last private window is closed. The console actor provides the ``lastPrivateContextExited`` notification:
.. code-block:: json
{
"from": "conn0.console19",
"type": "lastPrivateContextExited"
}
This notification is sent only when your client is attached to the global console actor, it does not make sense for tab console actors.
.. note::
This notification has been introduced in Firefox 24.
Page errors
***********

View File

@ -165,13 +165,6 @@ class WebConsoleActor extends Actor {
"changed-toplevel-document",
this._onChangedToplevelDocument
);
this._onObserverNotification = this._onObserverNotification.bind(this);
if (this.parentActor.isRootActor) {
Services.obs.addObserver(
this._onObserverNotification,
"last-pb-context-exited"
);
}
}
/**
@ -354,13 +347,6 @@ class WebConsoleActor extends Actor {
this._onChangedToplevelDocument
);
if (this.parentActor.isRootActor) {
Services.obs.removeObserver(
this._onObserverNotification,
"last-pb-context-exited"
);
}
this._webConsoleCommandsCache = null;
this._lastConsoleInputEvaluation = null;
this._evalGlobal = null;
@ -1796,22 +1782,6 @@ class WebConsoleActor extends Actor {
return ownProperties;
}
/**
* Notification observer for the "last-pb-context-exited" topic.
*
* @private
* @param object subject
* Notification subject - in this case it is the inner window ID that
* was destroyed.
* @param string topic
* Notification topic.
*/
_onObserverNotification(subject, topic) {
if (topic === "last-pb-context-exited") {
this.emit("lastPrivateContextExited");
}
}
/**
* The "will-navigate" progress listener. This is used to clear the current
* eval scope.

View File

@ -1,32 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const ResourceCommand = require("resource://devtools/shared/commands/resource/resource-command.js");
module.exports = async function({ targetCommand, targetFront, onAvailable }) {
// We only care about the top level parent process target...
if (!targetFront.isTopLevel) {
return;
}
// ...of the browser console or toolbox.
const isBrowserConsoleOrToolbox =
targetCommand.descriptorFront.isBrowserProcessDescriptor;
if (!isBrowserConsoleOrToolbox) {
return;
}
const webConsoleFront = await targetFront.getFront("console");
webConsoleFront.on("lastPrivateContextExited", () => {
onAvailable([
{
resourceType: ResourceCommand.TYPES.LAST_PRIVATE_CONTEXT_EXIT,
},
]);
});
// Force doing a noop request in order to instantiate the actor.
// Otherwise it won't be instantiated and won't listen for private browsing events...
webConsoleFront.startListeners([]);
};

View File

@ -10,7 +10,6 @@ DevToolsModules(
"error-messages.js",
"extension-storage.js",
"indexed-db.js",
"last-private-context-exit.js",
"local-storage.js",
"platform-messages.js",
"reflow.js",

View File

@ -1346,15 +1346,6 @@ loader.lazyRequireGetter(
ResourceCommand.TYPES.REFLOW,
"resource://devtools/shared/commands/resource/legacy-listeners/reflow.js"
);
// @backward-compat { version 110 } Once Firefox 110 is release, we can:
// - remove this entry
// - remove the legacy listener file and the moz.build entry
// - remove the `lastPrivateContextExited` event from the webconsole spec
loader.lazyRequireGetter(
LegacyListeners,
ResourceCommand.TYPES.LAST_PRIVATE_CONTEXT_EXIT,
"resource://devtools/shared/commands/resource/legacy-listeners/last-private-context-exit.js"
);
// Optional transformers for each type of resource.
// Each module added here should be a function that will receive the resource, the target, …

View File

@ -91,7 +91,6 @@ const webconsoleSpecPrototype = {
inspectObject: {
objectActor: Option(0, "json"),
},
lastPrivateContextExited: {},
documentEvent: {
name: Option(0, "string"),
time: Option(0, "string"),