您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Unblock NSFW without account
当前为
// ==UserScript== // @name 9gag NSFW unblock // @version 0.1.1 // @description Unblock NSFW without account // @author Unblockit // @match https://9gag.com/* // @grant none // @namespace http://tampermonkey.net/ // ==/UserScript== 'use strict'; function setChild(container, post) { container.children[0].replaceWith(post); } function tryMP4(id, container) { const source = "https://img-9gag-fun.9cache.com/photo/" + id + "_460sv.mp4"; const video = document.createElement("video"); video.controls = true; // video.autoplay = true; // video.muted = true; video.src = source; video.onloadedmetadata = function() { console.log("NSFW MP4"); setChild(container, video); } video.onerror = function() { console.log("not an MP4"); tryJPG(id, container); } } function tryJPG(id, container) { const source = "https://img-9gag-fun.9cache.com/photo/" + id + "_700b.jpg"; const picture = document.createElement("img"); picture.src = source; setChild(container, picture); picture.onload = function() { console.log("NSFW JPG"); } picture.onerror = function() { console.log("not an JPG"); } } var mobile = true; var desktop = true; function clearPost () { if (desktop) { var nsfw_desktop = document.querySelectorAll("div.nsfw-post"); for (var post of nsfw_desktop) { mobile = false; const article = post.parentElement.parentElement.parentElement.parentElement; const container = post.parentElement.parentElement.parentElement; const id = article.querySelector("a.point.badge-evt").getAttribute("data-entry-id"); //tryJPG(id, container); tryMP4(id, container); } } if (mobile) { var nsfw_mobile = document.querySelectorAll("div.nsfw-mask"); for (post of nsfw_mobile) { desktop = false; const container = post.parentElement.parentElement; const id = container.parentElement.id.slice(15); //tryJPG(id, container); tryMP4(id, container); } } } var time = setInterval(clearPost, 1000)