Web Worker Support
Web Workers resolve to the browser.js however window is not defined thus causing an undefined reference.
Using globalThis or self instead of window could allow this file to work in web workers too.
Uncaught ReferenceError: window is not defined
at node_modules/.pnpm/[email protected][email protected]/node_modules/isomorphic-dompurify/browser.js (isomorphic-dompurify.js?v=650fd638:949:22)
Hey @wSedlacek , Thanks for reporting this issue. Would you like to work on a solution?
Sure! I would be happy to make a PR.
I need to know the supported browsers to know if globalThis is the best solution (or if typeof window === undefined would be better)
Great news @wSedlacek.
We've recently switched to typeof window !== 'undefined' https://github.com/kkomelin/isomorphic-dompurify/releases/tag/v2.0.0 for the server-side version, so I think it would be ideal if we could use the same for the client one.