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

fix: check printer list when no default printers #25515

Merged
merged 1 commit into from Sep 21, 2020
Merged

Conversation

codebytere
Copy link
Member

Description of Change

Closes #25498.

It's possible for it to be the case on some operating systems that no default is selected, yet valid printers are available. In this case, we should check for available printers and default to the first available printer of those available on the system. Chromium will fail to print if no device name is provided at all, so this reduces the number of potential failure cases.

Tested with https://gist.github.com/35c5067af8ec104f86bd0cdd4a95b1f5

cc @jkleinsc @deepak1556 @zcbenz

Checklist

Release Notes

Notes: Fixed an issue where an error would be displayed when using webContents.print() if no default was set and no device name provided.

@electron-cation electron-cation bot added new-pr 🌱 PR opened in the last 24 hours and removed new-pr 🌱 PR opened in the last 24 hours labels Sep 17, 2020
@codebytere
Copy link
Member Author

Only failure is arm64 which is unrelated and caused by a CircleCI image upgrade.

@codebytere codebytere merged commit 15c30c5 into master Sep 21, 2020
@release-clerk
Copy link

release-clerk bot commented Sep 21, 2020

Release Notes Persisted

Fixed an issue where an error would be displayed when using webContents.print() if no default was set and no device name provided.

@codebytere codebytere deleted the check-printer-list branch September 21, 2020 20:42
@trop
Copy link
Contributor

trop bot commented Sep 21, 2020

I was unable to backport this PR to "10-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot removed the target/10-x-y label Sep 21, 2020
@trop
Copy link
Contributor

trop bot commented Sep 21, 2020

I was unable to backport this PR to "9-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Sep 21, 2020

I have automatically backported this PR to "11-x-y", please check out #25562

@trop
Copy link
Contributor

trop bot commented Sep 23, 2020

@codebytere has manually backported this PR to "10-x-y", please check out #25606

@trop
Copy link
Contributor

trop bot commented Sep 23, 2020

@codebytere has manually backported this PR to "9-x-y", please check out #25607

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

Successfully merging this pull request may close these issues.

webContents.print() fails with 'No valid printers available'
2 participants