Add a way to set worldSafeExecuteJavascript #620

Closed
opened 2026-01-29 16:44:17 +00:00 by claunia · 2 comments
Owner

Originally created by @DelpireNI on GitHub (Jan 13, 2021).

Currently when looking at the debugger in the electron app, we get the following warning:

(electron) Security Warning: webFrame.executeJavaScript was called without worldSafeExecuteJavaScript enabled. This is considered unsafe. worldSafeExecuteJavaScript will be enabled by default in Electron 12.

It seems that the way to fix this is to set worldSafeExecuteJavaScript to true and contextIsolation to true. Electron .NET has a WebPreferences class that currently allows ContextIsolation to be set to true, but there is no way to set worldSafeExecuteJavascript as far as I can tell.

Originally created by @DelpireNI on GitHub (Jan 13, 2021). Currently when looking at the debugger in the electron app, we get the following warning: ``` (electron) Security Warning: webFrame.executeJavaScript was called without worldSafeExecuteJavaScript enabled. This is considered unsafe. worldSafeExecuteJavaScript will be enabled by default in Electron 12. ``` It seems that the way to fix this is to set worldSafeExecuteJavaScript to true and contextIsolation to true. Electron .NET has a WebPreferences class that currently allows ContextIsolation to be set to true, but there is no way to set worldSafeExecuteJavascript as far as I can tell.
claunia added the Feature label 2026-01-29 16:44:17 +00:00
Author
Owner

@philinthecloud commented on GitHub (Jan 18, 2021):

+1 for please allowing this.

@philinthecloud commented on GitHub (Jan 18, 2021): +1 for please allowing this.
Author
Owner

@GregorBiswanger commented on GitHub (Mar 28, 2023):

🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉

With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!

@GregorBiswanger commented on GitHub (Mar 28, 2023): 🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉 With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#620