From 1674388028da8196e5980db8adc90cca85234214 Mon Sep 17 00:00:00 2001 From: Thomas Beverley Date: Mon, 25 Feb 2019 13:30:22 +0000 Subject: [PATCH] Fix webContents.print() (#17052) --- atom/browser/api/atom_api_web_contents.cc | 2 +- lib/browser/api/web-contents.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 26ee5608209..66fec8f57c9 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -1458,7 +1458,7 @@ bool WebContents::IsCurrentlyAudible() { #if BUILDFLAG(ENABLE_PRINTING) void WebContents::Print(mate::Arguments* args) { - bool silent, print_background = false; + bool silent = false, print_background = false; base::string16 device_name; mate::Dictionary options = mate::Dictionary::CreateEmpty(args->isolate()); base::DictionaryValue settings; diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js index 21eb6c9157f..1ab129552ce 100644 --- a/lib/browser/api/web-contents.js +++ b/lib/browser/api/web-contents.js @@ -313,7 +313,7 @@ WebContents.prototype.printToPDF = function (options) { WebContents.prototype.print = function (...args) { if (features.isPrintingEnabled()) { - this._print(args) + this._print(...args) } else { console.error('Error: Printing feature is disabled.') }