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