[Bug]: Window with iframes gets frozen after printing
Preflight Checklist
- [X] I have read the Contributing Guidelines for this project.
- [X] I agree to follow the Code of Conduct that this project adheres to.
- [X] I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
19.0.9
What operating system are you using?
macOS
Operating System Version
macOS Monterey 12.3.1
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Window should not get frozen after printing
Actual Behavior
Window with iframes gets frozen after printing(Save as PDF)
Steps to reproduce:
- Load html file with an iframe
<html>
<body>
<iframe src="https://en.wikipedia.org/"></iframe>
<button onclick="print()">Print me</button>
</body>
</html>
- Click on print button
- Save as PDF
- As a result window content gets frozen
Testcase Gist URL
No response
Additional Information
No response
I added the above code snippet to the stock Fiddle and could not reproduce.
To try and repro, I:
- Ran the Fiddle
- Clicked "print me"
- Clicked "Save as PDF" and saved the PDF
- Clicked back into the iframe and tried to load another page, which loaded successfully
So i'm not sure what you're experiencing in terms of the page ostensibly freezing. I also tried to print again, and could successfully.
@codebytere Did you try to reproduce it on macOS Monterey ?
same problem using 19.0.13
Also seeing this on 19.0.12.
As a workaround, we're removing the iframes, printing, then restoring the iframes.
const iframes = Array.from(document.querySelector('iframe')).map(i => {
const parent = iframe.parentElement
const before = {
iframe,
parent,
nextSibling: iframe.nextSibling
}
parent?.removeChild(iframe)
return before;
})
window.print()
iframes.forEach(i => {
const {
iframe,
parent,
nextSibling
} = i
if (nextSibling) {
parent.insertBefore(iframe, nextSibling)
} else {
parent.appendChild(iframe)
}
})
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
bump
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
bump
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
Same as before: https://github.com/electron/electron/issues/35119#issuecomment-1200968238
Cannot reproduce on macOS. Given this has been open for a long time and I've never been able to reproduce this i'm closing it out but if someone can provide a repro i can re-open.