Display webworker value

This commit is contained in:
z0ccc 2021-09-06 19:38:36 -04:00
parent 9601757902
commit db248be302

View file

@ -116,6 +116,7 @@ const getOuterWidth = () => ({
key: 'outerWidth', key: 'outerWidth',
title: 'Outer width', title: 'Outer width',
value: window.outerWidth, value: window.outerWidth,
// issues: checkWindowProperties('outerWidth'),
issues: '', issues: '',
}); });
@ -137,6 +138,7 @@ const getOuterHeight = () => ({
key: 'outerHeight', key: 'outerHeight',
title: 'Outer height', title: 'Outer height',
value: window.outerHeight, value: window.outerHeight,
// issues: checkWindowProperties('outerHeight'),
issues: '', issues: '',
}); });
@ -245,6 +247,25 @@ const checkScreenProperties = (key) => {
return list.toString().split(',').join('<br />'); return list.toString().split(',').join('<br />');
}; };
// const checkWindowProperties = (key) => {
// const list = [];
// if (
// Object.getOwnPropertyDescriptor(Window.prototype, key).value !== undefined
// ) {
// list.push('Failed descriptor.value undefined');
// }
// // try {
// // // eslint-disable-next-line no-unused-vars
// // const check = Window.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 checkWebWorker = (key, setWorkerData) => { const checkWebWorker = (key, setWorkerData) => {
let w; let w;
if (typeof w === 'undefined') { if (typeof w === 'undefined') {
@ -256,7 +277,9 @@ const checkWebWorker = (key, setWorkerData) => {
event.data !== undefined && event.data !== undefined &&
event.data.toString() !== navigator[key].toString() event.data.toString() !== navigator[key].toString()
) { ) {
setWorkerData('<br />Did not match web worker'); setWorkerData(
`<br />Did not match web worker (${event.data.toString()})`
);
} }
}; };
}; };