// ==UserScript== // @name 煎蛋半自动摸鱼小助手 // @namespace https://greasyfork.org/users/186574 // @homepage https://greasyfork.org/scripts/368223 // @version 1.0.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== var tb = $(".tucao-btn"), // tlb = $(".tucao-livere-btn"), at = $(".author"), gifMasks = $(".gif-mask"), imgs = document.querySelectorAll("p>a+br+img"); var i = 0, j = 0, k = 0; (function() { 'use strict'; // 隐藏所有不受欢迎无聊图 $('li[id*="comment-"]').each(function(){ var c = $(this).find("div.text p").eq(0).attr("class"); if (c === "bad_content") { $(this).hide(); } }); $(document).scroll(function() { // 自动展开吐槽 if (i < at.length && at[i].getBoundingClientRect().top < window.innerHeight + 100) { tb[i++].click(); } // 加载 gif if (j < gifMasks.length && gifMasks[j].getBoundingClientRect().top < window.innerHeight + 100) { gifMasks[j++].click(); } // 自动点击大图 if (k < imgs.length && imgs[k].getBoundingClientRect().top < window.innerHeight) { if (imgs[k].style.maxHeight != "none") { imgs[k].style.maxHeight = "none"; } ++k; } }); })();