From 75b34d5fc7bf8ccab3c15310a9dcf6c1da7eb566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 26 Jul 2022 14:08:57 +0000 Subject: [PATCH] Bug 1781034 - Add a shortcut to open the browser toolbox to the layout debugger. r=layout-reviewers,devtools-reviewers,nchevobbe,dshin Depends on D152628 Differential Revision: https://phabricator.services.mozilla.com/D152629 --- .../tools/layout-debug/ui/content/layoutdebug.js | 14 ++++++++++++++ .../layout-debug/ui/content/layoutdebug.xhtml | 2 ++ 2 files changed, 16 insertions(+) diff --git a/layout/tools/layout-debug/ui/content/layoutdebug.js b/layout/tools/layout-debug/ui/content/layoutdebug.js index 077aa67e00c6..0f326362ad65 100644 --- a/layout/tools/layout-debug/ui/content/layoutdebug.js +++ b/layout/tools/layout-debug/ui/content/layoutdebug.js @@ -20,6 +20,16 @@ const { Preferences } = ChromeUtils.import( "resource://gre/modules/Preferences.jsm" ); +var { loader } = ChromeUtils.import( + "resource://devtools/shared/loader/Loader.jsm" +); + +loader.lazyImporter( + this, + "BrowserToolboxLauncher", + "resource://devtools/client/framework/browser-toolbox/Launcher.jsm" +); + const FEATURES = { paintDumping: "nglayout.debug.paint_dumping", invalidateDumping: "nglayout.debug.invalidate_dumping", @@ -101,6 +111,10 @@ class Debugger { this._sendMessage("setPagedMode", v); } + openDevTools() { + BrowserToolboxLauncher.init(); + } + async _sendMessage(name, arg) { await this._sendMessageTo(gBrowser.browsingContext, name, arg); } diff --git a/layout/tools/layout-debug/ui/content/layoutdebug.xhtml b/layout/tools/layout-debug/ui/content/layoutdebug.xhtml index fc6f26e81180..f25ee714e3b0 100644 --- a/layout/tools/layout-debug/ui/content/layoutdebug.xhtml +++ b/layout/tools/layout-debug/ui/content/layoutdebug.xhtml @@ -45,6 +45,7 @@ + @@ -56,6 +57,7 @@ +