pwnall / node-xhr2

XMLHttpRequest emulator for node.js
MIT License
104 stars 41 forks source link

window is not defined #48

Closed rendomnet closed 2 years ago

rendomnet commented 2 years ago

I'm trying to use it inside Chrome extension background.js which is service worker.

global.XMLHttpRequest = require('xhr2'); And it gives me this error. background.js:7 Uncaught ReferenceError: window is not defined