2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

Check that navigator is defined

This commit is contained in:
Nick Uraltsev
2017-03-01 21:52:42 -08:00
committed by GitHub
parent 603bd2f66c
commit 5df39d8fa0
+1 -2
View File
@@ -169,7 +169,6 @@ function trim(str) {
*
* This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals.
* As of react-native 0.13, it can be identified from navigator.product.
*
* web workers:
* typeof window -> undefined
@@ -179,7 +178,7 @@ function trim(str) {
* navigator.product -> 'ReactNative'
*/
function isStandardBrowserEnv() {
if (typeof navigator.product !== 'undefined' && navigator.product === 'ReactNative') {
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
return false;
}
return (