-fix polyfill

This commit is contained in:
Florian Dold 2022-11-10 14:24:02 +01:00
parent dec3a30352
commit 42d3a2b1d7
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 11 additions and 4 deletions

View File

@ -83,20 +83,24 @@ export interface URLCtor {
})();
// @ts-ignore
const _URL = globalThis.URL;
let _URL = globalThis.URL;
if (!_URL) {
// @ts-ignore
globalThis.URL = URLImpl;
globalThis.URL = _URL = URLImpl;
// @ts-ignore
_URL = URLImpl;
}
export const URL: URLCtor = _URL;
// @ts-ignore
const _URLSearchParams = globalThis.URLSearchParams;
let _URLSearchParams = globalThis.URLSearchParams;
if (!_URLSearchParams) {
// @ts-ignore
globalThis.URL = URLSearchParamsImpl;
globalThis.URLSearchParams = URLSearchParamsImpl;
// @ts-ignore
_URLSearchParams = URLSearchParamsImpl;
}
export const URLSearchParams: URLSearchParamsCtor = _URLSearchParams;

View File

@ -308,3 +308,6 @@ export function installNativeWalletListener(): void {
logger.info("native wallet listener installed");
}
// @ts-ignore
globalThis.installNativeWalletListener = installNativeWalletListener;