mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Fix feature detection for module browsers that do not support dynamic… (#6069)
This commit is contained in:
parent
f354e1eb0f
commit
6c8aedfb8b
@ -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");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user