The discussion revolves around resolving a CSP error when using a third-party library in a plugin. peter.be successfully loads a library via loadScript but encounters a CSP violation when the library creates Blobs, resulting in a blocked blob: URL. Firepup650 suggests adding http://localhost:4200 or blob:http://localhost:4200 to the CSP, but peter.be notes these are ineffective or invalid. merefield advises that CSP should not be enforced in development, as it can block useful tools and is unnecessary since localhost is not a real internet address. peter.be acknowledges the advice but wants to resolve the issue early to assess its impact on production readiness.
On some occasions in that file, the library creates Blobs and assigns them to variables that are being used. E.g.
var A=URL.createObjectURL(new Blob(['\n\tsome code snippet...],{type:"application/javascript"}))
And whenever I try to use the library in my plugin code, I get:
Refused to load the script 'blob:http://localhost:4200/f33a6788-a853-4286-883a-48cb8e2c9cc1' because it violates the following Content Security Policy directive: "script-src http://localhost:4200/assets/ etc etc...
I was indeed in the phase of getting it ready for production, so this was the last headache to be resolved. And besides, I don’t like to delay these things, especially when I need to find out if they could be a potential deal breaker and I need to find another avenue altogether