2022-03-18 22:35:45 +00:00
|
|
|
import { installWindowOnGlobal } from '@lit-labs/ssr/lib/dom-shim.js';
|
2023-01-09 21:59:20 +00:00
|
|
|
|
2023-01-09 22:01:33 +00:00
|
|
|
if (typeof fetch === 'function') {
|
2023-01-09 21:59:20 +00:00
|
|
|
const _fetch = fetch;
|
|
|
|
installWindowOnGlobal();
|
|
|
|
globalThis.fetch = window.fetch = _fetch;
|
|
|
|
} else {
|
|
|
|
installWindowOnGlobal();
|
|
|
|
}
|
2022-03-18 22:35:45 +00:00
|
|
|
|
|
|
|
window.global = window;
|
|
|
|
document.getElementsByTagName = () => [];
|
2022-06-02 19:45:11 +00:00
|
|
|
// See https://github.com/lit/lit/issues/2393
|
|
|
|
document.currentScript = null;
|
2022-06-21 12:32:05 +00:00
|
|
|
|
|
|
|
const ceDefine = customElements.define;
|
2022-06-21 12:33:55 +00:00
|
|
|
customElements.define = function (tagName, Ctr) {
|
2022-06-21 12:32:05 +00:00
|
|
|
Ctr[Symbol.for('tagName')] = tagName;
|
|
|
|
return ceDefine.call(this, tagName, Ctr);
|
2022-06-21 12:33:55 +00:00
|
|
|
};
|