mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix synchronous loading for ES5 build (#17174)
This commit is contained in:
parent
cba246fc7f
commit
88ff4c2fa8
@ -1,18 +1,23 @@
|
|||||||
<script>
|
<script>
|
||||||
function _ls(src) {
|
function _ls(src, sync) {
|
||||||
var doc = document.documentElement;
|
var script = document.createElement("script");
|
||||||
var script = doc.insertBefore(
|
if (sync) {
|
||||||
document.createElement("script"),
|
script.async = false;
|
||||||
doc.lastChild
|
}
|
||||||
);
|
script.src = src;
|
||||||
script.defer = true;
|
return document.head.appendChild(script);
|
||||||
script.src = src;
|
}
|
||||||
return script;
|
window.polymerSkipLoadingFontRoboto = true;
|
||||||
}
|
if (
|
||||||
window.polymerSkipLoadingFontRoboto = true;
|
!(
|
||||||
if (!("customElements" in window &&
|
"customElements" in window &&
|
||||||
"content" in document.createElement("template"))) {
|
"content" in document.createElement("template")
|
||||||
document.write("<script src='/static/polyfills/webcomponents-bundle.js'><"+"/script>");
|
)
|
||||||
}
|
) {
|
||||||
var isS11_12 = /(?:.*(?:iPhone|iPad).*OS (?:11|12)_\d)|(?:.*Version\/(?:11|12)(?:\.\d+)*.*Safari\/)/.test(navigator.userAgent);
|
_ls("/static/polyfills/webcomponents-bundle.js", true);
|
||||||
</script>
|
}
|
||||||
|
var isS11_12 =
|
||||||
|
/(?:.*(?:iPhone|iPad).*OS (?:11|12)_\d)|(?:.*Version\/(?:11|12)(?:\.\d+)*.*Safari\/)/.test(
|
||||||
|
navigator.userAgent
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
}
|
}
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<% for (const entry of es5EntryJS) { %>
|
<% for (const entry of es5EntryJS) { %>
|
||||||
_ls("<%= entry %>");
|
_ls("<%= entry %>", true);
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
}
|
}
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<% for (const entry of es5EntryJS) { %>
|
<% for (const entry of es5EntryJS) { %>
|
||||||
_ls("<%= entry %>");
|
_ls("<%= entry %>", true);
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user