From b077402f2c3ddd123c8348dcc73b9d85d41ed47a Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 10:15:20 +0200 Subject: [PATCH] fix: allow docking DevTools with WCO (#35763) fix: allow for docking devtools with WCO Co-authored-by: Shelley Vohr --- shell/browser/api/electron_api_web_contents.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index bae673e664e7b..4d167d9c675bf 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -2428,14 +2428,6 @@ void WebContents::OpenDevTools(gin::Arguments* args) { !owner_window()) { state = "detach"; } - bool activate = true; - if (args && args->Length() == 1) { - gin_helper::Dictionary options; - if (args->GetNext(&options)) { - options.Get("mode", &state); - options.Get("activate", &activate); - } - } #if BUILDFLAG(IS_WIN) auto* win = static_cast(owner_window()); @@ -2445,6 +2437,15 @@ void WebContents::OpenDevTools(gin::Arguments* args) { state = "detach"; #endif + bool activate = true; + if (args && args->Length() == 1) { + gin_helper::Dictionary options; + if (args->GetNext(&options)) { + options.Get("mode", &state); + options.Get("activate", &activate); + } + } + DCHECK(inspectable_web_contents_); inspectable_web_contents_->SetDockState(state); inspectable_web_contents_->ShowDevTools(activate);