Sleazy Fork is available in English.

RemoveAVSiteAD

remove AV site AD

  1. // ==UserScript==
  2. // @name RemoveAVSiteAD
  3. // @namespace chenzww
  4. // @description remove AV site AD
  5. // @include http://3xplanet.com/view/*
  6.  
  7. // @include http://imageteam.org/*
  8. // @include http://imagedecode.com/*
  9. // @include http://damimage.com/*
  10.  
  11. // @include http://www.imgbabes.com/*
  12.  
  13. // @include http://www.imgflare.com/*
  14.  
  15. // @include /^https?://img\.yt/
  16. // @include http://imgblank.com/*
  17.  
  18. // @include http://imgseeds.com/*
  19.  
  20. // @include http://imgcandy.net/*
  21.  
  22. // @include http://imgban.com/*
  23.  
  24. // @include http://imgicy.com/*
  25. // @include http://picmoza.com/*
  26. // @include https://ecoimages.xyz/*
  27.  
  28. // @include http://imgrock.net/*
  29.  
  30. // @include http://imgtiger.org/*
  31.  
  32. // @include http://www.imgdrive.net/*
  33.  
  34. // @include http://*javtotal.com/*
  35.  
  36. // @include http://imgclick.net/*
  37.  
  38. // @include http://imgtrex.com/*
  39.  
  40. // @include http://imgzap.com/*
  41.  
  42. // @include http://55888.eu/*
  43.  
  44. // @include http://www.imagepearl.com/*
  45.  
  46. // @include http://imgdream.net/*
  47.  
  48. // @include http://www.pixsense.net/*
  49.  
  50. // @include http://imgchili.net/*
  51.  
  52. // @include http://hentai-baka.com/*
  53. // @include http://img-hentai.host/*
  54. // @include https://underpic.club/*
  55.  
  56. // @include https://imgbaron.com/*
  57. // @include https://picbaron.com/*
  58.  
  59.  
  60. // @version 0.1.2
  61. // @grant none
  62. // ==/UserScript==
  63.  
  64. function removeElementsBySelector(selector) {
  65. var elements = document.querySelectorAll(selector);
  66. for (var i = elements.length - 1; i >= 0; i -= 1) {
  67. elements[i].parentNode.removeChild(elements[i]);
  68. }
  69. }
  70.  
  71. function setStyleBySelector(selector, style) {
  72. var elements = document.querySelectorAll(selector);
  73. for (var i = elements.length - 1; i >= 0; i -= 1) {
  74. elements[i].setAttribute("style", style);
  75. }
  76. }
  77.  
  78. // 刪除保留屬性以外的所有屬性。
  79. function reserveAttributesBySelector(selector) {
  80. var es = document.querySelectorAll(selector);
  81.  
  82. // 保留屬性。
  83. var reserveAttrs = [];
  84. for (var i = 1; i < arguments.length; i += 1) {
  85. reserveAttrs.push(arguments[i]);
  86. }
  87.  
  88. for (var i = 0; i < es.length; i += 1) {
  89. var e = es[i];
  90. var deprecatedAttrs = [];
  91. for (var j = 0; j < e.attributes.length; j++) {
  92. var attr = e.attributes[j];
  93.  
  94. // 保留第一個參數。
  95. for (var k = 0; k < reserveAttrs.length; k++) {
  96. if (reserveAttrs.indexOf(attr.name) === -1) {
  97. deprecatedAttrs.push(attr.name);
  98. }
  99. }
  100. }
  101.  
  102. // 刪除無用的節點屬性。
  103. for (var j = 0; j < deprecatedAttrs.length; j++) {
  104. if (e.hasAttribute(deprecatedAttrs[j])) {}
  105. e.removeAttribute(deprecatedAttrs[j]);
  106. }
  107. }
  108. }
  109.  
  110.  
  111.  
  112. if (/3xplanet.com\/view\//.test(location.href)) {
  113. removeElementsBySelector(".layout, .picsContent, .full_bot");
  114. }
  115.  
  116. if (/imageteam.org|imagedecode.com|damimage.com/.test(location.hostname)) {
  117. var container = document.querySelector("#container");
  118. if (container) { container.setAttribute("style", "width: auto;"); }
  119.  
  120. removeElementsBySelector("#menu, #accordion, #footer, strong, .overlay_ad, .top_ads, iframe");
  121. }
  122.  
  123. if (/imgbabes.com/.test(location.hostname)) {
  124. // MSG: I am +18 I would like to Enter
  125. var veriBtn = document.querySelector(".verif input[type='submit']");
  126. if (veriBtn) veriBtn.click();
  127. removeElementsBySelector("#header, #footer, .result_slot");
  128.  
  129. var img = document.querySelector("#this_image");
  130. if (img) {
  131. img.removeAttribute("width");
  132. document.body.innerHTML = img.outerHTML
  133. }
  134. }
  135.  
  136. if (/www.imgflare.com/.test(location.hostname)) {
  137. var human = document.querySelector(".skin-box input[type='button']");
  138. if (human) human.click();
  139.  
  140. var img = document.querySelector("#this_image");
  141. if (img) {
  142. img.removeAttribute("width");
  143. document.body.innerHTML = img.outerHTML
  144. }
  145. }
  146.  
  147. if (/img.yt|imgblank.com/.test(location.hostname)) {
  148. var continuebutton = document.querySelector("#continuebutton");
  149. if (continuebutton) {
  150. continuebutton.click();
  151. } else {
  152. removeElementsBySelector("#menu, #logo, #footer, .bottom_ads, .top_ads");
  153. }
  154.  
  155. var continuetoimage = document.querySelector("#continuetoimage input[type='submit']");
  156. if (continuetoimage) { continuetoimage.click(); }
  157. }
  158.  
  159. if (/imgseeds.com|imgcandy.net|imgban.com|imgicy.com|picmoza.com|ecoimages.xyz/.test(location.hostname)) {
  160. var continuetoimage = document.querySelector("#continuetoimage input[type='submit']");
  161. if (continuetoimage) { continuetoimage.click(); }
  162.  
  163. var img = document.querySelector("img.centred, img.centred_resized");
  164. if (img) { location.href = img.src; }
  165. }
  166.  
  167.  
  168. if (/imgrock.net/.test(location.hostname)) {
  169. var imageviewirs = document.querySelectorAll("#imageviewir input[type='submit']");
  170. for (var i = 0; i < imageviewirs.length; i += 1) {
  171. if (imageviewirs[i].style.display !== "none") { imageviewirs[i].click(); }
  172. }
  173.  
  174. var closeButton = document.querySelector("button.close");
  175. if (closeButton) { closeButton.click(); }
  176.  
  177. var image = document.querySelector("img.pic");
  178. image.removeAttribute("width");
  179. image.removeAttribute("height");
  180. document.body.innerHTML = image.outerHTML;
  181. }
  182.  
  183. if (/imgtiger.org/.test(location.hostname)) {
  184. var continueButton = document.querySelector("#continueButton");
  185. if (continueButton) { continueButton.click(); }
  186.  
  187. var image = document.querySelector(".spoiler img");
  188. if (image) { document.body.innerHTML = image.outerHTML; }
  189. }
  190.  
  191. if (/imgdrive.net/.test(location.hostname)) {
  192. window.onload = function() {
  193. setTimeout(function() {
  194. var overlay_ad_link = document.querySelector(".overlay_ad_link");
  195. if (overlay_ad_link) {
  196. overlay_ad_link.click();
  197. } else {
  198. var image = document.querySelector("img.centred");
  199. if (image) {
  200. document.body.innerHTML = image.outerHTML;
  201. }
  202. }
  203. }, 1000);
  204. };
  205. }
  206.  
  207. if (/javtotal.com/.test(location.hostname)) {
  208. var img = document.querySelector("img.centred");
  209. if (img) { document.body.innerHTML = img.outerHTML; }
  210. }
  211.  
  212. if (/imgclick.net/.test(location.hostname)) {
  213. var ddshow = document.querySelector("#ddshow input[type='submit']");
  214. if (!!ddshow) {
  215. ddshow.click();
  216. } else {
  217. removeElementsBySelector(".ddemo-wrapper, .navbar-inner, .footer, .copy");
  218. }
  219. }
  220.  
  221. if (/imgtrex.com/.test(location.hostname)) {
  222. var interRaptor = document.querySelector("#interRaptor");
  223. if (interRaptor && window.getComputedStyle(interRaptor).display !== "none" ) {
  224. interRaptor.querySelector("a[onclick]").click();
  225. }
  226. var img = document.querySelector("img.pic");
  227. if (img) { document.body.innerHTML = img.outerHTML; }
  228.  
  229. removeElementsBySelector("script");
  230. setTimeout(setStyleBySelector("html", "overflow: auto !important;"), 3000);
  231. }
  232.  
  233. if (/imgzap.com/.test(location.hostname)) {
  234. var popupBox = document.querySelector("#popupBox");
  235. if (popupBox && window.getComputedStyle(popupBox).display !== "none") {
  236. popupBox.querySelector("a[onclick]").click();
  237. }
  238. var cursor_lupa = document.querySelector("#cursor_lupa");
  239. if (cursor_lupa) { document.body.innerHTML = cursor_lupa.outerHTML; }
  240. }
  241.  
  242. if (/55888.eu/.test(location.hostname)) {
  243. var popupOverlay = document.querySelector("#popupOverlay");
  244. if (popupOverlay && window.getComputedStyle(popupOverlay).display !== "none") {
  245. popupOverlay.querySelector("a").click();
  246. }
  247. var image = document.querySelector(".centred_resized");
  248. if (image) { document.body.innerHTML = image.outerHTML; }
  249. }
  250.  
  251. if (/imagepearl.com/.test(location.hostname)) {
  252. // 第一個確認頁面。
  253. if (document.querySelector("#verify2 p")) {
  254. var s_list = document.querySelector("#verify2 p").textContent.split(" ");
  255. if (s_list.length === 5) {
  256. var s = s_list[2];
  257.  
  258. var nodes = document.querySelectorAll("#verify2 a");
  259. for (var i = 0; i < nodes.length; i += 1) {
  260. if (nodes[i].textContent === s) {
  261. nodes[i].click();
  262. }
  263. }
  264. }
  265. }
  266. // 第二個確認頁面。
  267. var adult = document.querySelector("#view-image");
  268. if (adult) { adult.click(); }
  269. }
  270.  
  271.  
  272. if (/imgdream.net/.test(location.hostname)) {
  273. reserveAttributesBySelector("img", "alt", "src", "title");
  274.  
  275. var popupConfirm = document.querySelector(".buttonblue");
  276. if (popupConfirm) popupConfirm.click();
  277.  
  278. setTimeout(function () {
  279. var imgs = document.querySelectorAll("a img");
  280. var pivot = 0;
  281. for (var i = 0; i < imgs.length; i += 1) {
  282. if (imgs[pivot].naturalWidth*imgs[pivot].naturalHeight < imgs[i].naturalWidth * imgs[i].naturalHeight) {
  283. pivot = i;
  284. }
  285. }
  286. imgs[pivot].setAttribute("style", "max-width: 100%;");
  287. document.body.removeAttribute("class");
  288. document.body.setAttribute("style", "text-align: center");
  289. document.body.innerHTML = imgs[pivot].outerHTML;
  290. }, 1000);
  291. }
  292.  
  293. if (/www.pixsense.net/.test(location.hostname)) {
  294. if (myUniqueImg) { document.body.innerHTML = myUniqueImg.outerHTML; }
  295. }
  296.  
  297. if (/imgchili.net/.test(location.host)) {
  298. if (show_image) {
  299. document.body.innerHTML = show_image.outerHTML;
  300. }
  301. }
  302.  
  303. if (/hentai-baka.com|img-hentai.host|jav-hentai.host|underpic.club/.test(location.host)) {
  304. reserveAttributesBySelector("#introOverlayBg", "id", "class");
  305.  
  306. var img = document.querySelector(".centred_resized");
  307. if (img) { location.href = img.src; }
  308.  
  309. var buttonblue = document.querySelector(".buttonblue");
  310. if (buttonblue) {
  311. buttonblue.click();
  312. }
  313.  
  314. var continuetoimage = document.querySelector("#continuetoimage input[type='submit']");
  315. if (continuetoimage ) { continuetoimage.click(); }
  316. }
  317.  
  318. if (/imgbaron.com|picbaron.com/.test(location.host)) {
  319. var submitBtn = document.querySelector("input[type='submit']");
  320. if (submitBtn) { submitBtn.click(); }
  321.  
  322. var img = document.querySelector("img.pic");
  323. if (img) { location.href = img.src; }
  324. }