diff --git a/frontend/public/worker.js b/frontend/public/worker.js
index 51662e5..e988ea8 100644
--- a/frontend/public/worker.js
+++ b/frontend/public/worker.js
@@ -2,7 +2,6 @@ const data = {
locale: Intl.DateTimeFormat().resolvedOptions().locale,
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
timezoneOffset: new Date().getTimezoneOffset(),
- date: new Date().toString(),
deviceMemory: navigator.deviceMemory,
hardwareConcurrency: navigator.hardwareConcurrency,
platform: navigator.platform,
diff --git a/frontend/src/components/Blocks.js b/frontend/src/components/Blocks.js
index 8901bed..36af9d2 100644
--- a/frontend/src/components/Blocks.js
+++ b/frontend/src/components/Blocks.js
@@ -29,7 +29,7 @@ const Blocks = () => {
{connectionData ? (
<>
- {/*
*/}
+
diff --git a/frontend/src/components/FingerprintBlock.js b/frontend/src/components/FingerprintBlock.js
index 805487e..a3e0bb9 100644
--- a/frontend/src/components/FingerprintBlock.js
+++ b/frontend/src/components/FingerprintBlock.js
@@ -1,54 +1,24 @@
+/* eslint-disable no-unused-vars */
import { useState } from 'react';
import Block from './Block';
import Table from './Table';
-import {
- getHardware,
- getWebGL,
- getSoftware,
- getFingerprint,
- getHash,
- getName,
- handleSave,
-} from './mainOld';
+import getHash from '../utils/fingerprint';
-const FingerprintBlock = () => {
- const [name, setName] = useState('');
- const [load, setLoad] = useState(false);
- const [saved, setSaved] = useState('');
- const hash = getHash([...getHardware(), ...getWebGL(), ...getSoftware()]);
- getName(hash, setName, setLoad);
+const FingerprintBlock = ({ workerData }) => {
+ const hash = getHash(workerData);
+ console.log(hash);
return (
Fingerprint
- {load && (
- <>
- {name ? (
-
- ) : (
-
- )}
- >
- )}
+
Explanation: This is a unique identifier that can be used to
follow you around the web. Even if you clear cookies, change your IP or
use private mode the hash will stay the same. Enter your name below and
reload the page in private mode to test it out.
- {saved ? (
- Success! Re-scan browser.
- ) : (
-
- )}
);
};
diff --git a/frontend/src/components/FingerprintBlock2.js b/frontend/src/components/FingerprintBlock2.js
new file mode 100644
index 0000000..a67830f
--- /dev/null
+++ b/frontend/src/components/FingerprintBlock2.js
@@ -0,0 +1,61 @@
+import { useState } from 'react';
+import Block from './Block';
+import Table from './Table';
+import {
+ getHardware,
+ getWebGL,
+ getSoftware,
+ getFingerprint,
+ getHash,
+ getName,
+ handleSave,
+} from './mainOld';
+
+const FingerprintBlock = () => {
+ const [name, setName] = useState('');
+ const [load, setLoad] = useState(false);
+ const [saved, setSaved] = useState('');
+ const hash = getHash([...getHardware(), ...getWebGL(), ...getSoftware()]);
+ getName(hash, setName, setLoad);
+ return (
+
+ Fingerprint
+ {load && (
+ <>
+ {name ? (
+
+ ) : (
+
+ )}
+ >
+ )}
+
+ Explanation: This is a unique identifier that can be used to
+ follow you around the web. Even if you clear cookies, change your IP or
+ use private mode the hash will stay the same. Enter your name below and
+ reload the page in private mode to test it out.
+
+ {saved ? (
+ Success! Re-scan browser.
+ ) : (
+
+ )}
+
+ );
+};
+
+export default FingerprintBlock;
diff --git a/frontend/src/utils/fingerprint.js b/frontend/src/utils/fingerprint.js
new file mode 100644
index 0000000..7a4ea57
--- /dev/null
+++ b/frontend/src/utils/fingerprint.js
@@ -0,0 +1,5 @@
+import md5 from 'crypto-js/md5';
+
+const getHash = (data) => md5(JSON.stringify(data)).toString();
+
+export default getHash;
diff --git a/frontend/src/utils/other.js b/frontend/src/utils/other.js
index 907df1f..751860d 100644
--- a/frontend/src/utils/other.js
+++ b/frontend/src/utils/other.js
@@ -1,4 +1,3 @@
-/* eslint-disable no-unused-vars */
import { checkWebWorker } from './common';
const detectTor = () => {
@@ -22,54 +21,45 @@ const checkDatePrototype = () => {
};
// Returns object with location data
-const getOther = (battery, adBlock, workerData) => {
- const workerAgentParsed = 1;
- return [
- {
- key: 'Brave browser',
- value: navigator.brave ? 'True' : 'False',
- issues: [checkWebWorker],
- },
- {
- key: 'Tor browser',
- value: detectTor() ? 'True' : 'False',
- issues: [],
- },
- {
- key: 'Adblock',
- value: adBlock ? 'True' : 'False',
- issues: [],
- },
- {
- key: 'Date',
- value: new Date().toString(),
- issues: [
- checkDatePrototype(),
- checkWebWorker(new Date().toString(), workerData.date),
- ],
- },
- {
- key: 'Timezone offset',
- value: new Date().getTimezoneOffset(),
- issues: [
- checkDatePrototype(),
- checkWebWorker(
- new Date().getTimezoneOffset(),
- workerData.timezoneOffset
- ),
- ],
- },
- {
- key: 'Battery level',
- value: `${Math.round(battery.level * 100)}%`,
- issues: [],
- },
- {
- key: 'Battery status',
- value: battery.charging ? 'Charging' : 'Not charging',
- issues: [],
- },
- ];
-};
+const getOther = (battery, adBlock, workerData) => [
+ {
+ key: 'Brave browser',
+ value: navigator.brave ? 'True' : 'False',
+ issues: [checkWebWorker],
+ },
+ {
+ key: 'Tor browser',
+ value: detectTor() ? 'True' : 'False',
+ issues: [],
+ },
+ {
+ key: 'Adblock',
+ value: adBlock ? 'True' : 'False',
+ issues: [],
+ },
+ {
+ key: 'Date',
+ value: new Date().toString(),
+ issues: [checkDatePrototype()],
+ },
+ {
+ key: 'Timezone offset',
+ value: new Date().getTimezoneOffset(),
+ issues: [
+ checkDatePrototype(),
+ checkWebWorker(new Date().getTimezoneOffset(), workerData.timezoneOffset),
+ ],
+ },
+ {
+ key: 'Battery level',
+ value: `${Math.round(battery.level * 100)}%`,
+ issues: [],
+ },
+ {
+ key: 'Battery status',
+ value: battery.charging ? 'Charging' : 'Not charging',
+ issues: [],
+ },
+];
export default getOther;