-
Notifications
You must be signed in to change notification settings - Fork 15k
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
fix: don't execute preload scripts for internal <iframe> in <webview> when nodeIntegrationInSubFrames is enabled #19260
Conversation
5c37424
to
894703c
Compare
894703c
to
6b19def
Compare
6e41c14
to
756f6eb
Compare
The test is failing on Windows CI:
|
c521176
to
4f1dcea
Compare
4f1dcea
to
1597f25
Compare
@zcbenz I've fixed the tests |
Release Notes Persisted
|
I was unable to backport this PR to "5-0-x" cleanly; |
I was unable to backport this PR to "6-0-x" cleanly; |
A maintainer has manually backported this PR to "6-0-x", please check out #19298 |
A maintainer has manually backported this PR to "5-0-x", please check out #19299 |
https://github.com/electron/electron/blob/master/docs/api/webview-tag.md#nodeintegrationinsubframes |
Description of Change
Fixes #18429.
The problem is that before the
webContents
is attached to the internal<iframe>
inside of the<webview>
, it's treated as a regular frame and the preload scripts are executed there.Fix by checking
v8Util.getHiddenValue(window.frameElement, 'internal')
on context initialization, which is set by the<webview>
implementation:electron/lib/renderer/web-view/web-view-impl.ts
Lines 54 to 61 in 50f4977
Checklist
npm test
passesRelease Notes
Notes: Preload scripts for internal
<iframe>
in<webview>
are not longer executed whennodeIntegrationInSubFrames
is enabled.