mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
feat: deprecate <webview>.getWebContents() (#20726)
This commit is contained in:
committed by
Shelley Vohr
parent
c716ecb916
commit
f1e7393e30
@@ -238,6 +238,12 @@ export const setupMethods = (WebViewElement: typeof ElectronInternal.WebViewElem
|
||||
return remote.getGuestWebContents(internal.guestInstanceId!)
|
||||
}
|
||||
|
||||
WebViewElement.prototype.getWebContents = electron.deprecate.moveAPI(
|
||||
WebViewElement.prototype.getWebContents,
|
||||
'webview.getWebContents()',
|
||||
'remote.webContents.fromId(webview.getWebContentsId())'
|
||||
) as any
|
||||
|
||||
// Focusing the webview should move page focus to the underlying iframe.
|
||||
WebViewElement.prototype.focus = function () {
|
||||
this.contentWindow.focus()
|
||||
|
||||
Reference in New Issue
Block a user