Javlib净化

屏蔽广告/优化打开链接

  1. // ==UserScript==
  2. // @icon http://www.javlib.com/favicon.ico
  3. // @name Javlib净化
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.7
  6. // @description 屏蔽广告/优化打开链接
  7. // @author Avral
  8. // @match *://*.com/*
  9. // @match *://javlib.com/*
  10. // @match *://zlibz.com/*
  11. // @match *://btsow.bar/*
  12. // @grant none
  13. // @run-at document-end
  14. // ==/UserScript==
  15.  
  16. var isInit = false;
  17.  
  18. (function () {
  19. if (window.$ == null)return;
  20. function enumdel(arrs){
  21. $.each(arrs, function(index, a){
  22. a.remove();
  23. });
  24. }
  25. function getInfo(code, a) {
  26. $.ajax({
  27. url:"http://127.0.0.1:8080/",
  28. type: "POST",
  29. data:{
  30. id: code
  31. },
  32. dataType: "json",
  33. success: function (result) {
  34. for (let idx in result) {
  35. let info = result[idx];
  36. let color = "red";
  37. if (info.type.id >= 1 && info.type.id <= 3)
  38. color = "green";
  39. else if (info.type.id == 6)
  40. color = "yellow";
  41. a.innerHTML += "<br/>";
  42. a.innerHTML += "<a id=\"open_local_path\" style=\"color:" + color + "\" code=\"" + a.firstChild.data + "\">[" + info.type.name + "][" + info.ext + "][" + (info.size / 1024 / 1024 / 1024).toFixed(2) + "GB]<a/>";
  43. }
  44. a.addEventListener("click", function(event) {
  45. if (event.target.matches("#open_local_path")) {
  46. event.stopPropagation();
  47. event.preventDefault();
  48. openFile(event.target.getAttribute("code"));
  49. }
  50. }, false);
  51. },
  52. error: function() {
  53. a.style = "color:red;";
  54. }
  55. });
  56. }
  57. function openFile(path) {
  58. $.ajax({
  59. url:"http://127.0.0.1:8080/",
  60. type: "POST",
  61. data:{
  62. code: path
  63. },
  64. });
  65. }
  66. function init(){
  67. if (document.title.indexOf("JAVLibrary") != -1){
  68. console.log("JAVLIB Initing...");
  69. var $videoimages = null;
  70. document.onselect = function(){}
  71. document.onclick = function(){}
  72. document.onmousedown = function(){}
  73. document.onmouseup = function(){}
  74. window.open = function(){};
  75. document.write = function(){}
  76. document.writeln = function(){}
  77. $.each($("head").children("script"), function(index, a){
  78. a.remove();
  79. });
  80.  
  81. enumdel($("[id^='topbanner'"));
  82. enumdel($("[id^='sidebanner'"));
  83. enumdel($("[id^='middlebanner'"));
  84. enumdel($("[id^='bottombanner'"));
  85. enumdel($("div.ebmhijOverlay"));
  86. $("div.socialmedia").remove();
  87. $("div#toplogo").remove();
  88. $("div#bottommenu").remove();
  89. $("div#bottomcopyright").remove();
  90. $("div#leftmenu").css("width", "auto");
  91. $("div#rightcolumn").css("margin-left", "100px");
  92. if (isInit)return;
  93. isInit = true;
  94. $("div.videos div.id").each(function(index, a){
  95. //a.innerHTML += "<button onclick='preview();'>预览</button>";
  96. getInfo(a.firstChild.data, a);
  97. });
  98. $("table.comment td strong a").each(function(index, a){
  99. console.log("test");
  100. //a.innerHTML += "<button onclick='preview();'>预览</button>";
  101. var id = a.firstChild.data;
  102. id = id.substr(0, id.indexOf(" "));
  103. getInfo(id, a);
  104. });
  105. $("div#video_id td.text").each(function(index, a){
  106. var bt_search = $("<iframe src='https://btsow.com/search/"+a.innerHTML+"' style='width:100%;height:250px;' security='restricted' sandbox=''></iframe>");
  107. $("div#video_favorite_edit").after(bt_search);
  108. var bt_search1 = $("<iframe src='https://0cili.org/search?q="+a.innerHTML+"' style='width:100%;height:250px;' security='restricted' sandbox=''></iframe>");
  109. $("div#video_favorite_edit").after(bt_search1);
  110. getInfo(a.firstChild.data, a);
  111. });
  112. }
  113. if (document.title.indexOf("bt - BTSOW") != -1){
  114. console.log("BTSOW Initing...");
  115. document.onselect = function(){}
  116. document.onclick = function(){}
  117. document.onmousedown = function(){}
  118. document.onmouseup = function(){}
  119. window.open = function(){};
  120. document.write = function(){}
  121. document.writeln = function(){}
  122. $.each($("head").children("script"), function(index, a){
  123. a.remove();
  124. });
  125. $.each($("body").children("[class!='container']"), function(index, a){
  126. a.remove();
  127. });
  128. /*$.each($(".container").children("[class!='data-list']"), function(index, a){
  129. a.remove();
  130. });*/
  131. }
  132. }
  133. $(document).ready(function(){
  134. init();
  135. });
  136. init();
  137. }) ();