1

I created a very simple extension chrome but I have a problem I can not fix it, the problem is of Content Security Policy of google chrome please I need help for fix it and this is the error :

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-wkEhk1Pm58HZQSzT/oPAcIeUYSsJpEEGo2v2M1aGgTs='), or a nonce ('nonce-...') is required to enable inline execution.

enter image description here

aminography
  • 18,195
  • 11
  • 51
  • 57
Adel Stiti
  • 33
  • 8

1 Answers1

1

React by default uses inline scripts which your browser will reject in an extension. Create a .env.production file in your react app and specify INLINE_RUNTIME_CHUNK=false inside of it.

Source: https://gist.github.com/amad-person/f0ef85a2123a2e1fcf8052dcf09eef90