10000 fix: window.print() only working once by codebytere · Pull Request #21893 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: window.print() only working once #21893

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

Merged
merged 1 commit into from
Jan 27, 2020
Merged

Conversation

codebytere
Copy link
Member
@codebytere codebytere commented Jan 25, 2020

Description of Change

Fixes #21397.

We should be disconnecting from the current print job for window.print(), unlike for webContents.print(). This ensures that happens by gating the disconnect call with callback.is_null(); the callback member is only non-null for webContents.print().

Tested with https://gist.github.com/0f0e776b138452d6815ef4efc16aa0d1 for the following:

  • webContents.print() and window.print() do not crash
  • webContents.print() and window.print() can be called multiple times without failing
  • The DOM is responsive after webContents.print() or window.print() is called
  • Correct settings are sent to webContents.print() when it is not called in silent mode

cc @deepak1556 @nornagon @zcbenz

Checklist

Release Notes

Notes: Fixed an issue where window.print() only worked once on a single BrowserWindow.

@codebytere codebytere requested a review from a team as a code owner January 25, 2020 03:24
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jan 25, 2020
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jan 26, 2020
@codebytere codebytere force-pushed the fix-printing-only-once branch from 5e53cb8 to 2382b6f Compare January 27, 2020 17:04
Copy link
Member
@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codebytere codebytere merged commit c588658 into master Jan 27, 2020
@release-clerk
Copy link
release-clerk bot commented Jan 27, 2020

Release Notes Persisted

Fixed an issue where window.print() only worked once on a single BrowserWindow.

@codebytere codebytere deleted the fix-printing-only-once branch January 27, 2020 18:55
@trop
Copy link
Contributor
trop bot commented Jan 27, 2020

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

@trop trop bot removed the target/8-x-y label Jan 27, 2020
@trop
Copy link
Contributor
trop bot commented Jan 27, 2020

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

@trop
Copy link
Contributor
trop bot commented Jan 27, 2020

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

@trop
Copy link
Contributor
trop bot commented Jan 27, 2020

@codebytere has manually backported this PR to "7-1-x", please check out #21911

@trop
Copy link
Contributor
trop bot commented Jan 27, 2020

@codebytere has manually backported this PR to "6-1-x", please check out #21913

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.

Print issue on Electron from v7 - Print only works once (window.print())
3 participants
0