I have built a browser addon using Vuejs and used Laravel Mix as my build process.
All of my vue templates are in single file components, and everything works absolutely fine...Until I remove 'unsafe-eval' from the CSP in my addon manifest. Firefox shows the error:
Content Security Policy: The page's settings blocked the loading of a resource...Source: call to eval() or related function blocked by CSP.
Laravel Mix uses webpack and vue-loader, I was under the impression that the bundles this creates are CSP compliant.
I have looked at the built JS and there does not appear to be a call to eval()
however there is a new Function()
call which I assume causing the issue.
Am I missing something simple here?
eval
method in try catch block. There is an open issue for that on webpack too github.com/webpack/webpack/issues/5627 – Stratigraphy