diff --git a/frontend/src/components/Blocks.js b/frontend/src/components/Blocks.js index 472cb24..8901bed 100644 --- a/frontend/src/components/Blocks.js +++ b/frontend/src/components/Blocks.js @@ -32,7 +32,7 @@ const Blocks = () => { {/* */} - {/* */} +
( +const IntlBlock = ({ workerData }) => (

Intl

- - - {/*
-
- {Object.entries(Intl.DateTimeFormat().resolvedOptions()).map((item) => ( - - - - - - - - ))} -
{item[0]}{item[1]} - -
-
*/} +

Explanation: JavaScript can be used to find information about your hardware. This information can be used to create a fingerprint. @@ -32,4 +14,4 @@ const DateBlock = () => ( ); -export default DateBlock; +export default IntlBlock; diff --git a/frontend/src/utils/intl.js b/frontend/src/utils/intl.js new file mode 100644 index 0000000..bb58eae --- /dev/null +++ b/frontend/src/utils/intl.js @@ -0,0 +1,24 @@ +import { checkWebWorker } from './common'; + +const getLocale = (locale) => ({ + key: 'Locale', + value: Intl.DateTimeFormat().resolvedOptions().locale, + issues: [ + checkWebWorker(Intl.DateTimeFormat().resolvedOptions().locale, locale), + ], +}); + +const getTimezone = (timeZone) => ({ + key: 'Timezone', + value: Intl.DateTimeFormat().resolvedOptions().timeZone, + issues: [ + checkWebWorker(Intl.DateTimeFormat().resolvedOptions().timeZone, timeZone), + ], +}); + +const getIntl = (workerData) => [ + getLocale(workerData.locale), + getTimezone(workerData.timeZone), +]; + +export default getIntl;