feat: WebContents.focusedFrame (#45667)

feat: webContents.focusedFrame
This commit is contained in:
Sam Maddock 2025-03-04 11:38:58 -05:00 committed by GitHub
parent 54136042c6
commit 8c11764800
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 44 additions and 1 deletions

View file

@ -3751,6 +3751,10 @@ content::RenderFrameHost* WebContents::Opener() {
return web_contents()->GetOpener();
}
content::RenderFrameHost* WebContents::FocusedFrame() {
return web_contents()->GetFocusedFrame();
}
void WebContents::NotifyUserActivation() {
content::RenderFrameHost* frame = web_contents()->GetPrimaryMainFrame();
if (frame)
@ -4462,6 +4466,7 @@ void WebContents::FillObjectTemplate(v8::Isolate* isolate,
.SetProperty("debugger", &WebContents::Debugger)
.SetProperty("mainFrame", &WebContents::MainFrame)
.SetProperty("opener", &WebContents::Opener)
.SetProperty("focusedFrame", &WebContents::FocusedFrame)
.SetMethod("_setOwnerWindow", &WebContents::SetOwnerBaseWindow)
.Build();
}