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,
|
||||
checkWebWorker,
|
||||
checkScreenProperties,
|
||||
getUserAgentData,
|
||||
getOther,
|
||||
} from './main';
|
||||
|
||||
const OtherBlock = () => {
|
||||
|
|
@ -30,17 +30,7 @@ const OtherBlock = () => {
|
|||
return (
|
||||
<ScanBlock>
|
||||
<h1>Other</h1>
|
||||
{userAgent && (
|
||||
<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>
|
||||
)}
|
||||
<Table type="screen" data={getOther()} />
|
||||
<p>
|
||||
<b>Explanation:</b> JavaScript can be used to find information about
|
||||
your hardware. This information can be used to create a fingerprint.
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ import FiltersBlock from './FiltersBlock';
|
|||
|
||||
const ScanBlocks = () => (
|
||||
<>
|
||||
<UserAgentBlock />
|
||||
<OtherBlock />
|
||||
<UserAgentBlock />
|
||||
<ScreenBlock />
|
||||
<NavigatorBlock />
|
||||
<LocationBlock />
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ export {
|
|||
checkWebWorker,
|
||||
getScreen,
|
||||
checkScreenProperties,
|
||||
getBrowser,
|
||||
getUserAgentData,
|
||||
getOther,
|
||||
};
|
||||
|
||||
const getDeviceMemory = () => ({
|
||||
|
|
@ -279,25 +278,35 @@ const getScreen = () => [
|
|||
getColorDepth(),
|
||||
];
|
||||
|
||||
const getUserAgentData = (userAgent) => {
|
||||
// getBrowser();
|
||||
console.log(userAgent);
|
||||
};
|
||||
|
||||
// const getBrowser = (userAgent) => {
|
||||
// if (navigator.brave) {
|
||||
// return 'Brave';
|
||||
// }
|
||||
// return userAgent;
|
||||
// };
|
||||
|
||||
const getBrowser = () => ({
|
||||
key: 'Browser',
|
||||
title: 'Color depth',
|
||||
value: window.screen.colorDepth,
|
||||
const getBrave = () => ({
|
||||
key: 'brave',
|
||||
title: 'Brave browser',
|
||||
value: navigator.brave ? 'True' : 'False',
|
||||
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
|
||||
const sortPlugins = (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