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