From f117f600ba6f655e78f1bd0120fc0850b2863b3c Mon Sep 17 00:00:00 2001 From: Robert Tod Date: Wed, 10 Jun 2015 17:35:16 +0100 Subject: [PATCH] Reference window as global if available This change will use `window` by default if it exists so that `browserify` and `Webpack` builds do not need to do something like ```javascript var parser = new UAParser(window.navigator.userAgent) ``` https://github.com/faisalman/ua-parser-js/issues/84 --- src/ua-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index e0c5e7f..ac64380 100644 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -865,4 +865,4 @@ }; } -})(this); +})(typeof window === 'object' ? window : this);