fix: prefill native print dialog options on macOS with OOP printing#50643
Merged
Conversation
Chromium enabled out-of-process (OOP) printing by default on macOS in https://chromium-review.googlesource.com/c/chromium/src/+/6032774. This broke webContents.print() option prefilling (e.g. copies, collate, duplex) in two ways: 1. ScriptedPrint() silently aborted because RegisterSystemPrintClient() was only called from GetDefaultPrintSettings(), but Electron's flow calls UpdatePrintSettings() instead when options are provided. 2. PrinterQueryOop::UpdatePrintSettings() sends settings to the remote PrintBackend service, but on macOS the native dialog runs in-browser using the local PrintingContextMac::print_info_, which was never updated with the user's requested settings. Fix by registering the system print client in UpdatePrintSettings() and applying cached settings to the local printing context before showing the in-browser system print dialog. Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
4 tasks
codebytere
approved these changes
Apr 2, 2026
|
Release Notes Persisted
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #50600
See that PR for details.
Notes: Fixed an issue where custom options in
webContents.print()did not prefill the print dialog on macOS.