Skip to content

Commit

Permalink
fix: allow docking DevTools with WCO (#35763)
Browse files Browse the repository at this point in the history
fix: allow for docking devtools with WCO

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Sep 26, 2022
1 parent 7f89857 commit b077402
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions shell/browser/api/electron_api_web_contents.cc
Expand Up @@ -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<NativeWindowViews*>(owner_window());
Expand All @@ -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);
Expand Down

0 comments on commit b077402

Please sign in to comment.