Skip to content

Conversation

@Hossein-Fasihi
Copy link

Because when using window only web pages can use this. But when using self, then web workers can use it too.

What's The Use?

I encountered this when I was trying to use the resumable file upload inside a web worker (I had to, because I needed some synchronous, blocking, pre-processing on the file) then all the window.* methods would blow up. Such scenario doesn't seem very improbable, considering the nature of files & IO.

Backwards Compatible?

The "resumable.js" uses window.setTimeout in multiple cases and also window.resumable = resumable at the end of the file. As a matter of fact all these cases can be safely changed to self.* (look here). I changed it and it seems to work both on web pages & web workers too.

Because when using `window` only web pages can use this. But when using `self`, then web workers can use it too.
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