Javlib净化

屏蔽广告/优化打开链接

Stan na 17-05-2022. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @icon         http://www.javlib.com/favicon.ico
// @name         Javlib净化
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  屏蔽广告/优化打开链接
// @author       Avral
// @match        *://*.com/*
// @match        *://javlib.com/*
// @match        *://zlibz.com/*
// @match        *://btsow.bar/*
// @grant        none
// @run-at       document-end
// @license      MIT
// ==/UserScript==

var isInit = false;

(function () {
  if (window.$ == null)return;
  function enumdel(arrs){
	$.each(arrs, function(index, a){
	  a.remove();
	});
  }
  function init(){
	if (document.title.indexOf("JAVLibrary") != -1){
	  console.log("JAVLIB Initing...");
	  var $videoimages = null;
	  document.onselect = function(){}
	  document.onclick = function(){}
	  document.onmousedown = function(){}
	  document.onmouseup = function(){}
	  window.open = function(){};
	  document.write = function(){}
	  document.writeln = function(){}
	  $.each($("head").children("script"), function(index, a){
		a.remove();
	  });

	  enumdel($("[id^='topbanner'"));
	  enumdel($("[id^='sidebanner'"));
	  enumdel($("[id^='middlebanner'"));
	  enumdel($("[id^='bottombanner'"));
	  $("div.socialmedia").remove();
	  $("div#toplogo").remove();
	  $("div#bottommenu").remove();
	  $("div#bottomcopyright").remove();
	  $("div#leftmenu").css("width", "auto");
	  $("div#rightcolumn").css("margin-left", "100px");
	  if (isInit)return;
	  isInit = true;
	  $("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){
		//a.innerHTML += "<button onclick='preview();'>预览</button>";
		$.ajax({
		  url:"https://192.168.50.10/" + a.firstChild.data,
		  type: "POST",
		  data:{},
		  success: function (result) {
			a.firstChild.data += result;
		  }
		});
	  });
	  $("div#video_id td.text").each(function(index, a){
		var bt_search = $("<iframe src='https://btsow.bar/search/"+a.innerHTML+"' style='width:100%;height:250px;' security='restricted' sandbox=''></iframe>");
		$("div#video_favorite_edit").after(bt_search);
		$.ajax({
		  url:"https://192.168.50.10/" + a.innerHTML,
		  type: "POST",
		  data:{},
		  success: function (result) {
			a.innerHTML += result;
		  }
		});
	  });
	}
	if (document.title.indexOf("bt - BTSOW") != -1){
	  console.log("BTSOW Initing...");
	  document.onselect = function(){}
	  document.onclick = function(){}
	  document.onmousedown = function(){}
	  document.onmouseup = function(){}
	  window.open = function(){};
	  document.write = function(){}
	  document.writeln = function(){}
	  $.each($("head").children("script"), function(index, a){
		a.remove();
	  });
	  $.each($("body").children("[class!='container']"), function(index, a){
		a.remove();
	  });
	  /*$.each($(".container").children("[class!='data-list']"), function(index, a){
		a.remove();
	  });*/
	}
  }
  $(document).ready(function(){
	init();
  });
  init();
}) ();