Find overflow in a page

PHOTO EMBED

Wed Aug 31 2022 11:21:37 GMT+0000 (Coordinated Universal Time)

Saved by @fostira #js #javascript #htm

(function (d) {
    var w = d.documentElement.offsetWidth,
        t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
        b;
    while (t.nextNode()) {
        b = t.currentNode.getBoundingClientRect();
        if (b.right > w || b.left < 0) {
            t.currentNode.style.setProperty('outline', '1px dotted red', 'important');
            console.log(t.currentNode);
        }
    };
}(document));
content_copyCOPY

Just run in the console and the overflowing element will be shown with a red dotted boreder.