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]: webContents.setWindowOpenHandler cannot set preload #32136
Comments
I think that preloads will not run in window.open when I'm running Electron 13.6.1 . Since the OP is version 16.0.2, I think this is possibly a generalized problem. @IrvingZhao can you try |
Same with |
This issue was mentioned in another thread: #16224 (comment) |
I am having a similar issue. When my app was using Electron 14.x and I called window.open, the preload script was working on the child window (which is what I wanted). I have now upgraded to Electron v16.0.5 and the preload script is no longer loading on my child window, and I am not seeing anything in the changelogs to indicate why this is happening. I need to have contextisolation: true, and it worked fine before updating electron. |
This is happening because when navigating to about:blank the window will take over the webpreferences from the parent and it is not possible to change them. electron/shell/renderer/electron_render_frame_observer.cc Lines 84 to 86 in 94d4a07
Note that this is only happening for about:blank. See: electron/shell/renderer/electron_render_frame_observer.cc Lines 99 to 102 in 94d4a07
Other cases will work fine |
It looks like fixed. Latest electron 20.0.2 |
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. |
Preflight Checklist
Electron Version
16.0.2
What operating system are you using?
Windows
Operating System Version
Windows 11 21H2
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
In conversationWindow, use
window.open('about:blank')
to open a new window, execute preload2.jsActual Behavior
it also execute preload.js
Testcase Gist URL
index.ts
Additional Information
No response
The text was updated successfully, but these errors were encountered: