feat: add webContents.getPrintersAsync()
(#31023)
This deprecates the synchronous and blocking `webContents.getPrinters()` function and introduces `webContents.getPrintersAsync()`, which is asynchronous and non-blocking. Signed-off-by: Darshan Sen <darshan.sen@postman.com>
This commit is contained in:
parent
b936f5e14a
commit
8f51d3e1bf
5 changed files with 70 additions and 4 deletions
|
@ -1369,12 +1369,20 @@ Decrease the capturer count by one. The page will be set to hidden or occluded s
|
|||
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()`
|
||||
#### `contents.getPrinters()` _Deprecated_
|
||||
|
||||
Get the system printer list.
|
||||
|
||||
Returns [`PrinterInfo[]`](structures/printer-info.md)
|
||||
|
||||
**Deprecated:** Should use the new [`contents.getPrintersAsync`](web-contents.md#contentsgetprintersasync) API.
|
||||
|
||||
#### `contents.getPrintersAsync()`
|
||||
|
||||
Get the system printer list.
|
||||
|
||||
Returns `Promise<PrinterInfo[]>` - Resolves with a [`PrinterInfo[]`](structures/printer-info.md)
|
||||
|
||||
#### `contents.print([options], [callback])`
|
||||
|
||||
* `options` Object (optional)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue