fix: do not enable node integration in child window if not enabled (#15076)

This commit is contained in:
Cheng Zhao 2018-10-16 18:10:03 +09:00 committed by GitHub
parent 2a4f5c3284
commit 0252d7686c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 0 deletions

View file

@ -536,3 +536,12 @@ patches:
description: |
Temporarily add additional debugging statements to
generate_breakpad_symbols.py to determine why it is hanging.
-
author: zcbenz <zcbenz@gmail.com>
file: web_preferences.patch
description: |
Add a node_integration field to WebPreferences so we can determine whether
a frame has node integration in renderer process.
This is required by the nativeWindowOpen option, which put multiple main
frames in one renderer process.

View file

@ -0,0 +1,26 @@
diff --git a/content/public/common/common_param_traits_macros.h b/content/public/common/common_param_traits_macros.h
index 57f03dc..7c4409e 100644
--- a/content/public/common/common_param_traits_macros.h
+++ b/content/public/common/common_param_traits_macros.h
@@ -198,6 +198,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(animation_policy)
IPC_STRUCT_TRAITS_MEMBER(user_gesture_required_for_presentation)
IPC_STRUCT_TRAITS_MEMBER(text_track_margin_percentage)
+ IPC_STRUCT_TRAITS_MEMBER(node_integration)
IPC_STRUCT_TRAITS_MEMBER(save_previous_document_resources)
IPC_STRUCT_TRAITS_MEMBER(text_autosizing_enabled)
IPC_STRUCT_TRAITS_MEMBER(double_tap_to_zoom_enabled)
diff --git a/content/public/common/web_preferences.h b/content/public/common/web_preferences.h
index 78cbf5f..b33ac28 100644
--- a/content/public/common/web_preferences.h
+++ b/content/public/common/web_preferences.h
@@ -222,6 +222,9 @@ struct CONTENT_EXPORT WebPreferences {
// Cues will not be placed in this margin area.
float text_track_margin_percentage;
+ // Electron: Whether the frame has node integration.
+ bool node_integration = false;
+
bool immersive_mode_enabled;
bool text_autosizing_enabled;