diff --git a/frontend/src/components/Blocks.js b/frontend/src/components/Blocks.js index 7565a41..472cb24 100644 --- a/frontend/src/components/Blocks.js +++ b/frontend/src/components/Blocks.js @@ -44,7 +44,7 @@ const Blocks = () => { connectionData={connectionData} /> - + ) : ( diff --git a/frontend/src/components/OtherBloc2.js b/frontend/src/components/OtherBloc2.js deleted file mode 100644 index b6cc975..0000000 --- a/frontend/src/components/OtherBloc2.js +++ /dev/null @@ -1,77 +0,0 @@ -/* eslint-disable arrow-body-style */ -/* eslint-disable no-unused-vars */ -import { useState, useEffect } from 'react'; -import Block from './Block'; -import { detectTor } from './main'; - -const OtherBlock = () => { - const [adBlockDetected, setAdBlockDetected] = useState(false); - const [batteryLevel, setBatteryLevel] = useState(); - const [batteryStatus, setBatteryStatus] = useState(); - - useEffect(() => { - fetch('https://www3.doubleclick.net', { - method: 'HEAD', - mode: 'no-cors', - cache: 'no-store', - }).catch(() => { - setAdBlockDetected(true); - }); - - navigator.getBattery().then((res) => { - setBatteryLevel(`${Math.round(res.level * 100)}%`); - setBatteryStatus(res.charging ? 'Charging' : 'Not charging'); - }); - }, []); - - return ( - -

Other

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Brave browser{navigator.brave ? 'True' : 'False'}
Tor Browser{detectTor() ? 'True' : 'False'}
Adblock{adBlockDetected ? 'True' : 'False'}
Timezone offset{new Date().getTimezoneOffset()}
Battery level{batteryLevel}
Battery status{batteryStatus}
-
-

- Explanation: JavaScript can be used to find information about - your hardware. This information can be used to create a fingerprint. -

-
- ); -}; -export default OtherBlock; diff --git a/frontend/src/components/OtherBlock.js b/frontend/src/components/OtherBlock.js index 65914e0..ae3efb0 100644 --- a/frontend/src/components/OtherBlock.js +++ b/frontend/src/components/OtherBlock.js @@ -5,7 +5,7 @@ import Block from './Block'; import Table from './Table'; import getOther from '../utils/other'; -const OtherBlock = ({ workerAgent }) => { +const OtherBlock = ({ workerData }) => { const [adBlock, setAdBlock] = useState(); const [battery, setBattery] = useState(); @@ -30,7 +30,7 @@ const OtherBlock = ({ workerAgent }) => {

Other

{battery && adBlock !== undefined && ( - +
)}

Explanation: JavaScript can be used to find information about diff --git a/frontend/src/utils/other.js b/frontend/src/utils/other.js index a7780ea..907df1f 100644 --- a/frontend/src/utils/other.js +++ b/frontend/src/utils/other.js @@ -22,13 +22,13 @@ const checkDatePrototype = () => { }; // Returns object with location data -const getOther = (battery, adBlock) => { +const getOther = (battery, adBlock, workerData) => { const workerAgentParsed = 1; return [ { key: 'Brave browser', value: navigator.brave ? 'True' : 'False', - issues: [], + issues: [checkWebWorker], }, { key: 'Tor browser', @@ -43,12 +43,21 @@ const getOther = (battery, adBlock) => { { key: 'Date', value: new Date().toString(), - issues: [checkDatePrototype()], + issues: [ + checkDatePrototype(), + checkWebWorker(new Date().toString(), workerData.date), + ], }, { key: 'Timezone offset', value: new Date().getTimezoneOffset(), - issues: [checkDatePrototype()], + issues: [ + checkDatePrototype(), + checkWebWorker( + new Date().getTimezoneOffset(), + workerData.timezoneOffset + ), + ], }, { key: 'Battery level',