From 11600c5f96a95c91aa78ba40118b4f00d803e550 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 10 Aug 2023 02:50:30 -0700 Subject: [PATCH] chore: document deprecated webContents.getPrinters API (#39356) * chore: document deprecated webContents.getPrinters API * chore: remove duplicate deprecation warning --- docs/breaking-changes.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 4b473c158f0d..a0cbfc2e76c4 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -27,6 +27,24 @@ The `ipcRenderer.sendTo()` API has been deprecated. It should be replaced by set The `senderId` and `senderIsMainFrame` properties of `IpcRendererEvent` have been deprecated as well. +## Planned Breaking API Changes (26.0) + +### Deprecated: `webContents.getPrinters` + +The `webContents.getPrinters` method has been deprecated. Use +`webContents.getPrintersAsync` instead. + +```js +const w = new BrowserWindow({ show: false }) + +// Deprecated +console.log(w.webContents.getPrinters()) +// Replace with +w.webContents.getPrintersAsync().then((printers) => { + console.log(printers) +}) +``` + ## Planned Breaking API Changes (25.0) ### Deprecated: `protocol.{register,intercept}{Buffer,String,Stream,File,Http}Protocol`