Steps to reproduce:
- Add this rule:
example.org#%#//scriptlet('spoof-css', 'body', 'visibility', 'hidden')
- Go to - https://example.org/
- In browser console run:
const { height, width } = document.body.getBoundingClientRect();
console.log('height:', height);
console.log('width:', width);
width returns incorrect value.
It's probably due to this line:
|
const newDOMRect = new window.DOMRect(rect.x, rect.y, top, bottom, width, height, left, right); |
and perhaps should be changed to:
const newDOMRect = new window.DOMRect(rect.x, rect.y, width, height);
https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/DOMRect
Steps to reproduce:
widthreturns incorrect value.It's probably due to this line:
Scriptlets/src/scriptlets/spoof-css.js
Line 212 in 3ba245f
and perhaps should be changed to:
https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/DOMRect