您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
pixiv 自動點擊圖片的查看全部和評論的瀏覽更多按鈕
当前为
// ==UserScript== // @name pixiv 自動查看差分和評論 // @namespace pixiv 自動查看差分和評論 // @version 7.2 // @description pixiv 自動點擊圖片的查看全部和評論的瀏覽更多按鈕 // @author fmnijk // @match https://www.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); })();