intoli / user-agents

A JavaScript library for generating random user agents with data that's updated daily.
Other
981 stars 51 forks source link

cannot use in browser extension environment #60

Open LXS2000 opened 1 year ago

LXS2000 commented 1 year ago

when i used user-agents in browser extension environment (manifest v3,execute in background worker): const userAgent = new UserAgent({deviceCategory: ‘desktop’}).data i got a error like this : Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules' http://localhost:* http://127.0.0.1:*". It looks related to browser content_security_policy ,and chrome does not support to set ‘unsafe-eval’ in extension manifest.json file。 as mentioned above,this library cannot be used in the browser extension environment