This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Proposal: use self instead of window for WebWorker compatibility #728
Comments
@dryajov sounds good, nevertheless please have in mind that WebRTC is not available in webworkers, we will need some special way to fully support a js-ipfs node in a WebWorker |
Are you sure all browsers expose self in the same way they support window? |
@diasdavid We should be able to use web sockets AFAIK? I've asked a question here #729, I understand that currently there is no discoverability built into the js-ipfs, but we can dial directly, can we? |
Yes, I've answered your question on #729 |
All right, all the work happening and being tracked here: #725 closing this one :) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As part of achieving #725, I would like to propose that we switch from using
window
toself
, everywhere possible, sincewindow
is missing in Service and Web workers. It should be pretty safe, as long as we don't need to modifywindow
, sinceself
is readonly. What I'm trying to avoid is checking forwindow
everywhere since you could be potentially running inside a WebWorker and doing the check is tedious and error prone.The text was updated successfully, but these errors were encountered: