Skip to content

Instantly share code, notes, and snippets.

@r-k-b
Last active May 26, 2016 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r-k-b/83a411a2cf4be4de7cd0bb60321f66a7 to your computer and use it in GitHub Desktop.
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?
// ==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