Post

Replies

Boosts

Views

Activity

Safari Mobile Sandbox allow-scripts
Hi,I'm developing an app on a esp8266 microcontroller that is controlled by a web browser... ideally Safari on my iPhone! The website is a fairly standard html/css/javascript/websockets type of thing.For some reason I'm not able to load my javascript on Safari (or Chrome) on my iPhone??Things work fine when viewed with Safari (or Chrome) on my MacBook.I've boiled the problem down to the following example...demo.html<html> <head> <title>Demo</title> <meta name="description" content="Test of basic Javascipt function"> <script type="application/javascript" src="/demo.js"></script> </head> <body> DEMO<br> <div id="main"></div> </body> </html>demo.jsvar i = 0; function update() { 'use strict'; document.getElementById("main").innerHTML = i; i = i + 1; } setInterval(update, 500);When I load this from my computer, it runs fine, but when I load it on my iphone I get the following error via WebInspector... Blocked script execution in 'http://IP_OF_WEBSERVER/demo.html'because the document's frame is sandboxed and the 'allow-scripts' permission is not set.For the life of me, I can't figure out how to set 'allow-scripts'. I've even hacked my webserver to send... Content-Security-Policy: default-src 'self'; sandbox 'allow-scripts' 'allow-same-origin'; script-src 'unsafe-inline' 'unsafe-eval';Doesn't appear to help in any way. I've been banging my head against this for a couple of days now, and I could really use some help.Thanks,Bill
3
0
5.3k
Aug ’16