Repository navigation
fix: add patch to prevent crash during frame swap with ctx isolation enabled - #23684
Conversation
b99fd54 to
55c8f48
Compare
|
Is there a minimal repro for this, its hard to understand from the patch what kind of assertion failure is hit and which type of frame swap triggers this. Curious, mainly because this implementation hasn't changed much in years, so why hasn't ci caught this ? Can we improve the test if so. |
|
@deepak1556 I'm working on a test for this edge case, automating it out is quite complex but it should be possible. I've got a fiddle I'll DM you |
f45f1d7 to
70b8cd8
Compare
70b8cd8 to
67fe5bd
Compare
deepak1556
left a comment
There was a problem hiding this comment.
Oops this PR slipped through the cracks, verified the fix. @MarshallOfSound can you link the POC here so that other maintainers can look at it too. Thanks!
LGTM
|
Release Notes Persisted
|
|
I have automatically backported this PR to "8-x-y", please check out #23894 |
|
/trop run backport-to 10-x-y |
|
I have automatically backported this PR to "9-x-y", please check out #23895 |
|
The backport process for this PR has been manually initiated - |
|
I have automatically backported this PR to "10-x-y", please check out #23896 |
Electron's Context Isolation implementation has a side-effect of initializing the isolated worlds WindowProxy during the initialization of the main world WindowProxy as a result of creating the isolated world inside the DidCreateScriptContext hook. This results in an assertion failing in Chromium during a frame swap where it expects to be able to set a new global_proxy in the WindowProxy of the isolated world BEFORE it is initialized.
To meet this assumption this patch splits SetGlobalProxy into two calls, SetGlobalProxyWithoutInitializing and InitializeIfNeeded which has the same resultant effect but means that all of the global_proxy objects are set BEFORE any WindowProxy's are initialized.
This could probably be upstreamed as it doesn't affect the way Chromium works but also it has no benefit for them at this time.
Notes: Fixed crash when navigating between origins in a child window with nativeWindowOpen and contextIsolation enabled