mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix: webContents.print() ignoring mediaSize when silent PR #49523 moved the default media size fallback into OnGetDeviceNameToUse, but the new code unconditionally writes kSettingMediaSize — clobbering any mediaSize the caller had already set in WebContents::Print() from options.mediaSize / pageSize. As a result, silent prints with an explicit pageSize (e.g. "Letter") fell back to A4 with tiny content. Only populate the default/printer media size when the caller hasn't already supplied one, preserving the precedence: 1. user-supplied mediaSize / pageSize 2. printer default (when usePrinterDefaultPageSize is true) 3. A4 fallback