Description
Currently this plugin assigns variables to window - which is unavailable inside workers. If instead we targeted globalThis as an alternative [...The globalThis property provides a standard way of accessing the global this value (and hence the global object itself) across environments.] that would be a way forward where the same code can function in both a DOM and worker environment.
Suggested solution
Replace all window usage with globalThis.
Alternative
No response
Additional context
No response
Validations
Description
Currently this plugin assigns variables to
window- which is unavailable inside workers. If instead we targetedglobalThisas an alternative [...The globalThis property provides a standard way of accessing the global this value (and hence the global object itself) across environments.] that would be a way forward where the same code can function in both a DOM and worker environment.Suggested solution
Replace all
windowusage withglobalThis.Alternative
No response
Additional context
No response
Validations