Vom Arduino gehostet Website läd in Safari aber in Chrome nicht?
Hi,
ich hab einen ESP8266 und ein BMP280 so programmiert, dass es mir die Temperatur anzeigt wenn ich ihn über die IP aufrufe. Jetzt hab ich das Problem das wenn ich über mein Handy über Safari die IP aufrufe, es funktioniert aber wenn ich es über mein PC über Chrome machen will, läd die Seite nicht bzw. die Daten werden nicht übermittelt weil
The Content Security Policy (CSP) prevents the evaluation of arbitrary strings as JavaScript to make it more difficult for an attacker to inject unathorized code on your site.
To solve this issue, avoid using eval(), new Function(), setTimeout([string], ...) and setInterval([string], ...) for evaluating strings.
If you absolutely must: you can enable string evaluation by adding unsafe-eval as an allowed source in a script-src directive.
⚠️ Allowing string evaluation comes at the risk of inline script injection.
AFFECTED RESOURCES
1 directive
Source location
Directive
Status
script-src
blocked
Kennt da eine Lösung? Hab schon versucht mit einem eigen HTTPS Zertifikat aber davon hab ich keine Erfahrung und wird man dann doch bisschen zu kompliziert für eig nur die Temperatur auslesen.
1 Antwort
Von gutefrage auf Grund seines Wissens auf einem Fachgebiet ausgezeichneter Nutzer
Softwareentwickler / IT-Prozessmanager
If you absolutely must: you can enable string evaluation by adding unsafe-eval as an allowed source in a script-src directive.
⚠️ Allowing string evaluation comes at the risk of inline script injection.
Content-Security-Policy: script-src 'unsafe-eval'
Du kannst das entweder auf dem Webserver konfigurieren, oder in der HTML Datei im Header angeben.
<meta
http-equiv="Content-Security-Policy"
content="script-src 'unsafe-eval';" />
Ich habe das nicht getestet, deshalb hier die Dokumentation: CSP: script-src - HTTP | MDN (mozilla.org)
Woher ich das weiß:Recherche