LottieFiles / lottie-player

Lottie viewer/player as an easy to use web component! https://lottiefiles.com/web-player
MIT License
1.55k stars 175 forks source link

Add Nonce Feature for CSP Compatibility #245

Open luigiaureagroup opened 4 months ago

luigiaureagroup commented 4 months ago

I'm adding CSP rules to my project and noticed that this package doesn't handle the nonce attribute. The code returns the error here: this.element.setAttribute(this.name,null!=t?t:"")

I tried both importing the inline script and compiling the npm package via webpack but nothing changes

I don't want to add unsafe-inline in my header, it would be safer and more convenient to have a way to inject the nonce attribute