mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: allow docking DevTools with WCO (#35765)
fix: allow for docking devtools with WCO Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -2410,14 +2410,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());
|
||||
@@ -2427,6 +2419,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);
|
||||
|
||||
Reference in New Issue
Block a user