Skip to content

Commit

Permalink
fix: allow docking DevTools with WCO (#35754)
Browse files Browse the repository at this point in the history
fix: allow for docking devtools with WCO
  • Loading branch information
codebytere committed Sep 22, 2022
1 parent 4ffdd28 commit eb3262c
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 @@ -2424,14 +2424,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 @@ -2441,6 +2433,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 eb3262c

Please sign in to comment.