笑喷了,智能臭虫!

(function() { let shouldScroll = false;

function scrollPage() {
    if (shouldScroll) {
        window.scrollBy(0, 50);
        setTimeout(scrollPage, 10);
    }
}

window.addEventListener('keydown', function(event) {
    if (event.ctrlKey && event.key === '7') {
        shouldScroll = true;
        scrollPage();
    } else if (event.ctrlKey && event.key === '8') {
        // 停止滚轮滚动
        shouldScroll = false;
        // 开始读取标题
        var ids = document.getElementsByClassName('mat-checkbox-label');
        var idnum = [];
        for(var i = 0; i < ids.length; i++) {
            if(!ids[i].innerText.includes("/")){
                idnum.push(ids[i].innerText);
            };
        }
        var elements = document.getElementsByClassName('title title-link font-size-18 ng-star-inserted');
        var newTab = window.open();
        for(var j = 0; j < elements.length; j++) {
           //console.log(idnum[j]);
           newTab.document.write(idnum[j]+"."+elements[j].innerText + "<br>");
        }
    }
});

})();

我想不出还能有比这更简单的代码?

举报· 206 次点击
登录 注册 站外分享
1 条回复  
llcczz 初学 2 小时前
啥意思这
返回顶部