Javlib(图书馆) 净化

屏蔽广告/优化打开链接

Verze ze dne 20. 01. 2021. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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();
}) ();