Last active
May 26, 2016 09:25
-
-
Save r-k-b/83a411a2cf4be4de7cd0bb60321f66a7 to your computer and use it in GitHub Desktop.
Find Over-Wide Elements :: What is pushing the page wider than the viewport, allowing that janky side scrolling?
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
// ==UserScript== | |
// @name Find Over-Wide Elements | |
// @namespace https://gist.github.com/r-k-b/ | |
// @version 1.0.0 | |
// @description What is pushing the page wider than the viewport, allowing that janky side scrolling? | |
// @author Robert K. Bell | |
// @homepage https://gist.github.com/r-k-b/83a411a2cf4be4de7cd0bb60321f66a7 | |
// @downloadURL https://gist.github.com/r-k-b/83a411a2cf4be4de7cd0bb60321f66a7/raw/find-overwide-elements.user.js | |
// @include *://*/* | |
// @grant none | |
// @run-at context-menu | |
// ==/UserScript== | |
/* jshint esnext: true */ | |
(() => { | |
var docWidth = document.documentElement.offsetWidth; | |
[].forEach.call( | |
document.querySelectorAll('*'), | |
function(el) { | |
if (el.offsetWidth > docWidth) { | |
console.log(el); | |
} | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment