Skip to content

Hook Workers to appropriately treat Blobs completely#89

Merged
weizman merged 8 commits intofix-issue-87from
hook-worker
Jun 13, 2023
Merged

Hook Workers to appropriately treat Blobs completely#89
weizman merged 8 commits intofix-issue-87from
hook-worker

Conversation

@weizman
Copy link
Copy Markdown
Member

@weizman weizman commented Jun 13, 2023

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 postMessage and turn it into an iframe.

This is tricky because blob URLs are a unique animal. They are not about:blank so 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.

@weizman weizman changed the title poc for fixing issue 87 Hook Workers to appropriately treat blobs completely Jun 13, 2023
@weizman weizman changed the title Hook Workers to appropriately treat blobs completely Hook Workers to appropriately treat Blobs completely Jun 13, 2023
@weizman
Copy link
Copy Markdown
Member Author

weizman commented Jun 13, 2023

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

@weizman weizman marked this pull request as ready for review June 13, 2023 14:00
@weizman weizman merged commit ac7a51a into fix-issue-87 Jun 13, 2023
@weizman weizman deleted the hook-worker branch June 13, 2023 14:00
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

Successfully merging this pull request may close these issues.

1 participant