feat: enable world safe JS by default (#26889)

* feat: enable world safe JS by default

* refactor: use the ctx bridge to send executeJavaScript results in a world safe way

* docs: add more info about the breaking change

* include default in IsEnabled check
This commit is contained in:
Samuel Attard 2021-01-26 14:23:35 -08:00 committed by GitHub
parent 78d4cb9f5c
commit db08f08b88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 90 additions and 33 deletions

View file

@ -137,7 +137,7 @@ WebContentsPreferences::WebContentsPreferences(
"electron");
}
SetDefaultBoolIfUndefined(options::kContextIsolation, false);
SetDefaultBoolIfUndefined(options::kWorldSafeExecuteJavaScript, false);
SetDefaultBoolIfUndefined(options::kWorldSafeExecuteJavaScript, true);
SetDefaultBoolIfUndefined(options::kJavaScript, true);
SetDefaultBoolIfUndefined(options::kImages, true);
SetDefaultBoolIfUndefined(options::kTextAreasAreResizable, true);
@ -437,7 +437,7 @@ void WebContentsPreferences::OverrideWebkitPrefs(
#endif
prefs->world_safe_execute_javascript =
IsEnabled(options::kWorldSafeExecuteJavaScript);
IsEnabled(options::kWorldSafeExecuteJavaScript, true);
int guest_instance_id = 0;
if (GetAsInteger(&preference_, options::kGuestInstanceID, &guest_instance_id))