Skip to content

Commit 0f37b54

Browse files
committed
Editor: fix default sketch URL in iframe
1 parent 2db69d2 commit 0f37b54

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

editor/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@
236236
}
237237

238238
function makeDefaultHTML() {
239-
return '<!DOCTYPE html><html><head><style>*{margin:0;padding:0;overflow:hidden}body{background:#000}canvas{display:block;width:100vw;height:100vh}<\/style><\/head><body><canvas id="canvas"><\/canvas><script>window.Module={canvas:document.getElementById("canvas"),onRuntimeInitialized:function(){parent.postMessage("running","*");},print:console.log,printErr:console.warn};<\/script><script src="/editor/default_sketch.js"><\/script><\/body><\/html>';
239+
const base = location.origin + '/editor/';
240+
return '<!DOCTYPE html><html><head><style>*{margin:0;padding:0;overflow:hidden}body{background:#000}canvas{display:block;width:100vw;height:100vh}<\/style><\/head><body><canvas id="canvas"><\/canvas><script>window.Module={canvas:document.getElementById("canvas"),onRuntimeInitialized:function(){parent.postMessage("running","*");},print:console.log,printErr:console.warn};<\/script><script src="'+base+'default_sketch.js"><\/script><\/body><\/html>';
240241
}
241242

242243
function launchIframe(html) {

0 commit comments

Comments
 (0)