Created
May 4, 2020 19:05
-
-
Save alexstandiford/fcf262fd35ab2361a145a7e17e5d5313 to your computer and use it in GitHub Desktop.
Overflow helper bookmarklet
This file contains 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
javascript:(function(){ const outline = document.querySelector('.outline-everything-with-red'); if(!outline){ style = document.createElement('style'); style.classList.add('outline-everything-with-red'); style.appendChild(document.createTextNode('* {outline: 1px solid red;}')); document.head.appendChild(style); console.log('The following elements appear to be wider than the document.'); [].forEach.call( document.querySelectorAll('*'), function(el) { if (el.offsetWidth > docWidth) { console.log(el); } } ); } else{ outline.remove(); } var docWidth = document.documentElement.offsetWidth; })() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment