fix: crash in window.print() (#19690)

* fix: crash in window.print()

* add preliminary tests
This commit is contained in:
Shelley Vohr 2019-08-12 23:44:14 -07:00 committed by GitHub
parent ba5ee79af8
commit e8fa248571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 15 deletions

View file

@ -1271,11 +1271,7 @@ Returns [`PrinterInfo[]`](structures/printer-info.md).
* `failureReason` String - Called back if the print fails; can be `cancelled` or `failed`.
Prints window's web page. When `silent` is set to `true`, Electron will pick
the system's default printer if `deviceName` is empty and the default settings
for printing.
Calling `window.print()` in web page is equivalent to calling
`webContents.print({ silent: false, printBackground: false, deviceName: '' })`.
the system's default printer if `deviceName` is empty and the default settings for printing.
Use `page-break-before: always;` CSS style to force to print to a new page.