feat: add 'dom-ready' event to WebFrameMain (#29290)

This commit is contained in:
Samuel Maddock 2021-09-01 18:21:15 -04:00 committed by GitHub
parent 49e62f1261
commit 4d89174b41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 261 additions and 11 deletions

View file

@ -134,7 +134,7 @@ Returns:
* `event` Event
Emitted when the document in the given frame is loaded.
Emitted when the document in the top-level frame is loaded.
#### Event: 'page-title-updated'
@ -876,6 +876,16 @@ Emitted when the `WebContents` preferred size has changed.
This event will only be emitted when `enablePreferredSizeMode` is set to `true`
in `webPreferences`.
#### Event: 'frame-created'
Returns:
* `event` Event
* `details` Object
* `frame` WebFrameMain
Emitted when the [mainFrame](web-contents.md#contentsmainframe-readonly), an `<iframe>`, or a nested `<iframe>` is loaded within the page.
### Instance Methods
#### `contents.loadURL(url[, options])`
@ -2012,11 +2022,6 @@ when the DevTools has been closed.
A [`Debugger`](debugger.md) instance for this webContents.
[keyboardevent]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
[`postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
#### `contents.backgroundThrottling`
A `Boolean` property that determines whether or not this WebContents will throttle animations and timers
@ -2025,3 +2030,8 @@ when the page becomes backgrounded. This also affects the Page Visibility API.
#### `contents.mainFrame` _Readonly_
A [`WebFrameMain`](web-frame-main.md) property that represents the top frame of the page's frame hierarchy.
[keyboardevent]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
[`postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage

View file

@ -71,6 +71,12 @@ or `undefined` if there is no WebFrameMain associated with the given IDs.
Process: [Main](../glossary.md#main-process)<br />
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
### Instance Events
#### Event: 'dom-ready'
Emitted when the document is loaded.
### Instance Methods
#### `frame.executeJavaScript(code[, userGesture])`