From db248be3020a6e93e94a545913b9fe93935ee52e Mon Sep 17 00:00:00 2001 From: z0ccc Date: Mon, 6 Sep 2021 19:38:36 -0400 Subject: [PATCH] Display webworker value --- frontend/src/components/main.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/main.js b/frontend/src/components/main.js index 04fabb5..9c84a9b 100644 --- a/frontend/src/components/main.js +++ b/frontend/src/components/main.js @@ -116,6 +116,7 @@ const getOuterWidth = () => ({ key: 'outerWidth', title: 'Outer width', value: window.outerWidth, + // issues: checkWindowProperties('outerWidth'), issues: '', }); @@ -137,6 +138,7 @@ const getOuterHeight = () => ({ key: 'outerHeight', title: 'Outer height', value: window.outerHeight, + // issues: checkWindowProperties('outerHeight'), issues: '', }); @@ -245,6 +247,25 @@ const checkScreenProperties = (key) => { return list.toString().split(',').join('
'); }; +// 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('
'); +// }; + const checkWebWorker = (key, setWorkerData) => { let w; if (typeof w === 'undefined') { @@ -256,7 +277,9 @@ const checkWebWorker = (key, setWorkerData) => { event.data !== undefined && event.data.toString() !== navigator[key].toString() ) { - setWorkerData('
Did not match web worker'); + setWorkerData( + `
Did not match web worker (${event.data.toString()})` + ); } }; };