pixiv 自動查看差分和評論

pixiv 自動點擊圖片的查看全部和評論的瀏覽更多按鈕

目前為 2022-01-17 提交的版本,檢視 最新版本

// ==UserScript==
// @name         pixiv 自動查看差分和評論
// @namespace    pixiv 自動查看差分和評論
// @version      7.3
// @description  pixiv 自動點擊圖片的查看全部和評論的瀏覽更多按鈕
// @author       fmnijk
// @match        https://www.pixiv.net/*
// @icon         https://www.google.com/s2/favicons?domain=pixiv.net
// @grant        none
// @license      MIT
// ==/UserScript==

history.pushState = ( f => function pushState(){
    var ret = f.apply(this, arguments);
    window.dispatchEvent(new Event('pushstate'));
    window.dispatchEvent(new Event('locationchange'));
    return ret;
})(history.pushState);

history.replaceState = ( f => function replaceState(){
    var ret = f.apply(this, arguments);
    window.dispatchEvent(new Event('replacestate'));
    window.dispatchEvent(new Event('locationchange'));
    return ret;
})(history.replaceState);

window.addEventListener('popstate',()=>{
    window.dispatchEvent(new Event('locationchange'))
});

function keeptrying(times, delay) {
    if(times == 0){
        return false;
    }
    /*評論的評論*/
    if(document.querySelector('._28zR1MQ') != null){
        document.querySelector('._28zR1MQ').click();
    }
    /*評論*/
    if(document.querySelector('._1Hom0qN') != null){
        document.querySelector('._1Hom0qN').click();
    }
    /*插圖*/
    if(document.querySelector('.sc-emr523-2.drFRmD') != null){
        document.querySelector('.sc-emr523-2.drFRmD').click();
    }
    setTimeout(( () => keeptrying(times - 1, delay) ), delay);
    //console.log(document. readyState);
}

function tryaddlistener(times, delay){
    try {
        window.addEventListener('locationchange', function (){
            keeptrying(100, 50);
        })
    } catch (error) {
        setTimeout(( () => tryaddlistener(times - 1, delay) ), delay);
    }
    //console.log('tryaddlistener');
}

tryaddlistener(100, 50);

(window.onload = function () {
    keeptrying(100, 50);
})();











QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址