// ==UserScript== // @name 煎蛋小助手 // @namespace https://greasyfork.org/users/186574 // @homepage https://greasyfork.org/scripts/368223 // @version 0.7.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'); var i = 0, j = 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(); } }); // 自动展开吐槽和 gif $(document).scroll(function() { var bottomReached = $(document).scrollTop() + $(window).height(); // 自动展开吐槽 if (i < at.length && at[i].getBoundingClientRect().top < bottomReached) { tb[i++].click(); } // 加载 gif if (j < gifMasks.length && gifMasks[j].getBoundingClientRect().top < bottomReached) { gifMasks[j++].click(); } }); })();