protocol

Testing component used to fake protocols from the browser. Overrides window.location.protocol
properties with fake ones using Object.defineProperty
, so it won't work on IE8. Probably a good thing to only use in testing.
Installation
$ npm install @segment/protocol
API
#protocol()
Returns the current protocol that the document is using
protocol();
#protocol(protocol)
When supplied with an argument, sets a custom protocol for the document.
protocol('chrome-extension:');
protocol();
#http()
Sets the protocol to be http
protocol();
protocol.http();
#https()
Sets the protocol to be https:
protocol();
protocol.https();
#reset()
Resets the protocol to be whatever it was at page load.
protocol('x:');
protocol.reset();
protocol();