Greasy Fork is available in English.
隐藏不受欢迎图+随滚动自动展开评论+gif+直接看大图
当前为
// ==UserScript==
// @name 煎蛋半自动摸鱼小助手
// @namespace http://greasyfork.icu/users/186574
// @homepage http://greasyfork.icu/scripts/368223
// @version 1.4.2
// @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==
'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"),
gif_masks = document.getElementsByClassName("gif-mask");
var i = 0, j = 0;
while (i < gif_masks.length) {
gif_masks[i].className += " not-loading";
++i;
}
gif_masks = document.getElementsByClassName("gif-mask not-loading");
i = 0;
$(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 (gif_masks.length && gif_masks[0].getBoundingClientRect().top < window.innerHeight + 3000) {
gif_masks[0].click();
gif_masks[0].classList.remove("not_loading");
}
});