Detect brave and tor browser
This commit is contained in:
parent
de768f53cc
commit
c9d7254c4d
3 changed files with 30 additions and 38 deletions
|
|
@ -7,7 +7,7 @@ import {
|
||||||
checkNavigatorProperties,
|
checkNavigatorProperties,
|
||||||
checkWebWorker,
|
checkWebWorker,
|
||||||
checkScreenProperties,
|
checkScreenProperties,
|
||||||
getUserAgentData,
|
getOther,
|
||||||
} from './main';
|
} from './main';
|
||||||
|
|
||||||
const OtherBlock = () => {
|
const OtherBlock = () => {
|
||||||
|
|
@ -30,17 +30,7 @@ const OtherBlock = () => {
|
||||||
return (
|
return (
|
||||||
<ScanBlock>
|
<ScanBlock>
|
||||||
<h1>Other</h1>
|
<h1>Other</h1>
|
||||||
{userAgent && (
|
<Table type="screen" data={getOther()} />
|
||||||
<div className="boxWrap">
|
|
||||||
{/* <Table type="screen" data={getUserAgentData()} /> */}
|
|
||||||
{/* <div className="newline">
|
|
||||||
{getBrowser(userAgent.browser.name)} {userAgent.browser.version}
|
|
||||||
</div> */}
|
|
||||||
<div className="newline">
|
|
||||||
{userAgent.os.name} {userAgent.os.versionName}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<p>
|
<p>
|
||||||
<b>Explanation:</b> JavaScript can be used to find information about
|
<b>Explanation:</b> JavaScript can be used to find information about
|
||||||
your hardware. This information can be used to create a fingerprint.
|
your hardware. This information can be used to create a fingerprint.
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ import FiltersBlock from './FiltersBlock';
|
||||||
|
|
||||||
const ScanBlocks = () => (
|
const ScanBlocks = () => (
|
||||||
<>
|
<>
|
||||||
<UserAgentBlock />
|
|
||||||
<OtherBlock />
|
<OtherBlock />
|
||||||
|
<UserAgentBlock />
|
||||||
<ScreenBlock />
|
<ScreenBlock />
|
||||||
<NavigatorBlock />
|
<NavigatorBlock />
|
||||||
<LocationBlock />
|
<LocationBlock />
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@ export {
|
||||||
checkWebWorker,
|
checkWebWorker,
|
||||||
getScreen,
|
getScreen,
|
||||||
checkScreenProperties,
|
checkScreenProperties,
|
||||||
getBrowser,
|
getOther,
|
||||||
getUserAgentData,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDeviceMemory = () => ({
|
const getDeviceMemory = () => ({
|
||||||
|
|
@ -279,25 +278,35 @@ const getScreen = () => [
|
||||||
getColorDepth(),
|
getColorDepth(),
|
||||||
];
|
];
|
||||||
|
|
||||||
const getUserAgentData = (userAgent) => {
|
const getBrave = () => ({
|
||||||
// getBrowser();
|
key: 'brave',
|
||||||
console.log(userAgent);
|
title: 'Brave browser',
|
||||||
};
|
value: navigator.brave ? 'True' : 'False',
|
||||||
|
|
||||||
// const getBrowser = (userAgent) => {
|
|
||||||
// if (navigator.brave) {
|
|
||||||
// return 'Brave';
|
|
||||||
// }
|
|
||||||
// return userAgent;
|
|
||||||
// };
|
|
||||||
|
|
||||||
const getBrowser = () => ({
|
|
||||||
key: 'Browser',
|
|
||||||
title: 'Color depth',
|
|
||||||
value: window.screen.colorDepth,
|
|
||||||
issues: [],
|
issues: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const detectTor = () => {
|
||||||
|
const date = new Date();
|
||||||
|
if (
|
||||||
|
navigator.plugins.length === 0 &&
|
||||||
|
date.getTimezoneOffset() === 0 &&
|
||||||
|
window.outerWidth === window.screen.availWidth &&
|
||||||
|
window.outerHeight === window.screen.availHeight
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getTor = () => ({
|
||||||
|
key: 'tor',
|
||||||
|
title: 'Tor browser',
|
||||||
|
value: detectTor() ? 'True' : 'False',
|
||||||
|
issues: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
const getOther = () => [getBrave(), getTor()];
|
||||||
|
|
||||||
// sorts plugins object into comma separated list
|
// sorts plugins object into comma separated list
|
||||||
const sortPlugins = (data) => {
|
const sortPlugins = (data) => {
|
||||||
const { length } = data;
|
const { length } = data;
|
||||||
|
|
@ -396,10 +405,3 @@ const checkWebWorker = (key, setWorkerData) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// const getBrowser = (userAgent) => {
|
|
||||||
// if (navigator.brave) {
|
|
||||||
// return 'Brave';
|
|
||||||
// }
|
|
||||||
// return userAgent;
|
|
||||||
// };
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue