Add unsafe-inline (#20414)

Versions didn't show and I was getting errors in the Developer Tools: `Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'"`. The cause is probably that Chrome has implemented extra security since this tutorial was created. Added 'unsafe-inline' and it works.
This commit is contained in:
Stian Jørgensrud 2019-10-06 12:24:24 +02:00 committed by Shelley Vohr
parent 0a09f27735
commit 39d19d23d1

View file

@ -196,7 +196,7 @@ Finally the `index.html` is the web page you want to show:
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Hello World!</title> <title>Hello World!</title>
<!-- https://electronjs.org/docs/tutorial/security#csp-meta-tag --> <!-- https://electronjs.org/docs/tutorial/security#csp-meta-tag -->
<meta http-equiv="Content-Security-Policy" content="script-src 'self';" /> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head> </head>
<body> <body>
<h1>Hello World!</h1> <h1>Hello World!</h1>