Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Proposal: use self instead of window for WebWorker compatibility #728

Closed
dryajov opened this issue Jan 27, 2017 · 6 comments
Closed

Proposal: use self instead of window for WebWorker compatibility #728

dryajov opened this issue Jan 27, 2017 · 6 comments

Comments

@dryajov
Copy link
Member

dryajov commented Jan 27, 2017

As part of achieving #725, I would like to propose that we switch from using window to self, everywhere possible, since window is missing in Service and Web workers. It should be pretty safe, as long as we don't need to modify window, since self is readonly. What I'm trying to avoid is checking for window everywhere since you could be potentially running inside a WebWorker and doing the check is tedious and error prone.

@daviddias
Copy link
Member

@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

@dignifiedquire
Copy link
Member

Are you sure all browsers expose self in the same way they support window?

@dryajov
Copy link
Member Author

dryajov commented Jan 27, 2017

@dryajov
Copy link
Member Author

dryajov commented Jan 27, 2017

@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?

@daviddias
Copy link
Member

but we can dial directly, can we?

Yes, I've answered your question on #729

@daviddias
Copy link
Member

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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants