Fix synchronous loading for ES5 build (#17174)
parent
cba246fc7f
commit
88ff4c2fa8
|
@ -1,18 +1,23 @@
|
|||
<script>
|
||||
function _ls(src) {
|
||||
var doc = document.documentElement;
|
||||
var script = doc.insertBefore(
|
||||
document.createElement("script"),
|
||||
doc.lastChild
|
||||
);
|
||||
script.defer = true;
|
||||
script.src = src;
|
||||
return script;
|
||||
}
|
||||
window.polymerSkipLoadingFontRoboto = true;
|
||||
if (!("customElements" in window &&
|
||||
"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);
|
||||
</script>
|
||||
<script>
|
||||
function _ls(src, sync) {
|
||||
var script = document.createElement("script");
|
||||
if (sync) {
|
||||
script.async = false;
|
||||
}
|
||||
script.src = src;
|
||||
return document.head.appendChild(script);
|
||||
}
|
||||
window.polymerSkipLoadingFontRoboto = true;
|
||||
if (
|
||||
!(
|
||||
"customElements" in window &&
|
||||
"content" in document.createElement("template")
|
||||
)
|
||||
) {
|
||||
_ls("/static/polyfills/webcomponents-bundle.js", true);
|
||||
}
|
||||
var isS11_12 =
|
||||
/(?:.*(?:iPhone|iPad).*OS (?:11|12)_\d)|(?:.*Version\/(?:11|12)(?:\.\d+)*.*Safari\/)/.test(
|
||||
navigator.userAgent
|
||||
);
|
||||
</script>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
}
|
||||
<% } else { %>
|
||||
<% for (const entry of es5EntryJS) { %>
|
||||
_ls("<%= entry %>");
|
||||
_ls("<%= entry %>", true);
|
||||
<% } %>
|
||||
<% } %>
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
}
|
||||
<% } else { %>
|
||||
<% for (const entry of es5EntryJS) { %>
|
||||
_ls("<%= entry %>");
|
||||
_ls("<%= entry %>", true);
|
||||
<% } %>
|
||||
<% } %>
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue