mirror of
https://github.com/status-im/react-native.git
synced 2025-01-28 18:25:06 +00:00
Set navigator.product to ReactNative
Summary: Fix for [Issue 1331](https://github.com/facebook/react-native/issues/1331). Sets navigator.product to ReactNative and navigator.productSub to the version string in package.json. Note that the code requires package.json, which works fine in the RN packager, but webpack users will probably a need to configure a json loader in their config file. Tested using UIExplorer and console.log printout of the product variables in xcode and Chrome debugger. Closes https://github.com/facebook/react-native/pull/4083 Reviewed By: svcscm Differential Revision: D2696881 Pulled By: vjeux fb-gh-sync-id: 511446432dcd0ec658100715129c77153e743423
This commit is contained in:
parent
a663d4d8d5
commit
e966cd1041
@ -154,6 +154,11 @@ function setUpGeolocation() {
|
|||||||
polyfillGlobal('geolocation', require('Geolocation'), GLOBAL.navigator);
|
polyfillGlobal('geolocation', require('Geolocation'), GLOBAL.navigator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setUpProduct() {
|
||||||
|
Object.defineProperty(GLOBAL.navigator, 'product', {value: 'ReactNative'});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function setUpWebSockets() {
|
function setUpWebSockets() {
|
||||||
polyfillGlobal('WebSocket', require('WebSocket'));
|
polyfillGlobal('WebSocket', require('WebSocket'));
|
||||||
}
|
}
|
||||||
@ -197,6 +202,7 @@ setUpPromise();
|
|||||||
setUpErrorHandler();
|
setUpErrorHandler();
|
||||||
setUpXHR();
|
setUpXHR();
|
||||||
setUpGeolocation();
|
setUpGeolocation();
|
||||||
|
setUpProduct();
|
||||||
setUpWebSockets();
|
setUpWebSockets();
|
||||||
setUpProfile();
|
setUpProfile();
|
||||||
setUpFlowChecker();
|
setUpFlowChecker();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user