Skip to content
This repository has been archived by the owner on Mar 20, 2020. It is now read-only.

feat: switch window for self for webworker compatibility #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dryajov
Copy link

@dryajov dryajov commented Mar 17, 2017

self is a safer and more portable reference to global context than window, with virtually the same browser version/history support. Using self should allow detecting webrtc capabilities with this library in web/serviceworker environments without breaking.

Fixing this would also allow running IPFS in webworkers.

For background, here are a few pointers:
eslint/eslint#8229
ipfs/js-ipfs#725
ipfs/js-ipfs#728

Copy link

@daviddias daviddias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @dryajov :)

@daviddias
Copy link

daviddias commented May 16, 2017

@fippo, @HenrikJoreteg can we get this one merged? I can also create another module following your suggestion here, but I would rather than have one utility rather than two to achieve the same goal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants