/* 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/. */
/** * A BrowserConsole instance is an interactive console initialized *per commands* * that displays console log data as well as provides an interactive terminal to * manipulate all browser debuggable context and targeted by default at the current * top-level window's document. * * This object only wraps the iframe that holds the Browser Console UI. This is * meant to be an integration point between the Firefox UI and the Browser Console * UI and features. * * This object extends the WebConsole object located in webconsole.js
*/ class BrowserConsole extends WebConsole {
#bcInitializer = null;
#bcDestroyer = null;
#telemetry; /* * @constructor * @param object commands * The commands object with all interfaces defined from devtools/shared/commands/ * @param nsIDOMWindow iframeWindow * The window where the browser console UI is already loaded. * @param nsIDOMWindow chromeWindow * The window of the browser console owner.
*/
constructor(commands, iframeWindow, chromeWindow) { super(null, commands, iframeWindow, chromeWindow, true);
this.#telemetry = new Telemetry();
}
/** * Initialize the Browser Console instance. * * @return object * A promise for the initialization.
*/
init() { if (this.#bcInitializer) { returnthis.#bcInitializer;
}
this.#bcInitializer = (async () => { // Only add the shutdown observer if we've opened a Browser Console window.
ShutdownObserver.init();
// Reports the console as created only after everything is done, // including TargetCommand.startListening. const id = Utils.supportsString(this.hudId);
Services.obs.notifyObservers(id, "web-console-created");
})(); returnthis.#bcInitializer;
}
/** * Destroy the object. * * @return object * A promise object that is resolved once the Browser Console is closed.
*/
destroy() { if (this.#bcDestroyer) { returnthis.#bcDestroyer;
}
/** * The ShutdownObserver listens for app shutdown and saves the current state * of the Browser Console for session restore.
*/ var ShutdownObserver = {
_initialized: false,
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.