fix(pdf): polyfill URL.parse for Chrome <129 compatibility
This commit is contained in:
parent
49eed1f27e
commit
fdd5a09c28
|
|
@ -1,3 +1,11 @@
|
||||||
|
// Polyfill URL.parse for browsers that don't support it (Chrome <129, Firefox <135, Safari <18.2)
|
||||||
|
// Required by pdfjs-dist 5.x which uses this API in production builds
|
||||||
|
if (!('parse' in URL)) {
|
||||||
|
;(URL as any).parse = (url: string, base?: string) => {
|
||||||
|
try { return new URL(url, base) } catch { return null }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue