Skip to content
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

JSZip v3.10+ breaks in some sandboxed browser environment because dependency setimmediate breaks #909

Open
edyhchan opened this issue Sep 29, 2023 · 1 comment

Comments

@edyhchan
Copy link

JSZip v3.10+ breaks in certain browser sandboxed environment such as userscript engine Tampermonkey because the new dependency in v3.10 setimmediate breaks in that case.
This is explained in Tampermonkey issue #1600 along with a workaround. Dependency setimmediate compares event.source === global but in sandboxed Tampermonkey this is not true.

Steps to reproduce:
Create a userscript in Tampermonkey with sandbox enabled by putting @grant to something other than none.
Use JSZip's generateAsync().
generateAsync() does no work and no error is thrown.

This is likely what people in issue #864 is experiencing.

Perhaps JSZip can use a different setImmediate shim or move away from using it altogether since it's currently non-standard.

@444171810
Copy link

444171810 commented Nov 23, 2023

For anyone experiencing this, try my solution here #864 (comment). Let me know if it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants