🐛 add isDevToolsFocused to WebContents to fix #3928, add devtools-[focused|open|close] events to WebView to fix #3783.
This commit is contained in:
parent
8aced2c31e
commit
96d68b9285
5 changed files with 16 additions and 0 deletions
|
@ -780,6 +780,13 @@ bool WebContents::IsDevToolsOpened() {
|
|||
return managed_web_contents()->IsDevToolsViewShowing();
|
||||
}
|
||||
|
||||
bool WebContents::IsDevToolsFocused() {
|
||||
if (type_ == REMOTE)
|
||||
return false;
|
||||
|
||||
return managed_web_contents()->GetView()->IsDevToolsViewFocused();
|
||||
}
|
||||
|
||||
void WebContents::EnableDeviceEmulation(
|
||||
const blink::WebDeviceEmulationParams& params) {
|
||||
if (type_ == REMOTE)
|
||||
|
@ -1080,6 +1087,7 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
|
|||
.SetMethod("openDevTools", &WebContents::OpenDevTools)
|
||||
.SetMethod("closeDevTools", &WebContents::CloseDevTools)
|
||||
.SetMethod("isDevToolsOpened", &WebContents::IsDevToolsOpened)
|
||||
.SetMethod("isDevToolsFocused", &WebContents::IsDevToolsFocused)
|
||||
.SetMethod("enableDeviceEmulation",
|
||||
&WebContents::EnableDeviceEmulation)
|
||||
.SetMethod("disableDeviceEmulation",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue