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

[Bug]: Electron app freezes/crashes after printing or saving a pdf #32764

Closed
3 tasks done
TC-kHa opened this issue Feb 7, 2022 · 2 comments
Closed
3 tasks done

[Bug]: Electron app freezes/crashes after printing or saving a pdf #32764

TC-kHa opened this issue Feb 7, 2022 · 2 comments
Labels

Comments

@TC-kHa
Copy link

TC-kHa commented Feb 7, 2022

Preflight Checklist

Electron Version

17.0.0

What operating system are you using?

macOS

Operating System Version

macOS Monterey Version 12.1

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

No response

Expected Behavior

Electron freezes/crashes after the user either save or print a page with a pdf.

Actual Behavior

Electron application freezes/crashes.

Theres no workaround except closing and reopening application

Testcase Gist URL

No response

Additional Information

Electron app freezes/crashes when a user tries to save or print a page that has pdf file.

The pdf is render inside a iframe.

There's no error logs that displays inside console or terminal.

The issue is happening on mac and window.

I was able to reproduce the issue with a simple electron app. Please look at the code example below for details.

Steps to reproduce:
Requirements: Need 2 pdfs display inside 2 different pages

  1. Open up home page with a pdf that is display
  2. Navigate to a second page with a pdf
  3. Open up the print dialog
  4. Either save or print pdf

index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
    <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
    <link href="./styles.css" rel="stylesheet">
    <title>Hello World!</title>
  </head>
  <body>
    <h1>Hello World!</h1>
    We are using Node.js <span id="node-version"></span>,
    Chromium <span id="chrome-version"></span>,
    and Electron <span id="electron-version"></span>.

    <!-- You can also require other files to run in this process -->
    <script src="./renderer.js"></script>
    <iframe src="http://www.africau.edu/images/default/sample.pdf"></iframe>
    <a href='secondpage.html'>Click this button</a>
  </body>
</html>

secondpage.html

<html />
    <iframe src="http://www.africau.edu/images/default/sample.pdf"></iframe>
    <a href='index.html'>Click this button</a>
    <button onclick="window.print()">Click print button</button>
</html>
@TC-kHa TC-kHa added the bug 🪲 label Feb 7, 2022
@codebytere
Copy link
Member

Crash fixed in #32632, and other issue is duplicate of #27605

@TC-kHa
Copy link
Author

TC-kHa commented Aug 15, 2022

@codebytere I updated the application to latest Electron version 20.0.2 and the issue is still reproducible

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

No branches or pull requests

2 participants