feat: Exposing methods required by capturing a hidden webContents (#21679)
This commit is contained in:
parent
8103ded33e
commit
852b8693bd
3 changed files with 54 additions and 0 deletions
|
@ -1225,6 +1225,29 @@ Returns `Promise<NativeImage>` - Resolves with a [NativeImage](native-image.md)
|
|||
|
||||
Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page.
|
||||
|
||||
#### `contents.isBeingCaptured()`
|
||||
|
||||
Returns `Boolean` - Whether this page is being captured. It returns true when the capturer count
|
||||
is large then 0.
|
||||
|
||||
#### `contents.incrementCapturerCount([size, stayHidden])`
|
||||
|
||||
* `size` [Size](structures/size.md) (optional) - The perferred size for the capturer.
|
||||
* `stayHidden` Boolean (optional) - Keep the page hidden instead of visible.
|
||||
|
||||
Increase the capturer count by one. The page is considered visible when its browser window is
|
||||
hidden and the capturer count is non-zero. If you would like the page to stay hidden, you should ensure that `stayHidden` is set to true.
|
||||
|
||||
This also affects the Page Visibility API.
|
||||
|
||||
#### `contents.decrementCapturerCount([stayHidden])`
|
||||
|
||||
* `stayHidden` Boolean (optional) - Keep the page in hidden state instead of visible.
|
||||
|
||||
Decrease the capturer count by one. The page will be set to hidden or occluded state when its
|
||||
browser window is hidden or occluded and the capturer count reaches zero. If you want to
|
||||
decrease the hidden capturer count instead you should set `stayHidden` to true.
|
||||
|
||||
#### `contents.getPrinters()`
|
||||
|
||||
Get the system printer list.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue