Switch intl block
This commit is contained in:
parent
49136b1996
commit
75e3c33ba2
4 changed files with 32 additions and 45 deletions
|
|
@ -8,7 +8,9 @@ import { ReactComponent as CheckCircle } from '../images/checkCircle.svg';
|
||||||
const DateBlock = () => (
|
const DateBlock = () => (
|
||||||
<ScanBlock>
|
<ScanBlock>
|
||||||
<h1>Intl</h1>
|
<h1>Intl</h1>
|
||||||
<div className="tableWrap">
|
<Table type="navigator" data={getIntl()} />
|
||||||
|
|
||||||
|
{/* <div className="tableWrap">
|
||||||
<table>
|
<table>
|
||||||
{Object.entries(Intl.DateTimeFormat().resolvedOptions()).map((item) => (
|
{Object.entries(Intl.DateTimeFormat().resolvedOptions()).map((item) => (
|
||||||
<tbody key={item[0]}>
|
<tbody key={item[0]}>
|
||||||
|
|
@ -22,7 +24,7 @@ const DateBlock = () => (
|
||||||
</tbody>
|
</tbody>
|
||||||
))}
|
))}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div> */}
|
||||||
<p>
|
<p>
|
||||||
<b>Explanation:</b> JavaScript can be used to find information about your
|
<b>Explanation:</b> JavaScript can be used to find information about your
|
||||||
hardware. This information can be used to create a fingerprint.
|
hardware. This information can be used to create a fingerprint.
|
||||||
|
|
|
||||||
|
|
@ -31,17 +31,15 @@ const TableRow = ({ item }) => {
|
||||||
const [issues, setIssues] = useState(false);
|
const [issues, setIssues] = useState(false);
|
||||||
const [modalIsOpen, setIsOpen] = useState(false);
|
const [modalIsOpen, setIsOpen] = useState(false);
|
||||||
|
|
||||||
function openModal() {
|
const openModal = () => {
|
||||||
if (issues) setIsOpen(true);
|
if (issues) setIsOpen(true);
|
||||||
}
|
};
|
||||||
|
|
||||||
function afterOpenModal() {
|
const afterOpenModal = () => {};
|
||||||
// references are now sync'd and can be accessed.
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeModal() {
|
const closeModal = () => {
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
}
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (item.issues.filter(Boolean).length !== 0) {
|
if (item.issues.filter(Boolean).length !== 0) {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ export {
|
||||||
|
|
||||||
const getDeviceMemory = () => ({
|
const getDeviceMemory = () => ({
|
||||||
key: 'deviceMemory',
|
key: 'deviceMemory',
|
||||||
title: 'Device memory',
|
|
||||||
value: navigator.deviceMemory,
|
value: navigator.deviceMemory,
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('deviceMemory'),
|
checkNavigatorProperties('deviceMemory'),
|
||||||
|
|
@ -25,7 +24,6 @@ const getDeviceMemory = () => ({
|
||||||
|
|
||||||
const getHardwareConcurrency = () => ({
|
const getHardwareConcurrency = () => ({
|
||||||
key: 'hardwareConcurrency',
|
key: 'hardwareConcurrency',
|
||||||
title: 'Hardware Concurrency',
|
|
||||||
value: navigator.hardwareConcurrency,
|
value: navigator.hardwareConcurrency,
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('hardwareConcurrency'),
|
checkNavigatorProperties('hardwareConcurrency'),
|
||||||
|
|
@ -36,7 +34,6 @@ const getHardwareConcurrency = () => ({
|
||||||
|
|
||||||
const getMaxTouchPoints = () => ({
|
const getMaxTouchPoints = () => ({
|
||||||
key: 'maxTouchPoints',
|
key: 'maxTouchPoints',
|
||||||
title: 'Max touchpoints',
|
|
||||||
value: navigator.maxTouchPoints,
|
value: navigator.maxTouchPoints,
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('maxTouchPoints'),
|
checkNavigatorProperties('maxTouchPoints'),
|
||||||
|
|
@ -47,7 +44,6 @@ const getMaxTouchPoints = () => ({
|
||||||
|
|
||||||
const getPlatform = () => ({
|
const getPlatform = () => ({
|
||||||
key: 'platform',
|
key: 'platform',
|
||||||
title: 'Platform',
|
|
||||||
value: navigator.platform,
|
value: navigator.platform,
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('platform'),
|
checkNavigatorProperties('platform'),
|
||||||
|
|
@ -58,7 +54,6 @@ const getPlatform = () => ({
|
||||||
|
|
||||||
const getUserAgent = () => ({
|
const getUserAgent = () => ({
|
||||||
key: 'userAgent',
|
key: 'userAgent',
|
||||||
title: 'User agent',
|
|
||||||
value: navigator.userAgent,
|
value: navigator.userAgent,
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('userAgent'),
|
checkNavigatorProperties('userAgent'),
|
||||||
|
|
@ -69,7 +64,6 @@ const getUserAgent = () => ({
|
||||||
|
|
||||||
const getLanguage = () => ({
|
const getLanguage = () => ({
|
||||||
key: 'language',
|
key: 'language',
|
||||||
title: 'Language',
|
|
||||||
value: navigator.language,
|
value: navigator.language,
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('language'),
|
checkNavigatorProperties('language'),
|
||||||
|
|
@ -80,7 +74,6 @@ const getLanguage = () => ({
|
||||||
|
|
||||||
const getLanguages = () => ({
|
const getLanguages = () => ({
|
||||||
key: 'languages',
|
key: 'languages',
|
||||||
title: 'Languages',
|
|
||||||
value: navigator.languages,
|
value: navigator.languages,
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('languages'),
|
checkNavigatorProperties('languages'),
|
||||||
|
|
@ -91,7 +84,6 @@ const getLanguages = () => ({
|
||||||
|
|
||||||
const getCookieEnabled = () => ({
|
const getCookieEnabled = () => ({
|
||||||
key: 'cookieEnabled',
|
key: 'cookieEnabled',
|
||||||
title: 'Cookies enabled',
|
|
||||||
value: navigator.cookieEnabled ? 'True' : 'False',
|
value: navigator.cookieEnabled ? 'True' : 'False',
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('cookieEnabled'),
|
checkNavigatorProperties('cookieEnabled'),
|
||||||
|
|
@ -102,7 +94,6 @@ const getCookieEnabled = () => ({
|
||||||
|
|
||||||
const getDoNotTrack = () => ({
|
const getDoNotTrack = () => ({
|
||||||
key: 'doNotTrack',
|
key: 'doNotTrack',
|
||||||
title: 'Do not track header',
|
|
||||||
value: navigator.doNotTrack ? 'True' : 'False',
|
value: navigator.doNotTrack ? 'True' : 'False',
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('doNotTrack'),
|
checkNavigatorProperties('doNotTrack'),
|
||||||
|
|
@ -113,7 +104,6 @@ const getDoNotTrack = () => ({
|
||||||
|
|
||||||
const getWebDriver = () => ({
|
const getWebDriver = () => ({
|
||||||
key: 'webdriver',
|
key: 'webdriver',
|
||||||
title: 'Webdriver',
|
|
||||||
value: navigator.webdriver ? 'True' : 'False',
|
value: navigator.webdriver ? 'True' : 'False',
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('webdriver'),
|
checkNavigatorProperties('webdriver'),
|
||||||
|
|
@ -124,7 +114,6 @@ const getWebDriver = () => ({
|
||||||
|
|
||||||
const getPlugins = () => ({
|
const getPlugins = () => ({
|
||||||
key: 'plugins',
|
key: 'plugins',
|
||||||
title: 'Plugins',
|
|
||||||
value: sortPlugins(navigator.plugins),
|
value: sortPlugins(navigator.plugins),
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('plugins'),
|
checkNavigatorProperties('plugins'),
|
||||||
|
|
@ -135,7 +124,6 @@ const getPlugins = () => ({
|
||||||
|
|
||||||
const getVendor = () => ({
|
const getVendor = () => ({
|
||||||
key: 'vendor',
|
key: 'vendor',
|
||||||
title: 'Vendor',
|
|
||||||
value: navigator.vendor,
|
value: navigator.vendor,
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('vendor'),
|
checkNavigatorProperties('vendor'),
|
||||||
|
|
@ -146,7 +134,6 @@ const getVendor = () => ({
|
||||||
|
|
||||||
const getAppVersion = () => ({
|
const getAppVersion = () => ({
|
||||||
key: 'appVersion',
|
key: 'appVersion',
|
||||||
title: 'App Version',
|
|
||||||
value: navigator.appVersion,
|
value: navigator.appVersion,
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('appVersion'),
|
checkNavigatorProperties('appVersion'),
|
||||||
|
|
@ -157,7 +144,6 @@ const getAppVersion = () => ({
|
||||||
|
|
||||||
const getProductSub = () => ({
|
const getProductSub = () => ({
|
||||||
key: 'productSub',
|
key: 'productSub',
|
||||||
title: 'Product sub',
|
|
||||||
value: navigator.productSub,
|
value: navigator.productSub,
|
||||||
issues: [
|
issues: [
|
||||||
checkNavigatorProperties('productSub'),
|
checkNavigatorProperties('productSub'),
|
||||||
|
|
@ -168,7 +154,6 @@ const getProductSub = () => ({
|
||||||
|
|
||||||
const getWidth = () => ({
|
const getWidth = () => ({
|
||||||
key: 'width',
|
key: 'width',
|
||||||
title: 'Width',
|
|
||||||
value: window.screen.width,
|
value: window.screen.width,
|
||||||
issues: [
|
issues: [
|
||||||
checkScreenProperties('width'),
|
checkScreenProperties('width'),
|
||||||
|
|
@ -180,7 +165,6 @@ const getWidth = () => ({
|
||||||
|
|
||||||
const getOuterWidth = () => ({
|
const getOuterWidth = () => ({
|
||||||
key: 'outerWidth',
|
key: 'outerWidth',
|
||||||
title: 'Outer width',
|
|
||||||
value: window.outerWidth,
|
value: window.outerWidth,
|
||||||
// issues: checkWindowProperties('outerWidth'),
|
// issues: checkWindowProperties('outerWidth'),
|
||||||
issues: [],
|
issues: [],
|
||||||
|
|
@ -188,7 +172,6 @@ const getOuterWidth = () => ({
|
||||||
|
|
||||||
const getAvailWidth = () => ({
|
const getAvailWidth = () => ({
|
||||||
key: 'availWidth',
|
key: 'availWidth',
|
||||||
title: 'Avail width',
|
|
||||||
value: window.screen.availWidth,
|
value: window.screen.availWidth,
|
||||||
issues: [
|
issues: [
|
||||||
checkScreenProperties('availWidth'),
|
checkScreenProperties('availWidth'),
|
||||||
|
|
@ -200,7 +183,6 @@ const getAvailWidth = () => ({
|
||||||
|
|
||||||
const getHeight = () => ({
|
const getHeight = () => ({
|
||||||
key: 'height',
|
key: 'height',
|
||||||
title: 'Height',
|
|
||||||
value: window.screen.height,
|
value: window.screen.height,
|
||||||
issues: [
|
issues: [
|
||||||
checkScreenProperties('height'),
|
checkScreenProperties('height'),
|
||||||
|
|
@ -211,7 +193,6 @@ const getHeight = () => ({
|
||||||
|
|
||||||
const getOuterHeight = () => ({
|
const getOuterHeight = () => ({
|
||||||
key: 'outerHeight',
|
key: 'outerHeight',
|
||||||
title: 'Outer height',
|
|
||||||
value: window.outerHeight,
|
value: window.outerHeight,
|
||||||
// issues: checkWindowProperties('outerHeight'),
|
// issues: checkWindowProperties('outerHeight'),
|
||||||
issues: [],
|
issues: [],
|
||||||
|
|
@ -219,7 +200,6 @@ const getOuterHeight = () => ({
|
||||||
|
|
||||||
const getAvailHeight = () => ({
|
const getAvailHeight = () => ({
|
||||||
key: 'availHeight',
|
key: 'availHeight',
|
||||||
title: 'Avail height',
|
|
||||||
value: window.screen.availHeight,
|
value: window.screen.availHeight,
|
||||||
issues: [
|
issues: [
|
||||||
checkScreenProperties('availHeight'),
|
checkScreenProperties('availHeight'),
|
||||||
|
|
@ -231,7 +211,6 @@ const getAvailHeight = () => ({
|
||||||
|
|
||||||
const getPixelDepth = () => ({
|
const getPixelDepth = () => ({
|
||||||
key: 'pixelDepth',
|
key: 'pixelDepth',
|
||||||
title: 'Pixel depth',
|
|
||||||
value: window.screen.pixelDepth,
|
value: window.screen.pixelDepth,
|
||||||
issues: [
|
issues: [
|
||||||
checkScreenProperties('pixelDepth'),
|
checkScreenProperties('pixelDepth'),
|
||||||
|
|
@ -242,7 +221,6 @@ const getPixelDepth = () => ({
|
||||||
|
|
||||||
const getColorDepth = () => ({
|
const getColorDepth = () => ({
|
||||||
key: 'colorDepth',
|
key: 'colorDepth',
|
||||||
title: 'Color depth',
|
|
||||||
value: window.screen.colorDepth,
|
value: window.screen.colorDepth,
|
||||||
issues: [
|
issues: [
|
||||||
checkScreenProperties('colorDepth'),
|
checkScreenProperties('colorDepth'),
|
||||||
|
|
@ -286,28 +264,31 @@ const getScreen = () => [
|
||||||
// issues: [],
|
// issues: [],
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
const getLocale = () => ({
|
||||||
|
key: 'locale',
|
||||||
|
value: Intl.DateTimeFormat().resolvedOptions().locale,
|
||||||
|
issues: [],
|
||||||
|
});
|
||||||
|
|
||||||
const getTimezone = () => ({
|
const getTimezone = () => ({
|
||||||
key: 'timezone',
|
key: 'timezone',
|
||||||
title: 'Timezone',
|
|
||||||
value: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
value: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||||
issues: [],
|
issues: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
const getHourCycle = () => ({
|
// const getHourCycle = () => ({
|
||||||
key: 'hourCycle',
|
// key: 'hourCycle',
|
||||||
title: 'Hour cycle',
|
// value: Intl.DateTimeFormat().resolvedOptions().hourCycle,
|
||||||
value: Intl.DateTimeFormat().resolvedOptions().hourCycle,
|
// issues: [],
|
||||||
issues: [],
|
// });
|
||||||
});
|
|
||||||
|
|
||||||
const getCalendar = () => ({
|
// const getCalendar = () => ({
|
||||||
key: 'calendar',
|
// key: 'calendar',
|
||||||
title: 'Calendar',
|
// value: Intl.DateTimeFormat().resolvedOptions().calendar,
|
||||||
value: Intl.DateTimeFormat().resolvedOptions().calendar,
|
// issues: [],
|
||||||
issues: [],
|
// });
|
||||||
});
|
|
||||||
|
|
||||||
const getIntl = () => [getTimezone(), getHourCycle(), getCalendar()];
|
const getIntl = () => [getLocale(), getTimezone()];
|
||||||
|
|
||||||
const detectTor = () => {
|
const detectTor = () => {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
--text: #4b5563;
|
--text: #4b5563;
|
||||||
--border: #ddd;
|
--border: #ddd;
|
||||||
--issueBackground: #f8d7da;
|
--issueBackground: #f8d7da;
|
||||||
|
--issueHover: #f4c1c6;
|
||||||
--issueBorder: #f5c6cb;
|
--issueBorder: #f5c6cb;
|
||||||
--issueText: #721c24;
|
--issueText: #721c24;
|
||||||
}
|
}
|
||||||
|
|
@ -221,6 +222,11 @@ input[type='text'] {
|
||||||
background-color: var(--issueBackground);
|
background-color: var(--issueBackground);
|
||||||
color: var(--issueText);
|
color: var(--issueText);
|
||||||
border: 1px solid var(--issueBorder);
|
border: 1px solid var(--issueBorder);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.issue:hover {
|
||||||
|
background-color: var(--issueHover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.newline {
|
.newline {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue