edabg / jsprintsetup

JSPrintSetup Firefox addon
Mozilla Public License 2.0
76 stars 39 forks source link

Printer selection does not work on Windows 10 / Firefox 52 #42

Open carlobonamico opened 7 years ago

carlobonamico commented 7 years ago

While testing this sample application (http://plnkr.co/edit/Y6474P2xKhQxcbH4lJe7?p=preview), which

I noticed that on Ubuntu 16.04 LTS / Firefox 52 and Windows 7 / Firefox 47 it works correctly. On Windows 10 / Firefox 52 the application seems to work correctly in the sense that it displays the newly selected default printer, but when starting to print (e.g. with Ctrl + P on the page) the print display still selects the previous default printer.

hidden4003 commented 6 years ago

Documentation clearly states that void print();

Prints content of most recent browser window to currently selected printer with current settings like window.print method. The difference between window.print() and jsPrintSetup.print() is that window.print() prints using settings saved in user preferences, while jsPrintSetup.print() print with current printer settings stored in jsPrintSetup.

Thus pressing Ctrl+P shows you user preferences, not the jsPrintSetup preferences.

After looking at your code I see that you are using window.print(), you must use jsPrintSetup.print() or jsPrintSetup.printWindow() otherwise you can't use silentPrint and printer select and all the other options, window.print() is stock browser print dialog.