fix: properly generate requestID in webContents.printToPDF() (#20769)
This commit is contained in:
parent
b6246dcf12
commit
bd5a5b3ae6
2 changed files with 17 additions and 2 deletions
|
@ -71,7 +71,6 @@ const defaultPrintingSetting = {
|
|||
headerFooterEnabled: false,
|
||||
marginsType: 0,
|
||||
isFirstRequest: false,
|
||||
requestID: getNextId(),
|
||||
previewUIID: 0,
|
||||
previewModifiable: true,
|
||||
printToPDF: true,
|
||||
|
@ -204,7 +203,10 @@ WebContents.prototype.executeJavaScript = function (code, hasUserGesture) {
|
|||
|
||||
// Translate the options of printToPDF.
|
||||
WebContents.prototype.printToPDF = function (options) {
|
||||
const printingSetting = Object.assign({}, defaultPrintingSetting)
|
||||
const printingSetting = {
|
||||
...defaultPrintingSetting,
|
||||
requestID: getNextId()
|
||||
}
|
||||
if (options.landscape) {
|
||||
printingSetting.landscape = options.landscape
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue