Add support for Chrome Apps and WebExtensions #3946
Stream detection via
This change replaces
First, I am not sure I want to support this use case. Can you give me an example where doing so would make sense? What kind of app would you be building with it?
Second, experience tells me this is not the only thing stopping it from working properly. We've gone through this with joi and other modules that required a lot of changes to work properly.
Real live example: js-ipfs in Brave browser (ipfs-shipyard/ipfs-companion#716)
js-ipfs is using Hapi to expose HTTP2IPFS Gateway. Brave whitelisted our browser extension to have access to
The only remaining issue with Hapi was the Stream detection, and change from this PR solved that (we use code form this PR).
Stream-related entries from
Detection via `stream instanceof Stream` does not work correctly in browser context, especially when different polyfils are used and mixed together. This change replaces instanceof check with feature-detection of stream-like objects. It enables Hapi to be used in Chrome Apps (browser environments with additional chrome.sockets APIs) Real life example: ipfs-shipyard/ipfs-companion#664