mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Polyfill globalThis
in latest build (#9352)
This commit is contained in:
parent
8836ba6ceb
commit
5418474f64
@ -48,6 +48,9 @@
|
||||
window.providersPromise = fetch("/auth/providers", {
|
||||
credentials: "same-origin",
|
||||
});
|
||||
if (!window.globalThis) {
|
||||
window.globalThis = window;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
@ -71,6 +71,9 @@
|
||||
import("<%= latestAppJS %>");
|
||||
window.customPanelJS = "<%= latestCustomPanelJS %>";
|
||||
window.latestJS = true;
|
||||
if (!window.globalThis) {
|
||||
window.globalThis = window;
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
{% for extra_module in extra_modules -%}
|
||||
|
@ -80,6 +80,9 @@
|
||||
window.stepsPromise = fetch("/api/onboarding", {
|
||||
credentials: "same-origin",
|
||||
});
|
||||
if (!window.globalThis) {
|
||||
window.globalThis = window;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
@ -1,10 +1,10 @@
|
||||
// For localize
|
||||
import "@formatjs/intl-getcanonicallocales/polyfill";
|
||||
import "lit/polyfill-support";
|
||||
import "core-js";
|
||||
import "regenerator-runtime/runtime";
|
||||
import "lit/polyfill-support";
|
||||
import "@formatjs/intl-getcanonicallocales/polyfill";
|
||||
// To use comlink under ES5
|
||||
import "proxy-polyfill";
|
||||
import "regenerator-runtime/runtime";
|
||||
import "unfetch/polyfill";
|
||||
|
||||
// Source: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md
|
||||
@ -32,3 +32,16 @@ import "unfetch/polyfill";
|
||||
});
|
||||
});
|
||||
})([Element.prototype, Document.prototype, DocumentFragment.prototype]);
|
||||
|
||||
// Source: https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames
|
||||
if (Element.prototype.getAttributeNames === undefined) {
|
||||
Element.prototype.getAttributeNames = function () {
|
||||
const attributes = this.attributes;
|
||||
const length = attributes.length;
|
||||
const result = new Array(length);
|
||||
for (let i = 0; i < length; i++) {
|
||||
result[i] = attributes[i].name;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user