mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user