Greasy Fork is available in English.
隐藏不受欢迎图+随滚动自动展开评论+gif+直接看大图
当前为
// ==UserScript==
// @name 煎蛋半自动摸鱼小助手
// @namespace http://greasyfork.icu/users/186574
// @homepage http://greasyfork.icu/scripts/368223
// @version 0.9
// @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
// ==/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() {
// 自动展开吐槽
while (i < at.length && at[i].getBoundingClientRect().top < window.innerHeight + 100) {
tb[i++].click();
}
// 加载 gif
while (j < gifMasks.length && gifMasks[j].getBoundingClientRect().top < window.innerHeight + 100) {
gifMasks[j++].click();
}
// 自动点击大图
while (k < imgs.length && imgs[k].getBoundingClientRect().top < window.innerHeight) {
if (imgs[k].style.maxHeight != "none") {
imgs[k].style.maxHeight = "none";
}
++k;
}
});
})();