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]: Preload script not running on child-window "top" frame #38844

Closed
3 tasks done
Asaf-Rivni-Ericom opened this issue Jun 19, 2023 · 5 comments · Fixed by #38910
Closed
3 tasks done

[Bug]: Preload script not running on child-window "top" frame #38844

Asaf-Rivni-Ericom opened this issue Jun 19, 2023 · 5 comments · Fixed by #38910
Assignees
Labels
25-x-y 26-x-y bug 🪲 component/BrowserWindow has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@Asaf-Rivni-Ericom
Copy link

Asaf-Rivni-Ericom commented Jun 19, 2023

Preflight Checklist

Electron Version

16.0.5

What operating system are you using?

Ubuntu

Operating System Version

20.04

What arch are you using?

x64

Last Known Working Electron version

16.0.4

Expected Behavior

I have an app that uses the preload script on some contexts.
Recently I found out that in some scenarios the preload script is not running.
Im using the setWindowOpenHandler function in order to use the same preload in all future child window that will be created.
Electron fiddle gist is added for refrence.

Bug flow:

  1. Go to gmail.com.
  2. Click on the "meet" button on the left.
  3. Click on "New Meeting"
  4. A pop up will open up
  5. The expected behaviour is to have preload script running on this window as well.

Actual Behavior

Bug flow:

  1. Go to gmail.com.
  2. Click on the "meet" button on the left.
  3. Click on "New Meeting"
  4. A pop up will open up
  5. The actual behaviour is that the preload script does not run at all on the top frame.

Testcase Gist URL

https://gist.github.com/cbb4249641359cce34b87c0203b55d8a

Additional Information

Tested also 26.0.0-alpha.7 to make sure its not something that was fixed in newer versions
Looking at the release notes this PR seems to be what's causing this bug: #32108

@codebytere codebytere added platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature component/BrowserWindow has-repro-gist Issue can be reproduced with code at https://gist.github.com/ 25-x-y 26-x-y labels Jun 19, 2023
@codebytere
Copy link
Member

@zcbenz could you take a look at this?

@ytzlax

This comment was marked as spam.

1 similar comment
@ShmayaFrankel

This comment was marked as spam.

@zcbenz zcbenz self-assigned this Jun 21, 2023
@zcbenz
Copy link
Member

zcbenz commented Jun 22, 2023

I can reproduce this issue but I have to say this is very hard to debug since gmail is one of the most complicated js app and it is apparently doing some very fancy things.

Currently from my observation, it seems that gmail created an empty new child window, then wrote content to it in the parent window, and then did some magic to make the child window disconnected from the parent window probably from safety reasons. This method bypasses how we initialize the node integration.

I'll see if I can find a fix.

@Asaf-Rivni-Ericom
Copy link
Author

@zcbenz Thanks for the update, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
25-x-y 26-x-y bug 🪲 component/BrowserWindow has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
No open projects
Status: Unsorted Items
Status: 🛠 Fixed for Next Release
Development

Successfully merging a pull request may close this issue.

5 participants