提交 5df39d8f 编写于 作者: N Nick Uraltsev 提交者: GitHub

Check that navigator is defined

上级 603bd2f6
......@@ -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 (
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册