Uncaught script error: Uncaught Error: not loaded in source: "http://localhost:8000/test.js" at line: -1
ses-single-frame.js:34340:5
~$ curl -I localhost:8000/test.js
HTTP/1.0 200 OK
...
Access-Control-Allow-Origin: *
<html>
<head>
<title>Caja host page</title>
<script type="text/javascript" src="//caja.appspot.com/caja.js"></script>
</head>
<body>
<div id="guest"></div>
<script type="text/javascript">
var uriPolicy = {fetcher: caja.policy.net.fetcher.USE_XHR, rewriter: caja.policy.net.rewriter.ALL};
caja.initialize({
cajaServer: 'https://caja.appspot.com/',
debug: true
});
caja.load(document.getElementById("guest"), uriPolicy, function(frame) {
frame.code("http://localhost:8000/caja-full-guest.html", "text/html")
.run();
});
</script>
</body>
</html>
<html>
<head>
<script src="/test.js"></script>
</head>
<body>
<h1 id="main">Doh!</h1>
</body>
</html>
document.getElementById("main").innerHTML = "Excellent!";
--
---
You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-caja-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var uriPolicy = {fetch: caja.policy.net.fetcher.USE_XHR,rewrite: caja.policy.net.rewriter.ALL};
To unsubscribe from this group and stop receiving emails from it, send an email to google-caja-discuss+unsubscribe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Uncaught script error: Uncaught TypeError: can't define property "sign": Math is not extensible in source: "https://cdnjs.cloudflare.com/ajax/libs/aframe/0.6.0/aframe-master.js" at line: -1
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/aframe/0.6.0/aframe-master.js"></script>
</head>
</html>
To unsubscribe from this group and stop receiving emails from it, send an email to google-caja-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks so much the snippet now works! Now I am trying to integrate this with my project, which uses a framework called "A-Frame" for games and I have run into another problem.
When I include the framework script, (I believe) it tries to add a function to the Math prototype that the library needs, and I get an error in the console like this:Uncaught script error: Uncaught TypeError: can't define property "sign": Math is not extensible in source: "https://cdnjs.cloudflare.com/ajax/libs/aframe/0.6.0/aframe-master.js" at line: -1
PS. When reproducing this there is a delay before the error shows, and the page first goes unresponsive
Is there any workaround, or way to give the guest script access to these objects?