xhr.responseType = 'blob';
xhr.onload = function(e) {
var img = document.createElement('img');
- img.src = window.webkitURL.createObjectURL(this.response);
+ img.src = window.URL.createObjectURL(this.response);
document.body.appendChild(img);
};
<h3 id="inline_scripts">Use inline scripts in sandbox</h3>
<p>
-Here's a sample sandboxed page
-which uses an inline script and <code>eval()</code>:
+Here's a sample sandboxed page which uses an inline script and <code>eval()</code>:
</p>
<pre data-filename="sandboxed.html">
<body>
<h1>Woot</h1>
<script>
- document.write('I am an inline script.<br>');
- eval('document.write(\'I am an eval-ed inline script.\');');
+ eval('console.log(\'I am an eval-ed inline script.\')');
</script>
</body>
</html>