123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671 |
- # HG changeset patch
- # User Matt A. Tobin <email@mattatobin.com>
- # Date 1659988365 0
- # Parent 23bd821e05a4192fadb4ff91d64fde5e22541684
- 9999999 - Port a slightly modified version of devtools-loader to suite.
- Also, includes the --chrome flag normally handled by nsBrowserContentHandler.
- diff --git a/suite/browser/nsBrowserContentHandler.js b/suite/browser/nsBrowserContentHandler.js
- --- a/suite/browser/nsBrowserContentHandler.js
- +++ b/suite/browser/nsBrowserContentHandler.js
- @@ -389,28 +389,31 @@ var nsBrowserContentHandler = {
- nsIBrowserDOMWindow.OPEN_NEWTAB,
- features,
- Services.scriptSecurityManager.getSystemPrincipal());
- cmdLine.preventDefault = true;
- }
- } catch (e) {
- }
-
- + /* XXXTobin: This code is currently relocated into the devtools-loader clh
- + until this component is converted to an ESModule.
- try {
- var chromeParam = cmdLine.handleFlagWithParam("chrome", false);
- if (chromeParam) {
- // only load URIs which do not inherit chrome privs
- var uri = resolveURIInternal(cmdLine, chromeParam);
- if (!Services.netUtils.URIChainHasFlags(uri, URI_INHERITS_SECURITY_CONTEXT)) {
- openWindow(null, uri.spec, features);
- cmdLine.preventDefault = true;
- }
- }
- } catch (e) {
- }
- + */
-
- try {
- var fileParam = cmdLine.handleFlagWithParam("file", false);
- if (fileParam) {
- fileParam = resolveURIInternal(cmdLine, fileParam);
- handURIToExistingBrowser(fileParam,
- nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW,
- features,
- diff --git a/suite/components/devtools/all-devtools.js b/suite/components/devtools/all-devtools.js
- new file mode 100644
- --- /dev/null
- +++ b/suite/components/devtools/all-devtools.js
- @@ -0,0 +1,368 @@
- +// Developer Tools related preferences
- +pref("devtools.chrome.enabled", true);
- +pref("devtools.debugger.remote-enabled", true);
- +pref("devtools.selfxss.count", 5);
- +// Enable extensionStorage storage actor by default
- +pref("devtools.storage.extensionStorage.enabled", true);
- +
- +// Toolbox preferences
- +pref("devtools.toolbox.footer.height", 250);
- +pref("devtools.toolbox.sidebar.width", 500);
- +pref("devtools.toolbox.host", "bottom");
- +pref("devtools.toolbox.previousHost", "right");
- +pref("devtools.toolbox.selectedTool", "inspector");
- +pref("devtools.toolbox.sideEnabled", true);
- +pref("devtools.toolbox.zoomValue", "1");
- +pref("devtools.toolbox.splitconsoleEnabled", false);
- +pref("devtools.toolbox.splitconsoleHeight", 100);
- +pref("devtools.toolbox.tabsOrder", "");
- +pref("devtools.netmonitor.features.newEditAndResend", false);
- +
- +// The fission pref for enabling the "Multiprocess Browser Toolbox", which will
- +// make it possible to debug anything in Firefox (See Bug 1570639 for more
- +// information).
- +pref("devtools.browsertoolbox.fission", true);
- +
- +// When the Multiprocess Browser Toolbox is enabled, you can configure the scope of it:
- +// - "everything" will enable debugging absolutely everything in the browser
- +// All processes, all documents, all workers, all add-ons.
- +// - "parent-process" will restrict debugging to the parent process
- +// All privileged javascript, documents and workers running in the parent process.
- +pref("devtools.browsertoolbox.scope", "everything");
- +
- +// Toolbox Button preferences
- +pref("devtools.command-button-pick.enabled", true);
- +pref("devtools.command-button-frames.enabled", true);
- +pref("devtools.command-button-splitconsole.enabled", true);
- +pref("devtools.command-button-responsive.enabled", true);
- +pref("devtools.command-button-screenshot.enabled", false);
- +pref("devtools.command-button-rulers.enabled", false);
- +pref("devtools.command-button-measure.enabled", false);
- +pref("devtools.command-button-noautohide.enabled", false);
- +pref("devtools.command-button-errorcount.enabled", true);
- + pref("devtools.command-button-experimental-prefs.enabled", true);
- +
- +// Inspector preferences
- +// Enable the Inspector
- +pref("devtools.inspector.enabled", true);
- +// What was the last active sidebar in the inspector
- +pref("devtools.inspector.selectedSidebar", "layoutview");
- +pref("devtools.inspector.activeSidebar", "layoutview");
- +pref("devtools.inspector.remote", false);
- +
- +// Enable the 3 pane mode in the inspector
- +pref("devtools.inspector.three-pane-enabled", true);
- +// Enable the 3 pane mode in the chrome inspector
- +pref("devtools.inspector.chrome.three-pane-enabled", false);
- +// Collapse pseudo-elements by default in the rule-view
- +pref("devtools.inspector.show_pseudo_elements", false);
- +// The default size for image preview tooltips in the rule-view/computed-view/markup-view
- +pref("devtools.inspector.imagePreviewTooltipSize", 300);
- +// Enable user agent style inspection in rule-view
- +pref("devtools.inspector.showUserAgentStyles", false);
- +// Show native anonymous content and user agent shadow roots
- +pref("devtools.inspector.showAllAnonymousContent", false);
- +// Enable the inline CSS compatibility warning in inspector rule view
- +pref("devtools.inspector.ruleview.inline-compatibility-warning.enabled", false);
- +// Enable the compatibility tool in the inspector.
- +pref("devtools.inspector.compatibility.enabled", true);
- +// Enable color scheme simulation in the inspector.
- +pref("devtools.inspector.color-scheme-simulation.enabled", true);
- +
- +// Grid highlighter preferences
- +pref("devtools.gridinspector.gridOutlineMaxColumns", 50);
- +pref("devtools.gridinspector.gridOutlineMaxRows", 50);
- +pref("devtools.gridinspector.showGridAreas", false);
- +pref("devtools.gridinspector.showGridLineNumbers", false);
- +pref("devtools.gridinspector.showInfiniteLines", false);
- +// Max number of grid highlighters that can be displayed
- +pref("devtools.gridinspector.maxHighlighters", 3);
- +
- +// Whether or not simplified highlighters should be used when
- +// prefers-reduced-motion is enabled.
- +pref("devtools.inspector.simple-highlighters-reduced-motion", false);
- +
- +// Whether or not the box model panel is opened in the layout view
- +pref("devtools.layout.boxmodel.opened", true);
- +// Whether or not the flexbox panel is opened in the layout view
- +pref("devtools.layout.flexbox.opened", true);
- +// Whether or not the flexbox container panel is opened in the layout view
- +pref("devtools.layout.flex-container.opened", true);
- +// Whether or not the flexbox item panel is opened in the layout view
- +pref("devtools.layout.flex-item.opened", true);
- +// Whether or not the grid inspector panel is opened in the layout view
- +pref("devtools.layout.grid.opened", true);
- +
- +// Enable hovering Box Model values and jumping to their source CSS rule in the
- +// rule-view.
- +#if defined(NIGHTLY_BUILD)
- + pref("devtools.layout.boxmodel.highlightProperty", true);
- +#else
- + pref("devtools.layout.boxmodel.highlightProperty", false);
- +#endif
- +
- +// By how many times eyedropper will magnify pixels
- +pref("devtools.eyedropper.zoom", 6);
- +
- +// Enable to collapse attributes that are too long.
- +pref("devtools.markup.collapseAttributes", true);
- +// Length to collapse attributes
- +pref("devtools.markup.collapseAttributeLength", 120);
- +// Whether to auto-beautify the HTML on copy.
- +pref("devtools.markup.beautifyOnCopy", false);
- +// Whether or not the DOM mutation breakpoints context menu are enabled in the
- +// markup view.
- +pref("devtools.markup.mutationBreakpoints.enabled", true);
- +
- +// DevTools default color unit
- +pref("devtools.defaultColorUnit", "authored");
- +
- +// Enable the Memory tools
- +pref("devtools.memory.enabled", true);
- +
- +pref("devtools.memory.custom-census-displays", "{}");
- +pref("devtools.memory.custom-label-displays", "{}");
- +pref("devtools.memory.custom-tree-map-displays", "{}");
- +
- +pref("devtools.memory.max-individuals", 1000);
- +pref("devtools.memory.max-retaining-paths", 10);
- +
- +// Enable the Performance tools
- +pref("devtools.performance.enabled", true);
- +// But not the pop-up.
- +pref("devtools.performance.popup.feature-flag", false);
- +// Override the default preset, which is "web-developer" on beta and release.
- +pref("devtools.performance.recording.preset", "firefox-platform");
- +pref("devtools.performance.recording.preset.remote", "firefox-platform");
- +
- +// The default cache UI setting
- +pref("devtools.cache.disabled", false);
- +
- +// The default service workers UI setting
- +pref("devtools.serviceWorkers.testing.enabled", false);
- +
- +// Enable the Network Monitor
- +pref("devtools.netmonitor.enabled", true);
- +
- +pref("devtools.netmonitor.features.search", true);
- +pref("devtools.netmonitor.features.requestBlocking", true);
- +
- +// Enable the Application panel
- +pref("devtools.application.enabled", false);
- +
- +// Enable the custom formatters feature
- +// This preference represents the user's choice to enable the custom formatters feature.
- +// While the preference above will be removed once the feature is stable, this one is menat to stay.
- +pref("devtools.custom-formatters.enabled", false);
- +
- +// The default Network Monitor UI settings
- +pref("devtools.netmonitor.panes-network-details-width", 550);
- +pref("devtools.netmonitor.panes-network-details-height", 450);
- +pref("devtools.netmonitor.panes-search-width", 550);
- +pref("devtools.netmonitor.panes-search-height", 450);
- +pref("devtools.netmonitor.filters", "[\"all\"]");
- +pref("devtools.netmonitor.visibleColumns",
- + "[\"status\",\"method\",\"domain\",\"file\",\"initiator\",\"type\",\"transferred\",\"contentSize\",\"waterfall\"]"
- +);
- +pref("devtools.netmonitor.columnsData",
- + '[{"name":"status","minWidth":30,"width":5}, {"name":"method","minWidth":30,"width":5}, {"name":"domain","minWidth":30,"width":10}, {"name":"file","minWidth":30,"width":25}, {"name":"url","minWidth":30,"width":25},{"name":"initiator","minWidth":30,"width":10},{"name":"type","minWidth":30,"width":5},{"name":"transferred","minWidth":30,"width":10},{"name":"contentSize","minWidth":30,"width":5},{"name":"waterfall","minWidth":150,"width":15}]');
- +pref("devtools.netmonitor.msg.payload-preview-height", 128);
- +pref("devtools.netmonitor.msg.visibleColumns",
- + '["data", "time"]'
- +);
- +pref("devtools.netmonitor.msg.displayed-messages.limit", 500);
- +
- +pref("devtools.netmonitor.response.ui.limit", 10240);
- +
- +// Save request/response bodies yes/no.
- +pref("devtools.netmonitor.saveRequestAndResponseBodies", true);
- +
- +// The default Network monitor HAR export setting
- +pref("devtools.netmonitor.har.defaultLogDir", "");
- +pref("devtools.netmonitor.har.defaultFileName", "%hostname_Archive [%date]");
- +pref("devtools.netmonitor.har.jsonp", false);
- +pref("devtools.netmonitor.har.jsonpCallback", "");
- +pref("devtools.netmonitor.har.includeResponseBodies", true);
- +pref("devtools.netmonitor.har.compress", false);
- +pref("devtools.netmonitor.har.forceExport", false);
- +pref("devtools.netmonitor.har.pageLoadedTimeout", 1500);
- +pref("devtools.netmonitor.har.enableAutoExportToFile", false);
- +
- +pref("devtools.netmonitor.features.webSockets", true);
- +
- +// netmonitor audit
- +pref("devtools.netmonitor.audits.slow", 500);
- +
- +// Disable the EventSource Inspector.
- +pref("devtools.netmonitor.features.serverSentEvents", false);
- +
- +// Enable the Storage Inspector
- +pref("devtools.storage.enabled", true);
- +
- +// Enable the Style Editor.
- +pref("devtools.styleeditor.enabled", true);
- +pref("devtools.styleeditor.autocompletion-enabled", true);
- +pref("devtools.styleeditor.showMediaSidebar", true);
- +pref("devtools.styleeditor.mediaSidebarWidth", 238);
- +pref("devtools.styleeditor.navSidebarWidth", 245);
- +pref("devtools.styleeditor.transitions", true);
- +
- +// Screenshot Option Settings.
- +pref("devtools.screenshot.clipboard.enabled", false);
- +pref("devtools.screenshot.audio.enabled", true);
- +
- +// Make sure the DOM panel is hidden by default
- +pref("devtools.dom.enabled", false);
- +
- +// Enable the Accessibility panel.
- +pref("devtools.accessibility.enabled", true);
- +
- +// Web console filters
- +pref("devtools.webconsole.filter.error", true);
- +pref("devtools.webconsole.filter.warn", true);
- +pref("devtools.webconsole.filter.info", true);
- +pref("devtools.webconsole.filter.log", true);
- +pref("devtools.webconsole.filter.debug", true);
- +pref("devtools.webconsole.filter.css", false);
- +pref("devtools.webconsole.filter.net", false);
- +pref("devtools.webconsole.filter.netxhr", false);
- +
- +// Webconsole autocomplete preference
- +pref("devtools.webconsole.input.autocomplete",true);
- + pref("devtools.webconsole.input.context", false);
- +
- +// Set to true to eagerly show the results of webconsole terminal evaluations
- +// when they don't have side effects.
- +pref("devtools.webconsole.input.eagerEvaluation", true);
- +
- +// Browser console filters
- +pref("devtools.browserconsole.filter.error", true);
- +pref("devtools.browserconsole.filter.warn", true);
- +pref("devtools.browserconsole.filter.info", true);
- +pref("devtools.browserconsole.filter.log", true);
- +pref("devtools.browserconsole.filter.debug", true);
- +pref("devtools.browserconsole.filter.css", false);
- +pref("devtools.browserconsole.filter.net", false);
- +pref("devtools.browserconsole.filter.netxhr", false);
- +
- +// Max number of inputs to store in web console history.
- +pref("devtools.webconsole.inputHistoryCount", 300);
- +
- +// Persistent logging: |true| if you want the relevant tool to keep all of the
- +// logged messages after reloading the page, |false| if you want the output to
- +// be cleared each time page navigation happens.
- +pref("devtools.webconsole.persistlog", false);
- +pref("devtools.netmonitor.persistlog", false);
- +
- +// Web Console timestamp: |true| if you want the logs and instructions
- +// in the Web Console to display a timestamp, or |false| to not display
- +// any timestamps.
- +pref("devtools.webconsole.timestampMessages", false);
- +
- +// Enable the webconsole sidebar toggle in Nightly builds.
- + pref("devtools.webconsole.sidebarToggle", false);
- +
- +// Saved editor mode state in the console.
- +pref("devtools.webconsole.input.editor", false);
- +pref("devtools.browserconsole.input.editor", false);
- +
- +// Editor width for webconsole and browserconsole.
- +pref("devtools.webconsole.input.editorWidth", 0);
- +pref("devtools.browserconsole.input.editorWidth", 0);
- +
- +// Display an onboarding UI for the Editor mode.
- +pref("devtools.webconsole.input.editorOnboarding", true);
- +
- +// Enable message grouping in the console, true by default
- +pref("devtools.webconsole.groupWarningMessages", true);
- +
- +// Saved state of the Display content messages checkbox in the browser console.
- +pref("devtools.browserconsole.contentMessages", true);
- +
- +// Enable network monitoring the browser toolbox console/browser console.
- +pref("devtools.browserconsole.enableNetworkMonitoring", false);
- +
- +// Enable client-side mapping service for source maps
- +pref("devtools.source-map.client-service.enabled", true);
- +
- +// The number of lines that are displayed in the web console.
- +pref("devtools.hud.loglimit", 10000);
- +
- +// The developer tools editor configuration:
- +// - tabsize: how many spaces to use when a Tab character is displayed.
- +// - expandtab: expand Tab characters to spaces.
- +// - keymap: which keymap to use (can be 'default', 'emacs' or 'vim')
- +// - autoclosebrackets: whether to permit automatic bracket/quote closing.
- +// - detectindentation: whether to detect the indentation from the file
- +// - enableCodeFolding: Whether to enable code folding or not.
- +pref("devtools.editor.tabsize", 2);
- +pref("devtools.editor.expandtab", true);
- +pref("devtools.editor.keymap", "default");
- +pref("devtools.editor.autoclosebrackets", true);
- +pref("devtools.editor.detectindentation", true);
- +pref("devtools.editor.enableCodeFolding", true);
- +pref("devtools.editor.autocomplete", true);
- +
- +// The angle of the viewport.
- +pref("devtools.responsive.viewport.angle", 0);
- +// The width of the viewport.
- +pref("devtools.responsive.viewport.width", 320);
- +// The height of the viewport.
- +pref("devtools.responsive.viewport.height", 480);
- +// The pixel ratio of the viewport.
- +pref("devtools.responsive.viewport.pixelRatio", 0);
- +// Whether or not the viewports are left aligned.
- +pref("devtools.responsive.leftAlignViewport.enabled", false);
- +// Whether to reload when touch simulation is toggled
- +pref("devtools.responsive.reloadConditions.touchSimulation", false);
- +// Whether to reload when user agent is changed
- +pref("devtools.responsive.reloadConditions.userAgent", false);
- +// Whether to show the notification about reloading to apply emulation
- +pref("devtools.responsive.reloadNotification.enabled", true);
- +// Whether or not touch simulation is enabled.
- +pref("devtools.responsive.touchSimulation.enabled", false);
- +// The user agent of the viewport.
- +pref("devtools.responsive.userAgent", "");
- +
- +// Show the custom user agent input in Nightly builds.
- +#if defined(NIGHTLY_BUILD)
- + pref("devtools.responsive.showUserAgentInput", true);
- +#else
- + pref("devtools.responsive.showUserAgentInput", false);
- +#endif
- +
- +// Show tab debug targets for This Firefox (on by default for local builds).
- + pref("devtools.aboutdebugging.local-tab-debugging", true);
- +
- +// Show process debug targets.
- +pref("devtools.aboutdebugging.process-debugging", true);
- +// Stringified array of network locations that users can connect to.
- +pref("devtools.aboutdebugging.network-locations", "[]");
- +// Debug target pane collapse/expand settings.
- +pref("devtools.aboutdebugging.collapsibilities.installedExtension", false);
- +pref("devtools.aboutdebugging.collapsibilities.otherWorker", false);
- +pref("devtools.aboutdebugging.collapsibilities.serviceWorker", false);
- +pref("devtools.aboutdebugging.collapsibilities.sharedWorker", false);
- +pref("devtools.aboutdebugging.collapsibilities.tab", false);
- +pref("devtools.aboutdebugging.collapsibilities.temporaryExtension", false);
- +
- +// about:debugging: only show system and hidden extensions in local builds by
- +// default.
- + pref("devtools.aboutdebugging.showHiddenAddons", true);
- +
- +// Map top-level await expressions in the console
- +pref("devtools.debugger.features.map-await-expression", true);
- +
- +// This relies on javascript.options.asyncstack as well or it has no effect.
- +pref("devtools.debugger.features.async-captured-stacks", true);
- +pref("devtools.debugger.features.async-live-stacks", false);
- +
- +// Disable autohide for DevTools popups and tooltips.
- +// This is currently not exposed by any UI to avoid making
- +// about:devtools-toolbox tabs unusable by mistake.
- +pref("devtools.popup.disable_autohide", false);
- +
- +// Enable overflow debugging in the inspector.
- +pref("devtools.overflow.debugging.enabled", true);
- +// Enable drag to edit properties in the inspector rule view.
- +pref("devtools.inspector.draggable_properties", true);
- diff --git a/suite/components/devtools/components.conf b/suite/components/devtools/components.conf
- new file mode 100644
- --- /dev/null
- +++ b/suite/components/devtools/components.conf
- @@ -0,0 +1,15 @@
- +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
- +# vim: set filetype=python:
- +# 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/.
- +
- +Classes = [
- + {
- + 'cid': '{089694e9-106a-4704-abf7-62a88545e194}',
- + 'contract_ids': ['@xulvolution.org/generic/devtools-startup-clh;1'],
- + 'esModule': 'resource:///modules/devtools-loader.sys.mjs',
- + 'constructor': 'DevToolsStartup',
- + 'categories': {'command-line-handler': 'm-aaa-xre-devtools'},
- + },
- +]
- diff --git a/suite/components/devtools/devtools-loader.sys.mjs b/suite/components/devtools/devtools-loader.sys.mjs
- new file mode 100644
- --- /dev/null
- +++ b/suite/components/devtools/devtools-loader.sys.mjs
- @@ -0,0 +1,118 @@
- +/* 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/. */
- +
- +const lazy = {};
- +ChromeUtils.defineESModuleGetters(lazy, {
- + NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
- +});
- +
- +function resolveURIInternal(aCmdLine, aArgument) {
- + var uri = aCmdLine.resolveURI(aArgument);
- +
- + if (!(uri instanceof Ci.nsIFileURL)) {
- + return uri;
- + }
- +
- + try {
- + if (uri.file.exists()) {
- + return uri;
- + }
- + } catch (e) {
- + console.error(e);
- + }
- +
- + // We have interpreted the argument as a relative file URI, but the file
- + // doesn't exist. Try URI fixup heuristics: see bug 290782.
- +
- + try {
- + uri = Services.uriFixup.getFixupURIInfo(aArgument, 0).preferredURI;
- + } catch (e) {
- + console.error(e);
- + }
- +
- + return uri;
- +}
- +
- +export function DevToolsStartup() {}
- +
- +DevToolsStartup.prototype = {
- + QueryInterface: ChromeUtils.generateQI(["nsICommandLineHandler"]),
- +
- + helpInfo: "",
- + handle(cmdLine) {
- + this.initialize();
- +
- + // We want to overwrite the -devtools flag and open the toolbox instead
- + const devtoolsFlag = cmdLine.handleFlag("devtools", false);
- + if (devtoolsFlag) {
- + this.handleDevToolsFlag(cmdLine);
- + }
- +
- + var chromeFlag = cmdLine.handleFlagWithParam("chrome", false);
- + if (chromeFlag) {
- + // The parameter specifies the window to open.
- + this.handleChromeFlag(cmdLine, chromeFlag);
- + }
- + },
- +
- + handleDevToolsFlag(cmdLine) {
- + const { BrowserToolboxLauncher } = ChromeUtils.importESModule(
- + "resource://devtools/client/framework/browser-toolbox/Launcher.sys.mjs"
- + );
- + BrowserToolboxLauncher.init();
- +
- + if (cmdLine.state == Ci.nsICommandLine.STATE_REMOTE_AUTO) {
- + cmdLine.preventDefault = true;
- + }
- + },
- +
- + handleChromeFlag(cmdLine, chromeParam) {
- + try {
- + const argstring = Cc["@mozilla.org/supports-string;1"].createInstance(
- + Ci.nsISupportsString
- + );
- +
- + const _uri = resolveURIInternal(cmdLine, chromeParam);
- +
- + // only load URIs which do not inherit chrome privs
- + if (!Services.io.URIChainHasFlags(_uri, Ci.nsIProtocolHandler.URI_INHERITS_SECURITY_CONTEXT)) {
- + Services.ww.openWindow(null, _uri.spec, "_blank", "chrome,dialog=no,all", argstring);
- + cmdLine.preventDefault = true;
- + }
- + } catch (e) { dump(e); }
- + },
- +
- + initialize() {
- + const { loader, require, DevToolsLoader } = ChromeUtils.importESModule(
- + "resource://devtools/shared/loader/Loader.sys.mjs"
- + );
- + const { DevToolsServer } = require("devtools/server/devtools-server");
- + const { gDevTools } = require("devtools/client/framework/devtools");
- +
- + // Make sure our root actor is always registered, no matter how devtools are called.
- + const devtoolsRegisterActors =
- + DevToolsServer.registerActors.bind(DevToolsServer);
- + DevToolsServer.registerActors = function (options) {
- + devtoolsRegisterActors(options);
- + if (options.root) {
- + const {
- + createRootActor,
- + } = require("resource:///modules/devtools-root-actor.js");
- + DevToolsServer.setRootActor(createRootActor);
- + }
- + };
- +
- + // Make the loader visible to the debugger by default and for the already
- + // loaded instance. Thunderbird now also provides the Browser Toolbox for
- + // chrome debugging, which uses its own separate loader instance.
- + DevToolsLoader.prototype.invisibleToDebugger = false;
- + loader.invisibleToDebugger = false;
- + DevToolsServer.allowChromeProcess = true;
- +
- + // Initialize and load the toolkit/browser actors. This will also call above function to set the
- + // Thunderbird root actor
- + DevToolsServer.init();
- + DevToolsServer.registerAllActors();
- + },
- +};
- diff --git a/suite/components/devtools/devtools-root-actor.js b/suite/components/devtools/devtools-root-actor.js
- new file mode 100644
- --- /dev/null
- +++ b/suite/components/devtools/devtools-root-actor.js
- @@ -0,0 +1,67 @@
- +/* 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/. */
- +
- +/* globals loader, require, exports */
- +
- +/**
- + * Actors for Developer Tools.
- + */
- +
- +var { ActorRegistry } = require("devtools/server/actors/utils/actor-registry");
- +
- +loader.lazyRequireGetter(
- + this,
- + "RootActor",
- + "devtools/server/actors/root",
- + true
- +);
- +loader.lazyRequireGetter(
- + this,
- + "sendShutdownEvent",
- + "devtools/server/actors/webbrowser",
- + true
- +);
- +loader.lazyRequireGetter(
- + this,
- + "WorkerDescriptorActorList",
- + "devtools/server/actors/worker/worker-descriptor-actor-list",
- + true
- +);
- +loader.lazyRequireGetter(
- + this,
- + "ServiceWorkerRegistrationActorList",
- + "devtools/server/actors/worker/service-worker-registration-list",
- + true
- +);
- +loader.lazyRequireGetter(
- + this,
- + "ProcessActorList",
- + "devtools/server/actors/process",
- + true
- +);
- +
- +/**
- + * Create the basic root actor for any XRE Application.
- + *
- + * @param aConnection The debugger connection to create the actor for.
- + * @returns The actor for the connection.
- + */
- +exports.createRootActor = function (aConnection) {
- + const parameters = {
- + workerList: new WorkerDescriptorActorList(aConnection, {}),
- + serviceWorkerRegistrationList: new ServiceWorkerRegistrationActorList(
- + aConnection
- + ),
- + processList: new ProcessActorList(),
- + globalActorFactories: ActorRegistry.globalActorFactories,
- + onShutdown: sendShutdownEvent,
- + };
- +
- + // Create the root actor and set the application type
- + const rootActor = new RootActor(aConnection, parameters);
- + rootActor.applicationType = "generic";
- +
- + return rootActor;
- +};
- +
- diff --git a/suite/components/devtools/moz.build b/suite/components/devtools/moz.build
- new file mode 100644
- --- /dev/null
- +++ b/suite/components/devtools/moz.build
- @@ -0,0 +1,15 @@
- +# vim: set filetype=python:
- +# 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/.
- +
- +EXTRA_JS_MODULES += [
- + "devtools-loader.sys.mjs",
- + "devtools-root-actor.js",
- +]
- +
- +XPCOM_MANIFESTS += [
- + "components.conf",
- +]
- +
- +JS_PREFERENCE_FILES += ['all-devtools.js']
- diff --git a/suite/components/moz.build b/suite/components/moz.build
- --- a/suite/components/moz.build
- +++ b/suite/components/moz.build
- @@ -4,16 +4,17 @@
- # 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/.
-
- DIRS += [
- "autocomplete",
- "bindings",
- "console",
- "dataman",
- + "devtools",
- "downloads",
- "feeds",
- "helpviewer",
- "migration",
- "permissions",
- "places",
- "pref",
- "profile",
|