Fix feature detection for module browsers that do not support dynamic… (#6069)

This commit is contained in:
Paulus Schoutsen 2020-05-28 12:28:58 -07:00 committed by GitHub
parent f354e1eb0f
commit 6c8aedfb8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,20 +52,19 @@
<%= renderTemplate('_js_base') %> <%= renderTemplate('_js_base') %>
<%= renderTemplate('_preload_roboto') %> <%= renderTemplate('_preload_roboto') %>
<script type="module" crossorigin="use-credentials"> <script>
import("<%= latestCoreJS %>"); import("<%= latestCoreJS %>");
import("<%= latestAppJS %>"); import("<%= latestAppJS %>");
window.customPanelJS = "<%= latestCustomPanelJS %>"; window.customPanelJS = "<%= latestCustomPanelJS %>";
window.latestJS = true;
</script> </script>
{% for extra_module in extra_modules -%} {% for extra_module in extra_modules -%}
<script type="module" crossorigin="use-credentials" src="{{ extra_module }}"></script> <script type="module" crossorigin="use-credentials" src="{{ extra_module }}"></script>
{% endfor -%} {% endfor -%}
<script>
<script nomodule>
(function() { (function() {
// Safari 10.1 supports type=module but ignores nomodule, so we add this check. if (!window.latestJS) {
if (!isS101) {
window.customPanelJS = "<%= es5CustomPanelJS %>"; window.customPanelJS = "<%= es5CustomPanelJS %>";
_ls("/static/polyfills/custom-elements-es5-adapter.js"); _ls("/static/polyfills/custom-elements-es5-adapter.js");