diff --git a/lib/browser.js b/lib/browser.js index c11cea9d..51d19792 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -1,4 +1,9 @@ -var _global = (function() { return this; })(); +var _global = (function () { + if (!this && typeof global !== 'undefined') { + return global; + } + return this; +})(); var NativeWebSocket = _global.WebSocket || _global.MozWebSocket; var websocket_version = require('./version');