Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
116
rated 0 times [  123] [ 7]  / answers: 1 / hits: 10007  / 4 Years ago, sat, august 15, 2020, 12:00:00

I am new to electron and I am getting this in the console (of DevTools) of every BrowserWindow I open:


webFrame.executeJavaScript was called without worldSafeExecuteJavaScript enabled. This is considered unsafe. worldSafeExecuteJavaScript will be enabled by default in Electron 12.

I am also getting one more security warning and that is:


Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security
Policy set or a policy with "unsafe-eval" enabled. This exposes users of
this app to unnecessary security risks.

I don't know what exactly I am doing wrong...!!


This is my console window


This is my package.json


More From » electron

 Answers
0

webFrame.executeJavaScript and contextIsolation


Add the following setting to your BrowserWindow in main.js


webPreferences { worldSafeExecuteJavaScript: true, contextIsolation: true }

For reference, see:



Insecure Content-Security-Policy


Add the following to the head of your index.html and any other html pages if you are loading locally


<meta http-equiv="Content-Security-Policy" content="script-src 'self'">

For reference, see:



[#2886] Wednesday, August 12, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
agustindejonm

Total Points: 738
Total Questions: 84
Total Answers: 84

Location: Northern Ireland
Member since Mon, Nov 14, 2022
2 Years ago
agustindejonm questions
Fri, Jun 25, 21, 00:00, 3 Years ago
Fri, Sep 18, 20, 00:00, 4 Years ago
Sat, May 16, 20, 00:00, 4 Years ago
Thu, May 14, 20, 00:00, 4 Years ago
;