Last active
April 30, 2026 15:51
-
-
Save Fasteroid/b10a7bd7b9591f39593a600b71a61aa2 to your computer and use it in GitHub Desktop.
created to stealthily inspect an css issue where the devtools overlays alone were enough to perturb it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let lastX = 0; | |
| let lastY = 0; | |
| let sameClicks = 0; | |
| document.addEventListener('click', (e) => { | |
| if( !e.ctrlKey ) return; | |
| if( lastX == e.x && lastY == e.y ){ | |
| sameClicks++; | |
| } | |
| else { | |
| sameClicks = 0; | |
| } | |
| lastX = e.x; | |
| lastY = e.y; | |
| let target = e.target; | |
| for (let i = 0; i < sameClicks; i++) { | |
| target = target?.parentElement; | |
| } | |
| console.log( | |
| target, | |
| { | |
| rect: target.getBoundingClientRect(), | |
| style: getComputedStyle(target) | |
| } | |
| ) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment