feat: deprecate <webview>.getWebContents() (#20726)

This commit is contained in:
Milan Burda 2019-11-07 18:43:19 +01:00 committed by Shelley Vohr
parent c716ecb916
commit f1e7393e30
4 changed files with 50 additions and 2 deletions

View file

@ -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()