Added DateBlock

This commit is contained in:
z0ccc 2021-09-13 23:15:37 -04:00
parent b6314363ac
commit 8ce91d8f12
4 changed files with 73 additions and 5 deletions

View file

@ -0,0 +1,16 @@
import ScanBlock from './ScanBlock';
import Table from './Table';
import { getDate } from './main';
const DateBlock = () => (
<ScanBlock>
<h1>Date</h1>
<Table type="navigator" data={getDate()} />
<p>
<b>Explanation:</b> JavaScript can be used to find information about your
hardware. This information can be used to create a fingerprint.
</p>
</ScanBlock>
);
export default DateBlock;

View file

@ -1,5 +1,6 @@
/* eslint-disable no-unused-vars */ /* eslint-disable no-unused-vars */
import UserAgentBlock from './UserAgentBlock'; import UserAgentBlock from './UserAgentBlock';
import DateBlock from './DateBlock';
import OtherBlock from './OtherBlock'; import OtherBlock from './OtherBlock';
import NavigatorBlock from './NavigatorBlock'; import NavigatorBlock from './NavigatorBlock';
import ScreenBlock from './ScreenBlock'; import ScreenBlock from './ScreenBlock';
@ -13,12 +14,14 @@ import FiltersBlock from './FiltersBlock';
const ScanBlocks = () => ( const ScanBlocks = () => (
<> <>
<OtherBlock /> <DateBlock />
<UserAgentBlock /> <FingerprintBlock />
<ScreenBlock />
<NavigatorBlock />
<LocationBlock /> <LocationBlock />
<ConnectionBlock /> <ConnectionBlock />
<NavigatorBlock />
<UserAgentBlock />
<ScreenBlock />
<OtherBlock />
{/* <FingerprintBlock /> {/* <FingerprintBlock />
<LocationBlock /> <LocationBlock />
<ConnectionBlock /> <ConnectionBlock />

View file

@ -7,8 +7,8 @@ import {
checkNavigatorProperties, checkNavigatorProperties,
checkWebWorker, checkWebWorker,
checkScreenProperties, checkScreenProperties,
getUserAgentData,
} from './main'; } from './main';
import { ReactComponent as CheckCircle } from '../images/checkCircle.svg';
const UserAgentBlock = () => { const UserAgentBlock = () => {
const [firstRender, setfirstRender] = useState(true); const [firstRender, setfirstRender] = useState(true);
@ -37,12 +37,18 @@ const UserAgentBlock = () => {
<tr> <tr>
<td>Browser</td> <td>Browser</td>
<td>{userAgent.browser.name}</td> <td>{userAgent.browser.name}</td>
<td>
<CheckCircle className="circleButton" />
</td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
<tr> <tr>
<td>Browser version</td> <td>Browser version</td>
<td>{userAgent.browser.version}</td> <td>{userAgent.browser.version}</td>
<td>
<CheckCircle className="circleButton" />
</td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
@ -51,12 +57,18 @@ const UserAgentBlock = () => {
<td> <td>
{userAgent.os.name} {userAgent.os.versionName} {userAgent.os.name} {userAgent.os.versionName}
</td> </td>
<td>
<CheckCircle className="circleButton" />
</td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
<tr> <tr>
<td>OS version</td> <td>OS version</td>
<td>{userAgent.os.version}</td> <td>{userAgent.os.version}</td>
<td>
<CheckCircle className="circleButton" />
</td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
@ -65,12 +77,18 @@ const UserAgentBlock = () => {
<td> <td>
{userAgent.engine.name} {userAgent.engine.version} {userAgent.engine.name} {userAgent.engine.version}
</td> </td>
<td>
<CheckCircle className="circleButton" />
</td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
<tr> <tr>
<td>Platform type</td> <td>Platform type</td>
<td>{userAgent.platform.type}</td> <td>{userAgent.platform.type}</td>
<td>
<CheckCircle className="circleButton" />
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -9,6 +9,7 @@ export {
getScreen, getScreen,
checkScreenProperties, checkScreenProperties,
detectTor, detectTor,
getDate,
}; };
const getDeviceMemory = () => ({ const getDeviceMemory = () => ({
@ -278,6 +279,36 @@ const getScreen = () => [
getColorDepth(), getColorDepth(),
]; ];
const getDateNow = () => ({
key: 'date',
title: 'Date',
value: Date.now(),
issues: [],
});
const getCalendar = () => ({
key: 'calendar',
title: 'Calendar',
value: Intl.DateTimeFormat().resolvedOptions().calendar,
issues: [],
});
const getTimezone = () => ({
key: 'timezone',
title: 'Timezone',
value: Intl.DateTimeFormat().resolvedOptions().timeZone,
issues: [],
});
const getTimezoneOffset = () => ({
key: 'timezoneOffset',
title: 'Timezone offset',
value: new Date().getTimezoneOffset(),
issues: [],
});
const getDate = () => [getCalendar(), getTimezone(), getTimezoneOffset()];
const detectTor = () => { const detectTor = () => {
const date = new Date(); const date = new Date();
if ( if (