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]: Crash when loading iframe with custom protocol from file:// #28407
Comments
I've added a sample.zip |
I've simplified the sample app little bit. After 5 seconds it crashes, cause the iframe is added to the dom after 5 seconds. In the app.zip is the content of the 'resources\app' folder of the electron build |
$ yarn list | wc --lines
4879
$ yarn build
yarn run v1.22.10
$ webpack --mode development
/bin/sh: 1: webpack: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Thanks for reporting this and helping to make Electron better! Because of time constraints, triaging code with third-party dependencies is usually not feasible for a small team like Electron's. Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use. Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests. I'm adding the Thanks in advance! Your help is appreciated. |
there are no 3rd party dependecies. look at the app.zip. Here a fiddle: |
In the Fiddle the Iframe refreces to "index.html" cause I don't know how to add additional files to the fiddle. But the crash is the same. @ckerr |
It crashes after 5 seconds, cause then I add the iframe to the DOM |
@ckerr could I help with some more? |
I can reproduce with the fiddle on macOS. Here's the stack trace:
|
It also crashes without devtools open, so it's not exclusively a devtools-related issue:
|
Given that the crash signal is EXC_BREAKPOINT, it's probably a
here are some relevant crash keys from the dump:
these are set here: https://source.chromium.org/chromium/chromium/src/+/master:content/browser/child_process_security_policy_impl.cc;l=162-169;drc=3b8eb3bbb3a272c0bbc92311edff4caa7194e258 |
@nornagon is there any fix I can use in my index.js ? |
@jogibear9988 try loading the main frame from the |
Okay, this will fix the crash & it works:
|
@codebytere it is related not only for |
Are there any updates on this? Any workarounds? I need to render a local PDF using an iframe and the same crash occurs. |
I tried loading my index.html file from the "app://" protocol, and I got the following error message: "Could not find any application or handler for app://..." |
Can also confirm this crashes, even with registering a HTTP protocol. This is actively debilitating the development of my open-source project. |
I'm also encountering this crash when using any custom protocol, but only when the callback is called. Easiest way to replicate is to clone the electron quick start repo, register a protocol in the main.ts, call the callback function in the handler and add a link in the index.html that references that protocol. Then remove the callback function and it won't crash. |
Thank you! |
@ckerr @nornagon @codebytere : Update: I'm still finding (in Electron 21.2.0) that loading a PDF in an iFrame fails to display the PDF, and loading a PDF in a webview crashes Electron. Here's an Electron Fiddle gist that demonstrates this: https://gist.github.com/george-thomas-hill/c3179e6eddeb1a2715201a20dbf95015 Could you please re-open this bug and take another look? Thank you so much! |
@george-thomas-hill looks like this is tracked in #33907, so no need to reopen this. |
@nornagon OK. Thank you! |
Preflight Checklist
Electron Version
12.0.2
"electron-packager": "^15.2.0",
What operating system are you using?
Windows
Operating System Version
Windows 10 20H2
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Electron should not crash
Actual Behavior
Electron crashes when adding iframe
Testcase Gist URL
No response
app.zip
I've the following component wich crashes electron:
The text was updated successfully, but these errors were encountered: