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

Default web worker URL to online version #50

Open
SheepTester opened this issue Jun 4, 2021 · 4 comments
Open

Default web worker URL to online version #50

SheepTester opened this issue Jun 4, 2021 · 4 comments

Comments

@SheepTester
Copy link
Owner

https://canary.discord.com/channels/@me/818068592708550696/849688330505682946

If the user's on a file:// URL or maybe if loading the local web worker fails, then try the online version

@SheepTester
Copy link
Owner Author

This is a bit complicated because it's loading the Web Worker using some webpack plugin, so we don't have direct access to the URL

https://github.com/SheepTester/scratch-vm/blob/dd071464816ebb7a7b9f757c8d58edbad5b8f876/src/extension-support/extension-manager.js#L159-L165

@SheepTester
Copy link
Owner Author

This might get even more complicated because the HTMLifier relies on parsing the bundled code to splice in worker code from a string

https://github.com/SheepTester/htmlifier/blob/55590b15b444d9e0c9d295439367a6da2268711e/hacky-file-getter.js#L222-L249

@SheepTester
Copy link
Owner Author

image
Well, that sucks

@SheepTester
Copy link
Owner Author

Hmm, perhaps it could be loaded using the HTMLifier's way of URL.createObjectURL'ing the worker code, but this is just getting increasingly hacky

This currently prevents the offline version from using extensions I believe though, so I won't close this

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

1 participant