react-scan icon indicating copy to clipboard operation
react-scan copied to clipboard

Refused to create a worker from blob: CSP error

Open robgoodberry opened this issue 10 months ago • 1 comments

Due to the content security policy in our app containing worker-src: self I get an error when react-scan loads due to the app refusing to create the worker like:

react-scan.ts:10 Refused to create a worker from 'blob:https://<redacted>' because it violates the following Content Security Policy directive: "worker-src 'self'".

I'd prefer not to add blob: here. However, react-scan still seems to function as I would expect. Is there some fallback for the worker that makes it unnecessary, or is it required for some functionality only? Thanks in advance

robgoodberry avatar Apr 30 '25 17:04 robgoodberry

Yeah we have a fallback for usage without workers. We can add an option for scan({...}) to control this explicitly

RobPruzan avatar May 02 '25 08:05 RobPruzan