mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Only create isolated context in main frame
This commit is contained in:
@@ -139,7 +139,7 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver {
|
||||
}
|
||||
|
||||
bool ShouldNotifyClient(int world_id) {
|
||||
if (renderer_client_->isolated_world())
|
||||
if (renderer_client_->isolated_world() && render_frame_->IsMainFrame())
|
||||
return IsIsolatedWorld(world_id);
|
||||
else
|
||||
return IsMainWorld(world_id);
|
||||
@@ -151,7 +151,8 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver {
|
||||
if (ShouldNotifyClient(world_id))
|
||||
renderer_client_->DidCreateScriptContext(context, render_frame_);
|
||||
|
||||
if (renderer_client_->isolated_world() && IsMainWorld(world_id)) {
|
||||
if (renderer_client_->isolated_world() && IsMainWorld(world_id)
|
||||
&& render_frame_->IsMainFrame()) {
|
||||
CreateIsolatedWorldContext();
|
||||
SetupMainWorldOverrides(context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user