RU AdList JS Fixes

try to take over the world!

当前为 2016-09-04 提交的版本,查看 最新版本

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