Repository navigation
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
webContentsis 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 testpassesRelease Notes
Notes: Preload scripts for internal
<iframe>in<webview>are not longer executed whennodeIntegrationInSubFramesis enabled.