Greasy Fork 还支持 简体中文。

RU AdList JS Fixes

try to take over the world!

目前為 2016-09-01 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name RU AdList JS Fixes
  3. // @namespace ruadlist_js_fixes
  4. // @version 1.2.5
  5. // @description try to take over the world!
  6. // @author lainverse & dimisa
  7. // @match *://*/*
  8. // @grant unsafeWindow
  9. // @grant window.close
  10. // @grant GM_addStyle
  11. // @run-at document-start
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. var win = unsafeWindow || window;
  17. function inIFrame() {
  18. try {
  19. return win.self !== win.top;
  20. } catch (ignore) {
  21. return true;
  22. }
  23. }
  24.  
  25. // https://greasyfork.org/scripts/19144-websuckit/
  26. (function() {
  27. function WebSuckIt() {
  28. // check if the browser supports Proxy and WebSocket
  29. if (typeof Proxy !== 'function' ||
  30. typeof WebSocket !== 'function') {
  31. return;
  32. }
  33. var to_block = [
  34. '||bgrndi.com^',
  35. '||brokeloy.com^',
  36. '||dreadfula.ru^',
  37. '||et-code.ru^',
  38. '||free-torrent.org^',
  39. '||free-torrents.org^',
  40. '||gocdn.ru^',
  41. '||hghit.com^',
  42. '||kinotochka.net^',
  43. '||kuveres.com^',
  44. '||lepubs.com^',
  45. '||mail.ru^',
  46. '||marketgid.com^',
  47. '||mxtads.com^',
  48. '||oconner.biz^',
  49. '||psma01.com^',
  50. '||psma02.com^',
  51. '||psma03.com^',
  52. '||recreativ.ru^',
  53. '||regpole.com^',
  54. '||skidl.ru^',
  55. '||torvind.com^',
  56. '||trafmag.com^',
  57. '||xxuhter.ru^',
  58. '||yuiout.online^'
  59. ];
  60. var masks = [];
  61. to_block.forEach(function(m){
  62. masks.push(new RegExp(
  63. m.replace(/([\\\/\[\].*+?(){}$])/g, '\\$1')
  64. .replace(/\^(?!$)/g,'\\.?[^\\w%._-]')
  65. .replace(/\^$/,'\\.?([^\\w%._-]|$)')
  66. .replace(/^\|\|/,'^wss?:\\/+([^\/.]+\\.)*'),
  67. 'i'));
  68. });
  69. var ws = window.WebSocket,
  70. closingFunctions = ['close', 'send'];
  71. function wsGetter(tgt, nm) {
  72. console.log('[WSI] Registered call to property "', nm, '"');
  73. try {
  74. if (typeof ws.prototype[nm] === 'function') {
  75. if (closingFunctions.indexOf(nm) > -1) {
  76. tgt.readyState = ws.CLOSED;
  77. }
  78. return function(){return;};
  79. }
  80. if (typeof ws.prototype[nm] === 'number') {
  81. return ws[nm];
  82. }
  83. } catch(ignore) {}
  84. return tgt[nm];
  85. }
  86. window.WebSocket = (new Proxy(ws, {
  87. construct: function(target, args) {
  88. var url = args[0];
  89. console.log('[WSI] Opening socket on', url, '…');
  90. var i = masks.length;
  91. while(i--) {
  92. if (masks[i].test(url)) {
  93. console.log("[WSI] Blocked.");
  94. return new Proxy({url: url, readyState: ws.OPEN}, {
  95. get: wsGetter
  96. });
  97. }
  98. }
  99. return new target(args[0], args[1]);
  100. }
  101. }));
  102. if (document.currentScript) {
  103. document.currentScript.parentNode.removeChild(document.currentScript);
  104. }
  105. }
  106.  
  107. var script = document.createElement('script');
  108. script.appendChild(document.createTextNode('('+ WebSuckIt +')();'));
  109. (document.head || document.body || document.documentElement).appendChild(script);
  110. })();
  111.  
  112. if (!(/firefox/i.test(navigator.userAgent))) { // scripts for non-Firefox browsers
  113.  
  114. // https://greasyfork.org/scripts/14720-it-s-not-important
  115. (function(){
  116. var imptt = /((display|(margin|padding)(-top|-bottom)?)\s*:[^;!]*)!\s*important/ig;
  117.  
  118. function unimportanter(el, si) {
  119. if (!imptt.test(si) || el.style.display === 'none') {
  120. return 0; // get out if we have nothing to do here
  121. }
  122. if (el.nodeName === 'IFRAME' && el.src &&
  123. el.src.slice(0,17) === 'chrome-extension:') {
  124. return 0; // Web of Trust uses this method to add their frame
  125. }
  126. var so = si.replace(imptt, function(){return arguments[1];}), ret = 0;
  127. if (si !== so) {
  128. ret = 1;
  129. el.setAttribute('style', so);
  130. }
  131. return ret;
  132. }
  133.  
  134. function logger(c) {
  135. if (c) {
  136. console.log('Some page elements became a bit less important.');
  137. }
  138. }
  139.  
  140. function checkTarget(m, c) {
  141. var si = m.getAttribute ? m.getAttribute('style') : null;
  142. if (si && si.indexOf('!') > -1) {
  143. c += unimportanter(m, si);
  144. }
  145. return c;
  146. }
  147.  
  148. function checkNodes(m, c) {
  149. var i = m.length;
  150. while(i--) {
  151. c = checkTarget(m[i], c);
  152. }
  153. return c;
  154. }
  155.  
  156. var observer = new MutationObserver(function(mutations) {
  157. setTimeout(function(m) {
  158. var i = m.length, c = 0;
  159. while(i--) {
  160. if (m[i].target) {
  161. c = checkTarget(m[i].target, c);
  162. }
  163. if (m[i].addedNodes.length) {
  164. c = checkNodes(m[i].addedNodes, c);
  165. }
  166. }
  167. logger(c);
  168. },0,mutations);
  169. });
  170.  
  171. observer.observe(document, { childList : true, attributes : true, attributeFilter : ['style'], subtree : true });
  172.  
  173. win.addEventListener ("load", function(){
  174. var c = 0, imp = document.querySelectorAll('[style*="!"]'), i = imp.length;
  175. while(i--) {
  176. c+= checkTarget(imp[i], c);
  177. }
  178. logger(c);
  179. }, false);
  180. })();
  181.  
  182. }
  183.  
  184. if (/^https?:\/\/(news\.yandex\.|(www\.)?yandex\.[^\/]+\/(yand)?search[\/?])/i.test(win.location.href)) {
  185. // https://greasyfork.org/en/scripts/809-no-yandex-ads
  186. (function(){
  187. // Generic ads removal and fixes
  188. function removeGenericAds() {
  189. var s, i;
  190. s = document.querySelector('.serp-header');
  191. if (s) {
  192. s.style.marginTop='0';
  193. }
  194. s = document.querySelectorAll('.serp-adv__head + .serp-item');
  195. i = s.length;
  196. while(i--) {
  197. s[i].parentNode.removeChild(s[i]);
  198. }
  199. s = document.querySelectorAll('#adbanner, .serp-adv, .b-spec-adv, div[class*="serp-adv__"]');
  200. i = s.length;
  201. while(i--) {
  202. s[i].parentNode.removeChild(s[i]);
  203. }
  204. }
  205. // Search ads
  206. var adWords = ['Реклама','Ad','Яндекс.Директ'];
  207. function removeSearchAds() {
  208. var s = document.querySelectorAll('.serp-block, .serp-item, .search-item');
  209. var i = s.length, item;
  210. while(i--) {
  211. item = s[i].querySelector('.label, .serp-item__label, .document__provider-name');
  212. if (item && adWords.indexOf(item.textContent) > -1) {
  213. s[i].parentNode.removeChild(s[i]);
  214. console.log('Ads removed.');
  215. }
  216. }
  217. }
  218. // News ads
  219. function removeNewsAds() {
  220. var s = document.querySelectorAll('.story[id], .document[id], .story__group[id]');
  221. var i = s.length;
  222. while(i--) {
  223. if (win.getComputedStyle(s[i]).position === 'absolute') {
  224. s[i].parentNode.removeChild(s[i]);
  225. console.log('Ads removed.');
  226. }
  227. }
  228. }
  229. // News fixes
  230. function removePageAdsClass() {
  231. if (document.body.classList.contains("b-page_ads_yes")){
  232. document.body.classList.remove("b-page_ads_yes");
  233. console.log('Page ads class removed.');
  234. }
  235. }
  236. // Function to attach an observer to monitor dynamic changes on the page
  237. function pageUpdateObserver(func, obj, params) {
  238. if (obj) {
  239. var o = new MutationObserver(func);
  240. o.observe(obj,(params || {childList:true}));
  241. }
  242. }
  243. // Cleaner
  244. document.addEventListener ("DOMContentLoaded", function() {
  245. removeGenericAds();
  246. if (win.location.hostname.search(/^news\./i) === 0) {
  247. pageUpdateObserver(removeNewsAds, document.querySelector('BODY'));
  248. pageUpdateObserver(removePageAdsClass, document.body, {attributes:true, attributesFilter:['class']});
  249. removeNewsAds();
  250. removePageAdsClass();
  251. } else {
  252. pageUpdateObserver(removeSearchAds, document.querySelector('.main__content'));
  253. removeSearchAds();
  254. }
  255. });
  256. })();
  257. return; //skip fixes for other sites
  258. }
  259.  
  260. // https://greasyfork.org/en/scripts/14470-4pda-unbrender
  261. if (/(^|\.)4pda\.ru$/i.test(window.location.hostname)) {
  262. (function(){
  263. var isForum = document.location.href.search('/forum/') !== -1,
  264. isSafari = (/Safari/i.test(navigator.userAgent)) && (/Apple\sComputer/i.test(navigator.vendor)),
  265. hStyle;
  266.  
  267. function remove(n) {
  268. if (n) {
  269. n.parentNode.removeChild(n);
  270. }
  271. }
  272.  
  273. function afterClean() {
  274. hStyle.disabled = true;
  275. remove(hStyle);
  276. }
  277.  
  278. function beforeClean() {
  279. // attach styles before document displayed
  280. hStyle = document.createElement('style');
  281. hStyle.id = 'ubrHider';
  282. hStyle.type = 'text/css';
  283. document.head.appendChild(hStyle);
  284.  
  285. hStyle.sheet.insertRule('html { overflow-y: scroll }', 0);
  286. hStyle.sheet.insertRule('article + aside * { display: none !important }', 0);
  287. hStyle.sheet.insertRule('#header + div:after {'+(
  288. 'content: "";'+
  289. 'position: fixed;'+
  290. 'top: 0;'+
  291. 'left: 0;'+
  292. 'width: 100%;'+
  293. 'height: 100%;'+
  294. 'background-color: #E6E7E9'
  295. )+'}', 0);
  296. // http://codepen.io/Beaugust/pen/DByiE
  297. hStyle.sheet.insertRule('@keyframes spin { 100% { transform: rotate(360deg) } }', 0);
  298. hStyle.sheet.insertRule('article + aside:after {'+(
  299. 'content: "";'+
  300. 'position: absolute;'+
  301. 'width: 150px;'+
  302. 'height: 150px;'+
  303. 'top: 150px;'+
  304. 'left: 50%;'+
  305. 'margin-top: -75px;'+
  306. 'margin-left: -75px;'+
  307. 'box-sizing: border-box;'+
  308. 'border-radius: 100%;'+
  309. 'border: 10px solid rgba(0, 0, 0, 0.2);'+
  310. 'border-top-color: rgba(0, 0, 0, 0.6);'+
  311. 'animation: spin 2s infinite linear'
  312. )+'}', 0);
  313.  
  314. // display content of a page if time to load a page is more than 2 seconds to avoid
  315. // blocking access to a page if it is loading for too long or stuck in a loading state
  316. setTimeout(2000, afterClean);
  317. }
  318.  
  319. GM_addStyle('#nav .use-ad {display: block !important;} ' +
  320. 'article:not(.post) + article:not(#id) { display: none !important }');
  321. if (!isForum && !isSafari) {
  322. beforeClean();
  323. }
  324.  
  325. // clean the page
  326. window.addEventListener('DOMContentLoaded', function(){
  327. var rem, si, lst, i;
  328. function width(){ return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0; }
  329. function height(){ return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0; }
  330.  
  331.  
  332. if (isForum) {
  333. si = document.querySelector('#logostrip');
  334. if (si) {
  335. remove(si.parentNode.nextSibling);
  336. }
  337. }
  338.  
  339. if (document.location.href.search('/forum/dl/') !== -1) {
  340. lst = document.querySelectorAll('body>div');
  341. i = lst.length;
  342. document.body.setAttribute('style', (document.body.getAttribute('style')||'')+
  343. ';background-color:black!important');
  344. while (i--) {
  345. if (!lst[i].querySelector('.dw-fdwlink')) {
  346. remove(lst[i]);
  347. }
  348. }
  349. }
  350.  
  351. if (isForum) { // Do not continue if it's a forum
  352. return;
  353. }
  354.  
  355. si = document.querySelector('#header');
  356. if (si) {
  357. rem = si.previousSibling;
  358. while (rem) {
  359. si = rem.previousSibling;
  360. remove(rem);
  361. rem = si;
  362. }
  363. }
  364.  
  365. lst = document.querySelectorAll('#nav li[class]');
  366. i = lst.length;
  367. while (i--) {
  368. if (lst[i] && lst[i].querySelector('a[href^="/tag/"]')) {
  369. remove(lst[i]);
  370. }
  371. }
  372.  
  373. lst = document.querySelectorAll('DIV');
  374. i = lst.length;
  375. var style, result;
  376. while (i--) {
  377. if (lst[i].offsetWidth > 0.95 * width() && lst[i].offsetHeight > 0.9 * height()) {
  378. style = window.getComputedStyle(lst[i], null);
  379. result = [];
  380. if(style.backgroundImage !== 'none') {
  381. result.push('background-image:none!important');
  382. }
  383. if(style.backgroundColor !== 'transparent') {
  384. result.push('background-color:transparent!important');
  385. }
  386. if (result.length) {
  387. if (lst[i].getAttribute('style')) {
  388. result.unshift(lst[i].getAttribute('style'));
  389. }
  390. lst[i].setAttribute('style', result.join(';'));
  391. }
  392. }
  393. }
  394.  
  395. lst = document.querySelectorAll('ASIDE>DIV');
  396. i = lst.length;
  397. while (i--) {
  398. if ( ((lst[i].querySelector('script, iframe, a[href*="/ad/www/"]') ||
  399. lst[i].querySelector('img[src$=".gif"]:not([height="0"]), img[height="400"]')) &&
  400. !lst[i].classList.contains('post') ) || !lst[i].childNodes.length ) {
  401. remove(lst[i]);
  402. }
  403. }
  404.  
  405. document.body.setAttribute('style', (document.body.getAttribute('style')||'')+';background-color:#E6E7E9!important');
  406.  
  407. // display content of the page
  408. afterClean();
  409. });
  410. })();
  411. return;
  412. }
  413.  
  414. // https://greasyfork.org/en/scripts/21937-moonwalk-hdgo-kodik-fix
  415. (function () {
  416. if (!inIFrame) {
  417. return;
  418. }
  419.  
  420. document.addEventListener ("DOMContentLoaded", function() {
  421. var player;
  422. if (win.iframe_adv_enabled !== undefined) {
  423. win.iframe_adv_enabled = false;
  424. } else if (win.banner_second !== undefined) {
  425. win.banner_second = 0;
  426. player = document.getElementById('play-player-hd');
  427. if (player) {
  428. player.onclick = function() {
  429. var adsdiv = document.getElementById("ads-player-hd");
  430. adsdiv.parentNode.removeChild(adsdiv);
  431. win.setPlayer();
  432. };
  433. }
  434. } else if (win.MXoverrollCallback !== undefined) {
  435. player = document.getElementsByClassName('play_button')[0];
  436. if (player) {
  437. player.onclick = win.MXoverrollCallback.bind(window);
  438. }
  439. }
  440. },false);
  441. })();
  442.  
  443. document.addEventListener ("DOMContentLoaded", function() {
  444. // function to search and remove nodes by content
  445. // selector - standard CSS selector to define set of nodes to check
  446. // words - regular expression to check content of the suspicious nodes
  447. // params - object with multiple extra parameters:
  448. // .hide - set display to none instead of removing from the page
  449. // .parent - parent node to remove if content is found in the child node
  450. // .siblings - number of simling nodes to remove (excluding text nodes)
  451. function scRemove(e) {e.parentNode.removeChild(e);}
  452. function scHide(e) {e.style.display='none';}
  453. function scissors (selector, words, scope, params) {
  454. var remFunc = (params.hide ? scHide : scRemove),
  455. iterFunc = (params.siblings > 0 ?
  456. 'nextSibling' :
  457. 'previousSibling'),
  458. nodes = scope.querySelectorAll(selector),
  459. i = nodes.length,
  460. toRemove = [],
  461. siblings,
  462. node;
  463. while(i--) {
  464. node = nodes[i];
  465. if (words.test(node.innerHTML) || !node.childNodes.length) {
  466. // drill up to the specified parent node if required
  467. if (params.parent) {
  468. while(node !== scope && !(node.matches(params.parent))) {
  469. node = node.parentNode;
  470. }
  471. }
  472. if (node === scope) {
  473. break;
  474. }
  475. toRemove.push(node);
  476. // add multiple nodes if defined more than one sibling
  477. siblings = Math.abs(params.siblings) || 0;
  478. while (siblings) {
  479. node = node[iterFunc];
  480. toRemove.push(node);
  481. if (node.nodeType === 1) {
  482. siblings -= 1; //count only element nodes
  483. }
  484. }
  485. }
  486. }
  487. i = toRemove.length;
  488. while(i--) {
  489. remFunc(toRemove[i]);
  490. }
  491.  
  492. return toRemove.length;
  493. }
  494.  
  495. // function to perform multiple checks if ads inserted with a delay
  496. // by default does 30 checks withing a 3 seconds unless nonstop mode specified
  497. // also does 1 extra check when a page completely loads
  498. // selector and words - passed dow to scissors
  499. // params - object with multiple extra parameters:
  500. // .root - selector to narrow down scope to scan;
  501. // .observe - if true then check will be performed continuously;
  502. // Other parameters passed down to scissors.
  503. function gardener(selector, words, params) {
  504. params = params || {};
  505. var scope = document.body,
  506. nonstop = false;
  507. // narrow down scope to a specific element
  508. if (params.root) {
  509. scope = scope.querySelector(params.root);
  510. if (!scope) {// exit if the root element is not present on the page
  511. return 0;
  512. }
  513. }
  514. // add observe mode if required
  515. if (params.observe) {
  516. if (typeof MutationObserver === 'function') {
  517. var o = new MutationObserver(function(ms){
  518. ms.forEach(function(m){
  519. if (m.addedNodes.length) {
  520. scissors(selector, words, scope, params);
  521. }
  522. });
  523. });
  524. o.observe(scope, {childList:true, subtree: true});
  525. } else {
  526. nonstop = true;
  527. }
  528. }
  529. // wait for a full page load to do one extra cut
  530. win.addEventListener('load',function(){
  531. scissors(selector, words, scope, params);
  532. });
  533. // do multiple cuts until ads removed
  534. function cut(sci, s, w, sc, p, i) {
  535. if (i > 0) {
  536. i -= 1;
  537. }
  538. if (i && !sci(s, w, sc, p)) {
  539. setTimeout(cut, 100, sci, s, w, sc, p, i);
  540. }
  541. }
  542. cut(scissors, selector, words, scope, params, (nonstop ? -1 : 30));
  543. }
  544.  
  545. function preventBackgroundRedirect() {
  546. console.log("Background redirect prevention enabled.");
  547. var orgOpen = win.open;
  548. win.open = function(){
  549. var loc = arguments[0];
  550. if (loc.indexOf(win.location.host) > -1 ||
  551. loc.indexOf('://') === -1) {
  552. win.addEventListener('unload',function(){
  553. win.close();
  554. }, true);
  555. }
  556. orgOpen.apply(window, arguments);
  557. };
  558. }
  559.  
  560. var scripts = {};
  561. scripts['fs.to'] = function() {
  562. function skipClicker(i) {
  563. if (!i) {
  564. return;
  565. }
  566. var skip = document.querySelector('.b-aplayer-banners__close');
  567. if (skip) {
  568. skip.click();
  569. } else {
  570. setTimeout(skipClicker, 100, i-1);
  571. }
  572. }
  573. setTimeout(skipClicker, 100, 30);
  574.  
  575. var divs = document.getElementsByTagName('div'),
  576. re = /^b-[a-z]+\d+[a-z\d]*$/,
  577. i = divs.length;
  578. while(i--) {
  579. if (re.test(divs[i].className)) {
  580. divs[i].style.display = 'none';
  581. }
  582. }
  583.  
  584. GM_addStyle('.b-aplayer-teasers > a, div[class^="b-adproxy"], div[id^="admixer_async_"],'+
  585. '.b-player-popup__content > div[class][style="position: relative;"]'+
  586. '{display:none!important}');
  587.  
  588. if (/\/(view_iframe|iframeplayer)\//i.test(document.location.pathname)) {
  589. var p = document.querySelector('#player:not([preload="auto"])'),
  590. m = document.querySelector('.main'),
  591. adStepper = function(p) {
  592. if (p.currentTime < p.duration) {
  593. p.currentTime += 1;
  594. }
  595. },
  596. adSkipper = function(f, p) {
  597. f.click();
  598. p.waitAfterSkip = false;
  599. p.longerSkipper = false;
  600. console.log('Пропустили.');
  601. },
  602. cl = function(p) {
  603. var faster = document.querySelector('.b-aplayer__html5-desktop-skip'),
  604. series = document.querySelector('.b-aplayer__actions-series');
  605.  
  606. function clickSelected() {
  607. var s = document.querySelector('.b-aplayer__popup-series-episodes .selected a');
  608. if (s) {
  609. s.click();
  610. }
  611. }
  612.  
  613. if ((!faster || faster.style.display !== 'block') && series && !p.seriesClicked) {
  614. series.click();
  615. p.seriesClicked = true;
  616. p.longerSkipper = true;
  617. setTimeout(clickSelected, 1000);
  618. p.pause();
  619. }
  620.  
  621. function skipListener() {
  622. if (p.waitAfterSkip) {
  623. console.log('В процессе пропуска…');
  624. return;
  625. }
  626. p.pause();
  627. if (!p.classList.contains('m-hidden')) {
  628. p.classList.add('m-hidden');
  629. }
  630. if (faster && p.currentTime &&
  631. win.getComputedStyle(faster).display === 'block' &&
  632. !faster.querySelector('.b-aplayer__html5-desktop-skip-timer')) {
  633. p.waitAfterSkip = true;
  634. setTimeout(adSkipper, (p.longerSkipper?3:1)*1000, faster, p);
  635. console.log('Доступен быстрый пропуск…');
  636. } else {
  637. setTimeout(adStepper, 1000, p);
  638. }
  639. }
  640.  
  641. p.addEventListener('timeupdate', skipListener, false);
  642. },
  643. o = new MutationObserver(function (mut) {
  644. mut.forEach(function (e) {
  645. var i = e.addedNodes.length;
  646. while(i--) {
  647. if (e.addedNodes[i].id === 'player' &&
  648. e.addedNodes[i].nodeName === 'VIDEO' &&
  649. e.addedNodes[i].getAttribute('preload') !== 'auto') {
  650. cl(e.addedNodes[i]);
  651. }
  652. }
  653. });
  654. });
  655. if (p.nodeName === 'VIDEO') {
  656. cl(p);
  657. } else {
  658. o.observe(m, {childList: true});
  659. }
  660. }
  661. };
  662. scripts['brb.to'] = scripts['fs.to'];
  663. scripts['cxz.to'] = scripts['fs.to'];
  664.  
  665. scripts['drive2.ru'] = function() {
  666. gardener('.c-block', />Реклама<\/|\.relap\..*display:\s?none/i);
  667. };
  668.  
  669. scripts['fishki.net'] = function() {
  670. gardener('.main-post', /543769|Реклама/);
  671. };
  672.  
  673. scripts['hdrezka.me'] = function() {
  674. gardener('div[id][onclick][onmouseup][onmousedown]', /onmouseout/i);
  675. };
  676.  
  677. scripts['naruto-base.su'] = function() {
  678. gardener('div[id^="entryID"],.block', /href="http.*?target="_blank"/i);
  679. };
  680.  
  681. scripts['pb.wtf'] = function() {
  682. GM_addStyle('#result,tbody.row1:not([id]) {display: none !important}');
  683. gardener('a[href$="=="]', /img/i, {root:'#page_container .containe', observe:true, parent:'div[class]'});
  684. gardener('a[href^="/"]', /<img\s.*<br>/i, {root:'#main_content', observe:true, parent:'div[class]'});
  685. gardener('.re_top1', /./, {root:'#main_content', parent:'table.border'});
  686. };
  687. scripts['piratbit.org'] = scripts['pb.wtf'];
  688. scripts['piratbit.ru'] = scripts['pb.wtf'];
  689.  
  690. scripts['pikabu.ru'] = function() {
  691. gardener('.story', /story__sponsor|story__gag|profile\/ads"/i, {root: '.inner_wrap', observe: true});
  692. };
  693.  
  694. scripts['rustorka.com'] = function() {
  695. var s = document.head.childNodes, i = s.length;
  696. if (i < 5) {
  697. while(i--) {
  698. if (s[i].httpEquiv && s[i].httpEquiv === 'refresh') {
  699. win.close();
  700. }
  701. }
  702. }
  703. gardener('span[class],ul[class],span[id],ul[id]', /\/\d{12,}\.php/i, {root:'#sidebar1', observe:true});
  704. gardener('div[id][style*="!important"]', /!important/i);
  705. };
  706. scripts['rumedia.ws'] = scripts['rustorka.com'];
  707.  
  708. scripts['sports.ru'] = function() {
  709. gardener('.aside-news-list__item', /aside-news-list__advert/i, {root:'.aside-news-block'});
  710. };
  711.  
  712. scripts['yap.ru'] = function() {
  713. var words = /member1438|Administration/;
  714. gardener('form > table[id^="p_row_"]', words);
  715. gardener('tr > .holder.newsbottom', words, {parent:'tr', siblings:-2});
  716. };
  717. scripts['yaplakal.com'] = scripts['yap.ru'];
  718.  
  719. scripts['reactor.cc'] = function() {
  720. preventBackgroundRedirect();
  721. gardener('a[href="/donate"]', /100/i, {parent:'#content,#sidebar', root:'#pageinner', observe:true});
  722. };
  723. scripts['joyreactor.cc'] = scripts['reactor.cc'];
  724. scripts['pornreactor.cc'] = scripts['reactor.cc'];
  725.  
  726. scripts['auto.ru'] = function() {
  727. var words = /Реклама|Яндекс.Директ|yandex_ad_/;
  728. var userAdsListAds = [
  729. '.listing-list > .listing-item',
  730. '.listing-item_type_fixed.listing-item'
  731. ];
  732. var catalogAds = [
  733. 'div[class*="layout_catalog-inline"]',
  734. 'div[class$="layout_horizontal"]'
  735. ];
  736. var otherAds = [
  737. '.advt_auto',
  738. '.sidebar-block',
  739. '.pager-listing + div[class]',
  740. '.card > div[class][style]',
  741. '.sidebar > div[class]',
  742. '.main-page__section + div[class]',
  743. '.listing > tbody'];
  744. gardener(userAdsListAds.join(','), words, {root:'.listing-wrap', observe:true});
  745. gardener(catalogAds.join(','), words, {root:'.catalog__page,.content__wrapper', observe:true});
  746. gardener(otherAds.join(','), words);
  747. };
  748.  
  749. scripts['online.anidub.com'] = function() {
  750. var script = document.createElement('script');
  751. script.type = "text/javascript";
  752. script.innerHTML = "function ogonekstart1() {}";
  753. document.getElementsByTagName('head')[0].appendChild(script);
  754.  
  755. var style = document.createElement('style');
  756. style.type = 'text/css';
  757. style.appendChild(document.createTextNode('.background {background: none!important;}'));
  758. style.appendChild(document.createTextNode('.background > script + div, .background > script ~ div:not([id]):not([class]) + div[id][class] {display:none!important}'));
  759. document.head.appendChild(style);
  760. };
  761.  
  762. scripts['rsload.net'] = function() {
  763. win.addEventListener('load', function() {
  764. var dis = document.querySelector('.cb-disable');
  765. if (dis) {
  766. dis.click();
  767. }
  768. });
  769. document.addEventListener('click',function(e){
  770. var t = e.target;
  771. if (t && t.href && (/:\/\/\d+\.\d+\.\d+\.\d+\//.test(t.href))) {
  772. t.href = t.href.replace('://','://rsload.net:rsload.net@');
  773. }
  774. });
  775. };
  776.  
  777. var domain = document.domain;
  778. while (domain.indexOf('.') !== -1) {
  779. if (scripts.hasOwnProperty(domain)) {
  780. scripts[domain]();
  781. break;
  782. }
  783. domain = domain.slice(domain.indexOf('.') + 1);
  784. }
  785. });
  786. })();