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