HenrikJoreteg / webrtcsupport

Browser module to detect support for WebRTC and extract proper constructors.
55 stars 33 forks source link

Fails when called from worker #29

Open jackkleeman opened 7 years ago

jackkleeman commented 7 years ago

This function seems to expect document and window globals to exist, giving a runtime error when called in a web worker. As far as I know, webrtc support does not exist within a worker, so a simple fix is to check if document and window exist, and if not then return false for all relevant booleans.

daviddias commented 7 years ago

Yeah, this is the last task to get https://github.com/ipfs/js-ipfs/issues/725 done too :)