You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for an issue that matches the one I want to file, without success.
Issue Details
Electron Version:
5.0.0
Operating System:
macOS 10.14.4
Last Known Working Electron version::
4.1.5
Expected Behavior
I would like to open a new child window and render content into it from script running in my mainWindow, rather than perform a navigation in the new child window. This works when setting nativeWindowOpen: true for the main window and using window.open('') to open a window with location about:blank.
I would also like to load a preload script in the new window, so that I can configure the webFrame. In 4.1.5, setting a preload script on the main window caused the preload script to also be loaded for child windows. In 5.0.0, the preload script stopped loading for the child window.
I would actually expect that providing a preload script in the new-window event would work, as described here and pointed out here by @MarshallOfSound, but it doesn't. I've tried various ways of using the options that are passed into the event, but none have worked:
There doesn't seem to be a way to load a preload script into a window opened via window.open('') in electron 5.0.0. I'd like some way to get that to work, whether that is by setting the preload script on the main window as worked in previous versions, or making it work when setting it in the new-window event.
To Reproduce
Here is a commit that demonstrates the preload script loaded properly when run with electron 4.1.5, but not loaded when run with electron 5.0.0, and here is the branch:
I think this might be related to #17989 or #16224, but those issues actually involve a window.open with a navigation, while my issue doesn't (if I open a window that performs a navigation, the preload script does still run for me in 5.0.0).
@alexstrat thanks for the clarification, that worked for me!
Is it known what caused the crashes when releasing node environments that required the change to disable nodeIntegration by default (#15076)? I'm wondering if there will be a way to have preload scripts run in new windows without having the memory leak.
I think at the time of #15076 no one had figured out how to have several node environments in 1 render process, but, later, MarshallOfSound figured it out in #16425.
Preflight Checklist
Issue Details
Expected Behavior
I would like to open a new child window and render content into it from script running in my
mainWindow
, rather than perform a navigation in the new child window. This works when settingnativeWindowOpen: true
for the main window and usingwindow.open('')
to open a window with locationabout:blank
.I would also like to load a preload script in the new window, so that I can configure the
webFrame
. In 4.1.5, setting a preload script on the main window caused the preload script to also be loaded for child windows. In 5.0.0, the preload script stopped loading for the child window.I would actually expect that providing a preload script in the
new-window
event would work, as described here and pointed out here by @MarshallOfSound, but it doesn't. I've tried various ways of using the options that are passed into the event, but none have worked:and
and
Actual Behavior
There doesn't seem to be a way to load a preload script into a window opened via
window.open('')
in electron 5.0.0. I'd like some way to get that to work, whether that is by setting the preload script on the main window as worked in previous versions, or making it work when setting it in thenew-window
event.To Reproduce
Here is a commit that demonstrates the preload script loaded properly when run with electron 4.1.5, but not loaded when run with electron 5.0.0, and here is the branch:
Additional Information
I think this might be related to #17989 or #16224, but those issues actually involve a
window.open
with a navigation, while my issue doesn't (if I open a window that performs a navigation, the preload script does still run for me in 5.0.0).I tried removing the early exit from
electron/atom/renderer/atom_renderer_client.cc
Lines 76 to 79 in 53f6cbc
The text was updated successfully, but these errors were encountered: