Greasy Fork 还支持 简体中文。

RU AdList JS Fixes

try to take over the world!

目前為 2016-08-30 提交的版本,檢視 最新版本

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