feat: add WebFrameMain.visibilityState (#28706)

* feat: add WebFrameMain.visibilityState

* docs: mention other page visibility APIs

* test: delay visibilityState check after hiding

* test: add waitForTrue to avoid flaky visibilityState test

* refactor: waitForTrue -> waitUntil
This commit is contained in:
Samuel Maddock 2021-04-22 12:00:58 -04:00 committed by GitHub
parent 93311c8686
commit 43d27cc4d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 98 additions and 0 deletions

View file

@ -182,3 +182,9 @@ This is not the same as the OS process ID; to read that use `frame.osProcessId`.
An `Integer` representing the unique frame id in the current renderer process.
Distinct `WebFrameMain` instances that refer to the same underlying frame will
have the same `routingId`.
#### `frame.visibilityState` _Readonly_
A `string` representing the [visibility state](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState) of the frame.
See also how the [Page Visibility API](browser-window.md#page-visibility) is affected by other Electron APIs.