fix: illegal access errors with nodeIntegrationInSubFrames (#29093)
This commit is contained in:
parent
4073599f59
commit
b7a23450b7
6 changed files with 104 additions and 4 deletions
|
@ -80,12 +80,13 @@ void ElectronRendererClient::DidCreateScriptContext(
|
|||
// TODO(zcbenz): Do not create Node environment if node integration is not
|
||||
// enabled.
|
||||
|
||||
// Only load node if we are a main frame or a devtools extension
|
||||
// unless node support has been explicitly enabled for sub frames
|
||||
// Only load Node.js if we are a main frame or a devtools extension
|
||||
// unless Node.js support has been explicitly enabled for subframes.
|
||||
auto prefs = render_frame->GetBlinkPreferences();
|
||||
bool is_main_frame = render_frame->IsMainFrame();
|
||||
bool is_devtools = IsDevToolsExtension(render_frame);
|
||||
bool allow_node_in_subframes = prefs.node_integration_in_sub_frames;
|
||||
|
||||
bool should_load_node =
|
||||
(is_main_frame || is_devtools || allow_node_in_subframes) &&
|
||||
!IsWebViewFrame(renderer_context, render_frame);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue