diff --git a/docs/api/app.md b/docs/api/app.md index 7252b5b355704..2043548310f9d 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -493,7 +493,7 @@ Returns: * `webContents` [WebContents](web-contents.md) * `guestWebContents` [WebContents](web-contents.md) -Emitted when `.getWebContents()` is called in the renderer process of `webContents`. +Emitted when `remote.getGuestWebContents()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the object from being returned. Custom value can be returned by setting `event.returnValue`. diff --git a/docs/api/breaking-changes.md b/docs/api/breaking-changes.md index 8e945438548d8..0ceac93e2ab84 100644 --- a/docs/api/breaking-changes.md +++ b/docs/api/breaking-changes.md @@ -6,6 +6,18 @@ Breaking changes will be documented here, and deprecation warnings added to JS c The `FIXME` string is used in code comments to denote things that should be fixed for future releases. See https://github.com/electron/electron/search?q=fixme +## Planned Breaking API Changes (9.0) + +### `.getWebContents()` + +```js +// Deprecated +webview.getWebContents() +// Replace with +const { remote } = require('electron') +remote.getGuestWebContents(webview.getWebContentsId()) +``` + ## Planned Breaking API Changes (8.0) ### Values sent over IPC are now serialized with Structured Clone Algorithm diff --git a/docs/api/remote.md b/docs/api/remote.md index e49e738ffb176..c9795ad474987 100644 --- a/docs/api/remote.md +++ b/docs/api/remote.md @@ -188,7 +188,15 @@ consequences. ### `remote.getCurrentWebContents()` -Returns [`WebContents`](web-contents.md) - The web contents of this web page. +Returns [`WebContents`](web-contents.md) - The WebContents of this web page. + +### `remote.getGuestWebContents(webContentsId)` + +* `webContentsId` Number + +Returns [`WebContents`](web-contents.md) - The WebContents of a `` with `webContentsId`. + +**Note:** You can only get a ``, which is hosted in the callers `webContents`. ### `remote.getGlobal(name)` diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index ec335b061f73c..7d02c7e8f38ca 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -806,7 +806,7 @@ Returns: * `event` IpcMainEvent * `guestWebContents` [WebContents](web-contents.md) -Emitted when `.getWebContents()` is called in the renderer process. +Emitted when `remote.getGuestWebContents()` is called in the renderer process. Calling `event.preventDefault()` will prevent the object from being returned. Custom value can be returned by setting `event.returnValue`. @@ -1390,11 +1390,13 @@ An example of showing devtools in a `` tag: diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index ed78287199aba..00af0baaed8e6 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -648,9 +648,9 @@ Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. Shows pop-up dictionary that searches the selected word on the page. -### `.getWebContents()` +### `.getWebContents()` _Deprecated_ -Returns [`WebContents`](web-contents.md) - The web contents associated with +Returns [`WebContents`](web-contents.md) - The WebContents associated with this `webview`. It depends on the [`remote`](remote.md) module,