-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content Security Policy: eval blocked #491
Comments
I was hoping to avoid this with a try/catch The affected part is this: FileSaver.js/dist/FileSaver.js Lines 27 to 36 in 0018309
|
Yeah, I understood from the comment. I don't know how old that part of the answer from Stackoverflow is, but apparently some browser have become even stricter. I'm currently trying some magic with Rollup to get rid of the definition of the global. |
same hier! Can reproduce in Firefox@63.0.1@windows, on MacOS Firefox show Error
but content will be loaded correct. |
up. |
I solved it by replacing Is this package ever used in any other context than the browser? Anyway, I think you should export your core function in a separate file and attach it to any other context in specific files for those context. For me, this issue can be closed. |
FileSaver don't work in any other context but the window. But some includes it in web workers and nodejs for some reason The solution would be to just remove the try and only use the cache method var _global = typeof window === 'object' && window.window === window
? window : typeof self === 'object' && self.self === self
? self : typeof global === 'object' && global.global === global
? global
: this; |
released as v2.0.0 |
In Firefox 63+ (Ubuntu and Windows) and Edge I get errors like
Is it possible to solve this in v2? Could you put the saveAs function in a seperate file in src? Then I can bypass the attachment of the function to global.
The text was updated successfully, but these errors were encountered: