vue-cli-plugin-browser-extension icon indicating copy to clipboard operation
vue-cli-plugin-browser-extension copied to clipboard

fix(csp): define global as 'window' to prevent CSP issues

Open Kocal opened this issue 4 years ago • 0 comments

Hey :wave:

@t-miller faced an issue on https://github.com/Kocal/vue-web-extension/issues/658, with the usage of Function() and eval() in the dist code, complying with Mozilla' CSP when uploading the extension on their web store.

I fixed the same issue in a previous version of my preset (see https://github.com/Kocal/vue-web-extension/pull/398), and so I'm applying it here to impact more people.

I used .tap() to update DefinePlugin arguments, which is always configured by Vue-CLI.

Here is the output of vue-cli-service inspect: image

Kocal avatar Jan 23 '21 22:01 Kocal