屏蔽广告/优化打开链接
Pada tanggal
// ==UserScript==
// @icon http://www.javlib.com/favicon.ico
// @name Javlib(图书馆) 净化
// @namespace http://tampermonkey.net/
// @version 0.2
// @description 屏蔽广告/优化打开链接
// @author Avral
// @match *://*.com/*
// @match *://javlib.com/*
// @match *://zlibz.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
(function () {
function enumdel(arrs){
$.each(arrs, function(index, a){
a.remove();
});
}
function init(){
if (document.title.indexOf("JAVLibrary") == -1)return;
console.log("Initing...");
/*var $videoimages = null;
document.onselect = function(){}
document.onclick = function(){}
document.onmousedown = function(){}
document.onmouseup = function(){}
document.write = function(){}
document.writeln = function(){}*/
window.open = function(){};
enumdel($("[id^='topbanner'"));
enumdel($("[id^='sidebanner'"));
enumdel($("[id^='middlebanner'"));
enumdel($("[id^='bottombanner'"));
$("table.comment a[href*='redirect.php?url']").each(function(index, a){
var origin = location.origin;
a.href = decodeURIComponent(a.href.replace(origin+"/cn/redirect.php?url=",""));
$.ajax({
url: a.href,
type: 'GET',
dataType: "jsonp",
complete: (response)=>{
if(response.status==200){
a.innerHTML = "(有效)"+a.innerHTML;
return;
}
a.innerHTML = "(已失效)"+a.innerHTML;
}
});
});
$("div.videos div.id").each(function(index, a){
$.ajax({
url:"http://127.0.0.1:8999/" + a.innerHTML,
type: "POST",
data:{},
success: function (result) {
a.innerHTML += result;
}
});
});
$("div#video_id td.text").each(function(index, a){
$.ajax({
url:"http://127.0.0.1:8999/" + a.innerHTML,
type: "POST",
data:{},
success: function (result) {
a.innerHTML += result;
}
});
});
}
/*$(document).ready(function(){
init();
});*/
init();
}) ();