diff options
Diffstat (limited to 'src/platform/polyfills.web.ts')
-rw-r--r-- | src/platform/polyfills.web.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/platform/polyfills.web.ts b/src/platform/polyfills.web.ts index 7a42f4887..e46963a6f 100644 --- a/src/platform/polyfills.web.ts +++ b/src/platform/polyfills.web.ts @@ -2,3 +2,11 @@ // @ts-ignore whatever typescript wants to complain about here, I dont care about -prf window.setImmediate = (cb: () => void) => setTimeout(cb, 0) + +// @ts-ignore not on the TS signature due to bad support -prf +if (!globalThis.Intl?.Segmenter) { + // NOTE loading as a separate script to reduce main bundle size, as this is only needed in FF -prf + const script = document.createElement('script') + script.setAttribute('src', '/static/js/intl-segmenter-polyfill.min.js') + document.head.appendChild(script) +} |