Bug 1469341 - Remove the XUL wrapper document for the Browser Console;r=nchevobbe
MozReview-Commit-ID: KCZ6u5byQuO
--- a/devtools/client/jar.mn
+++ b/devtools/client/jar.mn
@@ -4,17 +4,16 @@
devtools.jar:
% content devtools %content/
content/shared/vendor/d3.js (shared/vendor/d3.js)
content/shared/vendor/dagre-d3.js (shared/vendor/dagre-d3.js)
content/shared/widgets/widgets.css (shared/widgets/widgets.css)
content/shared/widgets/VariablesView.xul (shared/widgets/VariablesView.xul)
content/webconsole/index.html (webconsole/index.html)
- content/webconsole/browserconsole.xul (webconsole/browserconsole.xul)
* content/scratchpad/index.xul (scratchpad/index.xul)
content/shared/splitview.css (shared/splitview.css)
content/shared/theme-switching.js (shared/theme-switching.js)
* content/styleeditor/index.xul (styleeditor/index.xul)
* content/storage/index.xul (storage/index.xul)
content/inspector/markup/markup.xhtml (inspector/markup/markup.xhtml)
content/inspector/animation-old/animation-controller.js (inspector/animation-old/animation-controller.js)
content/inspector/animation-old/animation-panel.js (inspector/animation-old/animation-panel.js)
--- a/devtools/client/preferences/devtools-client.js
+++ b/devtools/client/preferences/devtools-client.js
@@ -228,19 +228,16 @@ pref("devtools.scratchpad.enabled", fals
pref("devtools.dom.enabled", false);
// Make sure the Accessibility panel is hidden by default
pref("devtools.accessibility.enabled", false);
// Web Audio Editor Inspector Width should be a preference
pref("devtools.webaudioeditor.inspectorWidth", 300);
-// Experimental UI for the browser console that doesn't use a XUL wrapper doc
-pref("devtools.browserconsole.html", false);
-
// 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);
deleted file mode 100644
--- a/devtools/client/webconsole/browserconsole.xul
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- 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/. -->
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- id="devtools-webconsole"
- macanimationtype="document"
- fullscreenbutton="true"
- title=""
- windowtype="devtools:webconsole"
- width="900" height="350"
- persist="screenX screenY width height sizemode">
- <link rel="localization" href="toolkit/main-window/editmenu.ftl"/>
- <script type="text/javascript" src="chrome://global/content/l10n.js"></script>
- <popupset></popupset>
- <iframe src="index.html" flex="1"></iframe>
-</window>
--- a/devtools/client/webconsole/components/JSTerm.js
+++ b/devtools/client/webconsole/components/JSTerm.js
@@ -1470,18 +1470,17 @@ class JSTerm extends Component {
.paddingLeft.replace(/[^0-9.]/g, "") - 4;
}
onContextMenu(e) {
// The toolbox does it's own edit menu handling with
// toolbox-textbox-context-popup and friends. For now, fall
// back to use that if running inside the toolbox, but use our
// own menu when running in the Browser Console (see Bug 1476097).
- if (this.props.hud.isBrowserConsole &&
- Services.prefs.getBoolPref("devtools.browserconsole.html")) {
+ if (this.props.hud.isBrowserConsole) {
this.props.serviceContainer.openEditContextMenu(e);
}
}
destroy() {
this.clearCompletion();
this.webConsoleClient.clearNetworkRequests();
--- a/devtools/client/webconsole/hudservice.js
+++ b/devtools/client/webconsole/hudservice.js
@@ -170,37 +170,26 @@ HUDService.prototype = {
const client = new DebuggerClient(DebuggerServer.connectPipe());
await client.connect();
const response = await client.getProcess();
return { form: response.form, client, chrome: true, isBrowsingContext: true };
}
async function openWindow(t) {
- const win = Services.ww.openWindow(null, Tools.webConsole.browserConsoleURL,
+ const win = Services.ww.openWindow(null, Tools.webConsole.url,
"_blank", BC_WINDOW_FEATURES, null);
- let iframeWindow = win;
await new Promise(resolve => {
win.addEventListener("DOMContentLoaded", resolve, {once: true});
});
win.document.title = l10n.getStr("browserConsole.title");
- // With a XUL wrapper doc, we host index.html in an iframe.
- // Wait for that to be ready before resolving:
- if (!Tools.webConsole.browserConsoleUsesHTML) {
- const iframe = win.document.querySelector("iframe");
- await new Promise(resolve => {
- iframe.addEventListener("DOMContentLoaded", resolve, {once: true});
- });
- iframeWindow = iframe.contentWindow;
- }
-
- return {iframeWindow, chromeWindow: win};
+ return {iframeWindow: win, chromeWindow: win};
}
// Temporarily cache the async startup sequence so that if toggleBrowserConsole
// gets called again we can return this console instead of opening another one.
this._browserConsoleInitializing = (async () => {
const connection = await connect();
const target = await TargetFactory.forRemoteTab(connection);
const {iframeWindow, chromeWindow} = await openWindow(target);
--- a/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js
+++ b/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js
@@ -6,18 +6,17 @@
// Check that we display the expected context menu entries.
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/mochitest/test-console.html";
add_task(async function() {
// Enable net messages in the console for this test.
await pushPref("devtools.browserconsole.filter.net", true);
- // These are required for testing the text input in the browser console:
- await pushPref("devtools.browserconsole.html", true);
+ // This is required for testing the text input in the browser console:
await pushPref("devtools.chrome.enabled", true);
await addTab(TEST_URI);
const hud = await HUDService.toggleBrowserConsole();
info("Reload the content window to produce a network log");
const onNetworkMessage = waitForMessage(hud, "test-console.html");
ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
--- a/devtools/client/webconsole/test/mochitest/browser_console_open_or_focus.js
+++ b/devtools/client/webconsole/test/mochitest/browser_console_open_or_focus.js
@@ -22,19 +22,19 @@ add_task(async function() {
ok(hud.ui.document.hasFocus(), "Focus in the document");
console.log(TEST_MESSAGE);
await waitFor(() => findMessage(hud, TEST_MESSAGE));
currWindow = Services.wm.getMostRecentWindow(null);
- is(currWindow.document.documentURI, Tools.webConsole.browserConsoleURL,
+ is(currWindow.document.documentURI, Tools.webConsole.url,
"The Browser Console is open and has focus");
mainWindow.focus();
await HUDService.openBrowserConsoleOrFocus();
currWindow = Services.wm.getMostRecentWindow(null);
- is(currWindow.document.documentURI, Tools.webConsole.browserConsoleURL,
+ is(currWindow.document.documentURI, Tools.webConsole.url,
"The Browser Console is open and has focus");
await HUDService.toggleBrowserConsole();
hud = HUDService.getBrowserConsole();
ok(!hud, "Browser Console has been closed");
});