Switching API to use type="module" scripts
This allows using imports inside scripts imported by WorkAdventure out of the box (and therefore easily importing the scripting-api-extra without resorting to using a bundler)
This commit is contained in:
parent
f247ec44f1
commit
0ecabd14f1
1
front/dist/iframe.html
vendored
1
front/dist/iframe.html
vendored
@ -11,6 +11,7 @@
|
|||||||
const scriptUrl = urlParams.get('script');
|
const scriptUrl = urlParams.get('script');
|
||||||
const script = document.createElement('script');
|
const script = document.createElement('script');
|
||||||
script.src = scriptUrl;
|
script.src = scriptUrl;
|
||||||
|
script.type = "module";
|
||||||
document.head.append(script);
|
document.head.append(script);
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -326,7 +326,7 @@ class IframeListener {
|
|||||||
"//" +
|
"//" +
|
||||||
window.location.host +
|
window.location.host +
|
||||||
'/iframe_api.js" ></script>\n' +
|
'/iframe_api.js" ></script>\n' +
|
||||||
'<script src="' +
|
'<script type="module" src="' +
|
||||||
scriptUrl +
|
scriptUrl +
|
||||||
'" ></script>\n' +
|
'" ></script>\n' +
|
||||||
"<title></title>\n" +
|
"<title></title>\n" +
|
||||||
|
Loading…
Reference in New Issue
Block a user