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:
+1
-2
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user