// ==UserScript== // @name 煎蛋半自动摸鱼小助手 // @namespace https://greasyfork.org/users/186574 // @homepage https://greasyfork.org/scripts/368223 // @version 1.4.1 // @description 隐藏不受欢迎图+随滚动自动展开评论+gif+直接看大图 // @author dccxi // @match http://jandan.net/pic* // @match http://jandan.net/top* // @match https://jandan.net/pic* // @match https://jandan.net/top* // @grant none // @downloadURL none // ==/UserScript== 'use strict'; // 隐藏所有不受欢迎无聊图 $('li[id*="comment-"]').each(function(){ var c = $(this).find("div.text p").eq(0).attr("class"); if (c === "bad_content") { $(this).hide(); } }); var tb = $(".tucao-btn"), // tlb = $(".tucao-livere-btn"), imgs = document.querySelectorAll("p>a+br+img"); var i = 0, j = 0; var hasMoreGifs = true; $(document).scroll(function() { // 自动展开吐槽 if (i < tb.length && tb[i].getBoundingClientRect().top < window.innerHeight + 3000) { tb[i++].click(); } // 自动点击大图 if (j < imgs.length && imgs[j].getBoundingClientRect().top < window.innerHeight) { if (imgs[j].style.maxHeight != "none") { imgs[j].style.maxHeight = "none"; } ++j; } // 加载 gif if (hasMoreGifs) { let gm = document.querySelector(".gif-mask:not(.gif-mask-loading)"); if (gm && gm.getBoundingClientRect().top < window.innerHeight + 3000) { gm.click(); gm.className += " gif-mask-loading"; } else if (gm == null) { hasMoreGifs = false; } } });