feat: add activate option to webContents.openDevTools (#13852)

This commit is contained in:
Milan Burda 2018-11-27 10:34:44 +01:00 committed by Cheng Zhao
parent aafbd865bf
commit d63a848011
13 changed files with 63 additions and 32 deletions

View file

@ -1307,14 +1307,16 @@ void WebContents::OpenDevTools(mate::Arguments* args) {
if (type_ == WEB_VIEW || !owner_window()) {
state = "detach";
}
bool activate = true;
if (args && args->Length() == 1) {
mate::Dictionary options;
if (args->GetNext(&options)) {
options.Get("mode", &state);
options.Get("activate", &activate);
}
}
managed_web_contents()->SetDockState(state);
managed_web_contents()->ShowDevTools();
managed_web_contents()->ShowDevTools(activate);
}
void WebContents::CloseDevTools() {