Only load ES6 module loader polyfill if needed
Safari now has native support for modules, so we need to make sure we only load our polyfill when actually needed.
This commit is contained in:
parent
0613d18894
commit
36bdf13654
14
vnc.html
14
vnc.html
|
@ -65,7 +65,19 @@
|
||||||
<!-- begin scripts -->
|
<!-- begin scripts -->
|
||||||
<!-- promise polyfills promises for IE11 -->
|
<!-- promise polyfills promises for IE11 -->
|
||||||
<script src="vendor/promise.js"></script>
|
<script src="vendor/promise.js"></script>
|
||||||
<script src="vendor/browser-es-module-loader/dist/browser-es-module-loader.js"></script>
|
<!-- ES2015/ES6 modules polyfill -->
|
||||||
|
<script type="module">
|
||||||
|
window._noVNC_has_module_support = true;
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
window.addEventListener("load", function() {
|
||||||
|
if (window._noVNC_has_module_support) return;
|
||||||
|
var loader = document.createElement("script");
|
||||||
|
loader.src = "vendor/browser-es-module-loader/dist/browser-es-module-loader.js";
|
||||||
|
document.head.appendChild(loader);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- actual script modules -->
|
||||||
<script type="module" src="app/ui.js"></script>
|
<script type="module" src="app/ui.js"></script>
|
||||||
<!-- end scripts -->
|
<!-- end scripts -->
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in New Issue