2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +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. * This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals. * Both environments support XMLHttpRequest, but not fully standard globals.
* As of react-native 0.13, it can be identified from navigator.product.
* *
* web workers: * web workers:
* typeof window -> undefined * typeof window -> undefined
@@ -179,7 +178,7 @@ function trim(str) {
* navigator.product -> 'ReactNative' * navigator.product -> 'ReactNative'
*/ */
function isStandardBrowserEnv() { function isStandardBrowserEnv() {
if (typeof navigator.product !== 'undefined' && navigator.product === 'ReactNative') { if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
return false; return false;
} }
return ( return (