Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window.getPrinters() returns a single printer object instead an Array of printers #6667

Closed
ddcovery opened this issue Jun 4, 2018 · 1 comment

Comments

@ddcovery
Copy link

ddcovery commented Jun 4, 2018

NWJS Version : 0.31
Operating System : Windows 7 (32 bits)

Expected behavior

Callback function must receive an array of json objects representing the available printers

Actual behavior

Callback function receives an unique object (1 printer) not an array of printers json objects.

How to reproduce

This code must work: enumerate printers and outputs to console the printer name.

win.getPrinters( function(printers){

  printers.map(printer=>console.log("Printer is", printer.printerName));

});

But a "printers.map is not a function" error is raised because "printers" is not an array.

@rogerwang
Copy link
Member

Thanks for reporting. This is #6663 which was just fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants