Hook Workers to appropriately treat Blobs completely#89
Merged
weizman merged 8 commits intofix-issue-87from Jun 13, 2023
Merged
Hook Workers to appropriately treat Blobs completely#89weizman merged 8 commits intofix-issue-87from
weizman merged 8 commits intofix-issue-87from
Conversation
Member
Author
|
if disallowing creation of URL object in Web Workers the way Snow does in #89 prevents your application from running correctly, please share so in this thread so we can discuss the problem and understand how to best deal with it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Working on #88 to improve Blobs handling, I realized that my fix attempt reopens an issue from the past. Back then, the only way we could think of to handle this issue was to block blobs all together. I now realize I might have a different idea of how to handle that past issue.
As linked above, the problem was that a blob URL can be created inside a Worker, where Snow can't reach, and then just pass the created URL back to top using
postMessageand turn it into an iframe.This is tricky because blob URLs are a unique animal. They are not
about:blankso they're load is allegedly not sync, but their inner HTML&JS executes before external load events since a blob is a local resource.This is the worst thing that could happen to Snow current arch.
To solve this, I can simply make workers unable to create blobs/url objects in the first place. I can do so because if a worker is created out of a blob, that blob is for sure a JS file, so I can just replace it with my own blob JS file. My replacement will simply run some protection code and afterwards will load the original JS. The other way to load a Worker is from a remote resource of course, but that is out of Snow's scope.