http-browserify icon indicating copy to clipboard operation
http-browserify copied to clipboard

support web-workers XMLHttpRequest

Open hankhero opened this issue 11 years ago • 2 comments

for a web-worker, window is unavailable butXMLHttpRequest is available on the global 'self' object

hankhero avatar Nov 09 '14 20:11 hankhero

This would be really useful!

canastro avatar Mar 17 '15 08:03 canastro

Agreed this would be useful. For others looking to work around the window checking, you can add this hack to whatever module requires http:

self.window = self;

And with this, window.XMLHttpRequest will be defined.

tschaub avatar Aug 19 '15 23:08 tschaub