function get_area(el){
    return parseInt(window.getComputedStyle(el).width) * parseInt(window.getComputedStyle(el).height);
}

function most_common(el){
    d = {};
    arr = Array.prototype.slice.call(el.children);
    arr.forEach((i,index)=>{
        width = window.getComputedStyle(i).width;
        key=`${i.tagName}_${i.children.length}_${width}`;
        if(width != "auto") d[key] = ++d[key]||1;
    })
    return Object.values(d).sort((a, b) => b - a)[0]
}

Array.prototype.slice.call(document.querySelectorAll("body *"))
.filter(i=> parseInt(window.getComputedStyle(i).height) > 1 && !! i.children.length && most_common(i) > 5)
.sort((a, b) => most_common(b) - most_common(a))
.slice(0, 10)
.sort((a, b)=> get_area(b) - get_area(a))

已注销
981 声望48 粉丝

Focus on programming efficiency