Printing out array on newline instead of using <br/>

This commit is contained in:
z0ccc 2021-09-07 14:32:43 -04:00
parent cf939c2bd3
commit fc5edc6c22
4 changed files with 57 additions and 17 deletions

View file

@ -12,7 +12,7 @@ import FiltersBlock from './FiltersBlock';
const ScanBlocks = () => ( const ScanBlocks = () => (
<> <>
<ScreenBlock /> <ScreenBlock />
<NavigatorBlock /> {/* <NavigatorBlock /> */}
{/* <LocationBlock /> {/* <LocationBlock />
<ConnectionBlock /> */} <ConnectionBlock /> */}
{/* <FingerprintBlock /> {/* <FingerprintBlock />

View file

@ -29,7 +29,9 @@ const TableRow = ({ item }) => {
<td>{item.title}</td> <td>{item.title}</td>
<td>{item.value}</td> <td>{item.value}</td>
<td> <td>
{parse(item.issues || '')} {item.issues.map((ele) => (
<div className="newline">{ele}</div>
))}
{parse(workerData)} {parse(workerData)}
</td> </td>
</tr> </tr>

View file

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
/* eslint-disable dot-notation */ /* eslint-disable dot-notation */
export { export {
getNavigator, getNavigator,
@ -109,7 +110,12 @@ const getWidth = () => ({
key: 'width', key: 'width',
title: 'Width', title: 'Width',
value: window.screen.width, value: window.screen.width,
issues: checkScreenProperties('width') + checkWidth(), issues: [
checkScreenProperties('width'),
checkScreenValue('width'),
checkScreenPrototype('width'),
checkWidth(),
],
}); });
const getOuterWidth = () => ({ const getOuterWidth = () => ({
@ -182,13 +188,13 @@ const getNavigator = () => [
const getScreen = () => [ const getScreen = () => [
getWidth(), getWidth(),
getAvailWidth(), // getAvailWidth(),
getOuterWidth(), // getOuterWidth(),
getHeight(), // getHeight(),
getAvailHeight(), // getAvailHeight(),
getOuterHeight(), // getOuterHeight(),
getPixelDepth(), // getPixelDepth(),
getColorDepth(), // getColorDepth(),
]; ];
// sorts plugins object into comma separated list // sorts plugins object into comma separated list
@ -225,26 +231,54 @@ const checkNavigatorProperties = (key) => {
return list.toString().split(',').join('<br />'); return list.toString().split(',').join('<br />');
}; };
// const checkScreenProperties = (key) => {
// const list = [];
// if (Object.getOwnPropertyDescriptor(window.screen, key) !== undefined) {
// list.push('Failed undefined properties');
// }
// if (
// Object.getOwnPropertyDescriptor(Screen.prototype, key).value !== undefined
// ) {
// list.push('Failed descriptor.value undefined');
// }
// try {
// // eslint-disable-next-line no-unused-vars
// const check = Screen.prototype[key];
// list.push('Failed Navigator.prototype');
// } catch (err) {
// // eslint-disable-next-line no-unused-vars
// const check = '';
// }
// return list.toString().split(',').join('<br />');
// };
const checkScreenProperties = (key) => { const checkScreenProperties = (key) => {
const list = [];
if (Object.getOwnPropertyDescriptor(window.screen, key) !== undefined) { if (Object.getOwnPropertyDescriptor(window.screen, key) !== undefined) {
list.push('Failed undefined properties'); return 'Failed undefined properties';
} }
return null;
};
const checkScreenValue = (key) => {
if ( if (
Object.getOwnPropertyDescriptor(Screen.prototype, key).value !== undefined Object.getOwnPropertyDescriptor(Screen.prototype, key).value !== undefined
) { ) {
list.push('Failed descriptor.value undefined'); return 'Failed descriptor.value undefined';
} }
return null;
};
const checkScreenPrototype = (key) => {
try { try {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const check = Screen.prototype[key]; const check = Screen.prototype[key];
list.push('Failed Navigator.prototype'); return 'Failed Navigator.prototype';
} catch (err) { } catch (err) {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const check = ''; const check = '';
} }
return null;
return list.toString().split(',').join('<br />');
}; };
// const checkWindowProperties = (key) => { // const checkWindowProperties = (key) => {
@ -268,7 +302,7 @@ const checkScreenProperties = (key) => {
const checkWidth = () => { const checkWidth = () => {
if (window.screen.availWidth > window.screen.width) { if (window.screen.availWidth > window.screen.width) {
return '<br />Avail width is wider then width'; return 'Avail width is wider then width';
} }
return ''; return '';
}; };

View file

@ -213,6 +213,10 @@ input[type='text'] {
border: 1px solid var(--issueBorder); border: 1px solid var(--issueBorder);
} }
.newline {
display: block;
}
@media screen and (max-width: 500px) { @media screen and (max-width: 500px) {
.github { .github {
width: 24px; width: 24px;