Added individual navigator functions
This commit is contained in:
parent
ceecbf32b6
commit
05bc9c2190
1 changed files with 114 additions and 89 deletions
|
|
@ -7,95 +7,120 @@ export {
|
||||||
checkScreenProperties,
|
checkScreenProperties,
|
||||||
};
|
};
|
||||||
|
|
||||||
const getNavigator = () => {
|
const getDeviceMemory = () => ({
|
||||||
const data = [
|
|
||||||
{
|
|
||||||
key: 'deviceMemory',
|
key: 'deviceMemory',
|
||||||
title: 'Device memory',
|
title: 'Device memory',
|
||||||
value: navigator.deviceMemory,
|
value: navigator.deviceMemory,
|
||||||
issues: checkNavigatorProperties('deviceMemory'),
|
issues: checkNavigatorProperties('deviceMemory'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
|
const getHardwareConcurrency = () => ({
|
||||||
key: 'hardwareConcurrency',
|
key: 'hardwareConcurrency',
|
||||||
title: 'Hardware Concurrency',
|
title: 'Hardware Concurrency',
|
||||||
value: navigator.hardwareConcurrency,
|
value: navigator.hardwareConcurrency,
|
||||||
issues: checkNavigatorProperties('hardwareConcurrency'),
|
issues: checkNavigatorProperties('hardwareConcurrency'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
|
const getMaxTouchPoints = () => ({
|
||||||
key: 'maxTouchPoints',
|
key: 'maxTouchPoints',
|
||||||
title: 'Max touchpoints',
|
title: 'Max touchpoints',
|
||||||
value: navigator.maxTouchPoints,
|
value: navigator.maxTouchPoints,
|
||||||
issues: checkNavigatorProperties('maxTouchPoints'),
|
issues: checkNavigatorProperties('maxTouchPoints'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
|
const getPlatform = () => ({
|
||||||
key: 'platform',
|
key: 'platform',
|
||||||
title: 'Platform',
|
title: 'Platform',
|
||||||
value: navigator.platform,
|
value: navigator.platform,
|
||||||
issues: checkNavigatorProperties('platform'),
|
issues: checkNavigatorProperties('platform'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
|
const getUserAgent = () => ({
|
||||||
key: 'userAgent',
|
key: 'userAgent',
|
||||||
title: 'User agent',
|
title: 'User agent',
|
||||||
value: navigator.userAgent,
|
value: navigator.userAgent,
|
||||||
issues: checkNavigatorProperties('userAgent'),
|
issues: checkNavigatorProperties('userAgent'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
key: 'language',
|
const getLanguage = () => ({
|
||||||
title: 'Language',
|
key: 'userAgent',
|
||||||
|
title: 'User agent',
|
||||||
value: navigator.userAgent,
|
value: navigator.userAgent,
|
||||||
issues: checkNavigatorProperties('userAgent'),
|
issues: checkNavigatorProperties('userAgent'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
|
const getLanguages = () => ({
|
||||||
key: 'languages',
|
key: 'languages',
|
||||||
title: 'Languages',
|
title: 'Languages',
|
||||||
value: navigator.languages,
|
value: navigator.languages,
|
||||||
issues: checkNavigatorProperties('languages'),
|
issues: checkNavigatorProperties('languages'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
|
const getCookieEnabled = () => ({
|
||||||
key: 'cookieEnabled',
|
key: 'cookieEnabled',
|
||||||
title: 'Cookies enabled',
|
title: 'Cookies enabled',
|
||||||
value: navigator.cookieEnabled ? 'True' : 'False',
|
value: navigator.cookieEnabled ? 'True' : 'False',
|
||||||
issues: checkNavigatorProperties('cookieEnabled'),
|
issues: checkNavigatorProperties('cookieEnabled'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
|
const getDoNotTrack = () => ({
|
||||||
key: 'doNotTrack',
|
key: 'doNotTrack',
|
||||||
title: 'Do not track header',
|
title: 'Do not track header',
|
||||||
value: navigator.doNotTrack ? 'True' : 'False',
|
value: navigator.doNotTrack ? 'True' : 'False',
|
||||||
issues: checkNavigatorProperties('doNotTrack'),
|
issues: checkNavigatorProperties('doNotTrack'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
|
const getWebDriver = () => ({
|
||||||
key: 'webdriver',
|
key: 'webdriver',
|
||||||
title: 'Webdriver',
|
title: 'Webdriver',
|
||||||
value: navigator.webdriver ? 'True' : 'False',
|
value: navigator.webdriver ? 'True' : 'False',
|
||||||
issues: checkNavigatorProperties('webdriver'),
|
issues: checkNavigatorProperties('webdriver'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
|
const getPlugins = () => ({
|
||||||
key: 'plugins',
|
key: 'plugins',
|
||||||
title: 'Plugins',
|
title: 'Plugins',
|
||||||
value: sortPlugins(navigator.plugins),
|
value: sortPlugins(navigator.plugins),
|
||||||
issues: checkNavigatorProperties('plugins'),
|
issues: checkNavigatorProperties('plugins'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
|
const getVendor = () => ({
|
||||||
key: 'vendor',
|
key: 'vendor',
|
||||||
title: 'Vendor',
|
title: 'Vendor',
|
||||||
value: navigator.vendor,
|
value: navigator.vendor,
|
||||||
issues: checkNavigatorProperties('vendor'),
|
issues: checkNavigatorProperties('vendor'),
|
||||||
},
|
});
|
||||||
{
|
|
||||||
key: 'appVersion',
|
const getAppVersion = () => ({
|
||||||
title: 'App version',
|
key: 'vendor',
|
||||||
value: navigator.appVersion,
|
title: 'Vendor',
|
||||||
issues: checkNavigatorProperties('appVersion'),
|
value: navigator.vendor,
|
||||||
},
|
issues: checkNavigatorProperties('vendor'),
|
||||||
{
|
});
|
||||||
|
|
||||||
|
const getProductSub = () => ({
|
||||||
key: 'productSub',
|
key: 'productSub',
|
||||||
title: 'Product sub',
|
title: 'Product sub',
|
||||||
value: navigator.productSub,
|
value: navigator.productSub,
|
||||||
issues: checkNavigatorProperties('productSub'),
|
issues: checkNavigatorProperties('productSub'),
|
||||||
},
|
});
|
||||||
|
|
||||||
|
const getNavigator = () => [
|
||||||
|
getDeviceMemory(),
|
||||||
|
getHardwareConcurrency(),
|
||||||
|
getMaxTouchPoints(),
|
||||||
|
getPlatform(),
|
||||||
|
getUserAgent(),
|
||||||
|
getLanguage(),
|
||||||
|
getLanguages(),
|
||||||
|
getCookieEnabled(),
|
||||||
|
getDoNotTrack(),
|
||||||
|
getWebDriver(),
|
||||||
|
getPlugins(),
|
||||||
|
getVendor(),
|
||||||
|
getAppVersion(),
|
||||||
|
getProductSub(),
|
||||||
];
|
];
|
||||||
return data;
|
|
||||||
};
|
|
||||||
|
|
||||||
// sorts plugins object into comma separated list
|
// sorts plugins object into comma separated list
|
||||||
const sortPlugins = (data) => {
|
const sortPlugins = (data) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue