RU AdList JS Fixes

try to take over the world!

当前为 2016-08-31 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name RU AdList JS Fixes
  3. // @namespace ruadlist_js_fixes
  4. // @version 1.2.1
  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))) // temporary fix,
  26. // apparently Fx won't let me to do it this way without any extra code
  27. // https://gf.qytechs.cn/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. if (!(/firefox/i.test(navigator.userAgent))) { // scripts for non-Firefox browsers
  105.  
  106. // https://gf.qytechs.cn/scripts/14720-it-s-not-important
  107. (function(){
  108. var imptt = /((display|(margin|padding)(-top|-bottom)?)\s*:[^;!]*)!\s*important/ig;
  109.  
  110. function unimportanter(el, si) {
  111. if (!imptt.test(si) || el.style.display === 'none') {
  112. return 0; // get out if we have nothing to do here
  113. }
  114. if (el.nodeName === 'IFRAME' && el.src &&
  115. el.src.slice(0,17) === 'chrome-extension:') {
  116. return 0; // Web of Trust uses this method to add their frame
  117. }
  118. var so = si.replace(imptt, function(){return arguments[1];}), ret = 0;
  119. if (si !== so) {
  120. ret = 1;
  121. el.setAttribute('style', so);
  122. }
  123. return ret;
  124. }
  125.  
  126. function logger(c) {
  127. if (c) {
  128. console.log('Some page elements became a bit less important.');
  129. }
  130. }
  131.  
  132. function checkTarget(m, c) {
  133. var si = m.getAttribute ? m.getAttribute('style') : null;
  134. if (si && si.indexOf('!') > -1) {
  135. c += unimportanter(m, si);
  136. }
  137. return c;
  138. }
  139.  
  140. function checkNodes(m, c) {
  141. var i = m.length;
  142. while(i--) {
  143. c = checkTarget(m[i], c);
  144. }
  145. return c;
  146. }
  147.  
  148. var observer = new MutationObserver(function(mutations) {
  149. setTimeout(function(m) {
  150. var i = m.length, c = 0;
  151. while(i--) {
  152. if (m[i].target) {
  153. c = checkTarget(m[i].target, c);
  154. }
  155. if (m[i].addedNodes.length) {
  156. c = checkNodes(m[i].addedNodes, c);
  157. }
  158. }
  159. logger(c);
  160. },0,mutations);
  161. });
  162.  
  163. observer.observe(document, { childList : true, attributes : true, attributeFilter : ['style'], subtree : true });
  164.  
  165. win.addEventListener ("load", function(){
  166. var c = 0, imp = document.querySelectorAll('[style*="!"]'), i = imp.length;
  167. while(i--) {
  168. c+= checkTarget(imp[i], c);
  169. }
  170. logger(c);
  171. }, false);
  172. })();
  173.  
  174. }
  175.  
  176. if (/^https?:\/\/(news\.yandex\.|(www\.)?yandex\.[^\/]+\/(yand)?search[\/?])/i.test(win.location.href)) {
  177. // https://gf.qytechs.cn/en/scripts/809-no-yandex-ads
  178. (function(){
  179. // Generic ads removal and fixes
  180. function removeGenericAds() {
  181. var s, i;
  182. s = document.querySelector('.serp-header');
  183. if (s) {
  184. s.style.marginTop='0';
  185. }
  186. s = document.querySelectorAll('.serp-adv__head + .serp-item');
  187. i = s.length;
  188. while(i--) {
  189. s[i].parentNode.removeChild(s[i]);
  190. }
  191. s = document.querySelectorAll('#adbanner, .serp-adv, .b-spec-adv, div[class*="serp-adv__"]');
  192. i = s.length;
  193. while(i--) {
  194. s[i].parentNode.removeChild(s[i]);
  195. }
  196. }
  197. // Search ads
  198. var adWords = ['Реклама','Ad','Яндекс.Директ'];
  199. function removeSearchAds() {
  200. var s = document.querySelectorAll('.serp-block, .serp-item, .search-item');
  201. var i = s.length, item;
  202. while(i--) {
  203. item = s[i].querySelector('.label, .serp-item__label, .document__provider-name');
  204. if (item && adWords.indexOf(item.textContent) > -1) {
  205. s[i].parentNode.removeChild(s[i]);
  206. console.log('Ads removed.');
  207. }
  208. }
  209. }
  210. // News ads
  211. function removeNewsAds() {
  212. var s = document.querySelectorAll('.story[id], .document[id], .story__group[id]');
  213. var i = s.length;
  214. while(i--) {
  215. if (win.getComputedStyle(s[i]).position === 'absolute') {
  216. s[i].parentNode.removeChild(s[i]);
  217. console.log('Ads removed.');
  218. }
  219. }
  220. }
  221. // News fixes
  222. function removePageAdsClass() {
  223. if (document.body.classList.contains("b-page_ads_yes")){
  224. document.body.classList.remove("b-page_ads_yes");
  225. console.log('Page ads class removed.');
  226. }
  227. }
  228. // Function to attach an observer to monitor dynamic changes on the page
  229. function pageUpdateObserver(func, obj, params) {
  230. if (obj) {
  231. var o = new MutationObserver(func);
  232. o.observe(obj,(params || {childList:true}));
  233. }
  234. }
  235. // Cleaner
  236. document.addEventListener ("DOMContentLoaded", function() {
  237. removeGenericAds();
  238. if (win.location.hostname.search(/^news\./i) === 0) {
  239. pageUpdateObserver(removeNewsAds, document.querySelector('BODY'));
  240. pageUpdateObserver(removePageAdsClass, document.body, {attributes:true, attributesFilter:['class']});
  241. removeNewsAds();
  242. removePageAdsClass();
  243. } else {
  244. pageUpdateObserver(removeSearchAds, document.querySelector('.main__content'));
  245. removeSearchAds();
  246. }
  247. });
  248. })();
  249. return; //skip fixes for other sites
  250. }
  251.  
  252. // https://gf.qytechs.cn/en/scripts/14470-4pda-unbrender
  253. if (/(^|\.)4pda\.ru$/i.test(window.location.hostname)) {
  254. (function(){
  255. var isForum = document.location.href.search('/forum/') !== -1,
  256. isSafari = (/Safari/i.test(navigator.userAgent)) && (/Apple\sComputer/i.test(navigator.vendor)),
  257. hStyle;
  258.  
  259. function remove(n) {
  260. if (n) {
  261. n.parentNode.removeChild(n);
  262. }
  263. }
  264.  
  265. function afterClean() {
  266. hStyle.disabled = true;
  267. remove(hStyle);
  268. }
  269.  
  270. function beforeClean() {
  271. // attach styles before document displayed
  272. hStyle = document.createElement('style');
  273. hStyle.id = 'ubrHider';
  274. hStyle.type = 'text/css';
  275. document.head.appendChild(hStyle);
  276.  
  277. hStyle.sheet.insertRule('html { overflow-y: scroll }', 0);
  278. hStyle.sheet.insertRule('article + aside * { display: none !important }', 0);
  279. hStyle.sheet.insertRule('#header + div:after {'+(
  280. 'content: "";'+
  281. 'position: fixed;'+
  282. 'top: 0;'+
  283. 'left: 0;'+
  284. 'width: 100%;'+
  285. 'height: 100%;'+
  286. 'background-color: #E6E7E9'
  287. )+'}', 0);
  288. // http://codepen.io/Beaugust/pen/DByiE
  289. hStyle.sheet.insertRule('@keyframes spin { 100% { transform: rotate(360deg) } }', 0);
  290. hStyle.sheet.insertRule('article + aside:after {'+(
  291. 'content: "";'+
  292. 'position: absolute;'+
  293. 'width: 150px;'+
  294. 'height: 150px;'+
  295. 'top: 150px;'+
  296. 'left: 50%;'+
  297. 'margin-top: -75px;'+
  298. 'margin-left: -75px;'+
  299. 'box-sizing: border-box;'+
  300. 'border-radius: 100%;'+
  301. 'border: 10px solid rgba(0, 0, 0, 0.2);'+
  302. 'border-top-color: rgba(0, 0, 0, 0.6);'+
  303. 'animation: spin 2s infinite linear'
  304. )+'}', 0);
  305.  
  306. // display content of a page if time to load a page is more than 2 seconds to avoid
  307. // blocking access to a page if it is loading for too long or stuck in a loading state
  308. setTimeout(2000, afterClean);
  309. }
  310.  
  311. GM_addStyle('#nav .use-ad {display: block !important;} ' +
  312. 'article:not(.post) + article:not(#id) { display: none !important }');
  313. if (!isForum && !isSafari) {
  314. beforeClean();
  315. }
  316.  
  317. // clean the page
  318. window.addEventListener('DOMContentLoaded', function(){
  319. var rem, si, lst, i;
  320. function width(){ return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0; }
  321. function height(){ return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0; }
  322.  
  323.  
  324. if (isForum) {
  325. si = document.querySelector('#logostrip');
  326. if (si) {
  327. remove(si.parentNode.nextSibling);
  328. }
  329. }
  330.  
  331. if (document.location.href.search('/forum/dl/') !== -1) {
  332. lst = document.querySelectorAll('body>div');
  333. i = lst.length;
  334. document.body.setAttribute('style', (document.body.getAttribute('style')||'')+
  335. ';background-color:black!important');
  336. while (i--) {
  337. if (!lst[i].querySelector('.dw-fdwlink')) {
  338. remove(lst[i]);
  339. }
  340. }
  341. }
  342.  
  343. if (isForum) { // Do not continue if it's a forum
  344. return;
  345. }
  346.  
  347. si = document.querySelector('#header');
  348. if (si) {
  349. rem = si.previousSibling;
  350. while (rem) {
  351. si = rem.previousSibling;
  352. remove(rem);
  353. rem = si;
  354. }
  355. }
  356.  
  357. lst = document.querySelectorAll('#nav li[class]');
  358. i = lst.length;
  359. while (i--) {
  360. if (lst[i] && lst[i].querySelector('a[href^="/tag/"]')) {
  361. remove(lst[i]);
  362. }
  363. }
  364.  
  365. lst = document.querySelectorAll('DIV');
  366. i = lst.length;
  367. var style, result;
  368. while (i--) {
  369. if (lst[i].offsetWidth > 0.95 * width() && lst[i].offsetHeight > 0.9 * height()) {
  370. style = window.getComputedStyle(lst[i], null);
  371. result = [];
  372. if(style.backgroundImage !== 'none') {
  373. result.push('background-image:none!important');
  374. }
  375. if(style.backgroundColor !== 'transparent') {
  376. result.push('background-color:transparent!important');
  377. }
  378. if (result.length) {
  379. if (lst[i].getAttribute('style')) {
  380. result.unshift(lst[i].getAttribute('style'));
  381. }
  382. lst[i].setAttribute('style', result.join(';'));
  383. }
  384. }
  385. }
  386.  
  387. lst = document.querySelectorAll('ASIDE>DIV');
  388. i = lst.length;
  389. while (i--) {
  390. if ( ((lst[i].querySelector('script, iframe, a[href*="/ad/www/"]') ||
  391. lst[i].querySelector('img[src$=".gif"]:not([height="0"]), img[height="400"]')) &&
  392. !lst[i].classList.contains('post') ) || !lst[i].childNodes.length ) {
  393. remove(lst[i]);
  394. }
  395. }
  396.  
  397. document.body.setAttribute('style', (document.body.getAttribute('style')||'')+';background-color:#E6E7E9!important');
  398.  
  399. // display content of the page
  400. afterClean();
  401. });
  402. })();
  403. return;
  404. }
  405.  
  406. // https://gf.qytechs.cn/en/scripts/21937-moonwalk-hdgo-kodik-fix
  407. (function () {
  408. if (!inIFrame) {
  409. return;
  410. }
  411.  
  412. document.addEventListener ("DOMContentLoaded", function() {
  413. var player;
  414. if (win.iframe_adv_enabled !== undefined) {
  415. win.iframe_adv_enabled = false;
  416. } else if (win.banner_second !== undefined) {
  417. win.banner_second = 0;
  418. player = document.getElementById('play-player-hd');
  419. if (player) {
  420. player.onclick = function() {
  421. var adsdiv = document.getElementById("ads-player-hd");
  422. adsdiv.parentNode.removeChild(adsdiv);
  423. win.setPlayer();
  424. };
  425. }
  426. } else if (win.MXoverrollCallback !== undefined) {
  427. player = document.getElementsByClassName('play_button')[0];
  428. if (player) {
  429. player.onclick = win.MXoverrollCallback.bind(window);
  430. }
  431. }
  432. },false);
  433. })();
  434.  
  435. document.addEventListener ("DOMContentLoaded", function() {
  436. // function to search and remove nodes by content
  437. // selector - standard CSS selector to define set of nodes to check
  438. // words - regular expression to check content of the suspicious nodes
  439. // params - object with multiple extra parameters:
  440. // .hide - set display to none instead of removing from the page
  441. // .parent - parent node to remove if content is found in the child node
  442. // .siblings - number of simling nodes to remove (excluding text nodes)
  443. function scRemove(e) {e.parentNode.removeChild(e);}
  444. function scHide(e) {e.style.display='none';}
  445. function scissors (selector, words, scope, params) {
  446. var remFunc = (params.hide ? scHide : scRemove),
  447. iterFunc = (params.siblings > 0 ?
  448. 'nextSibling' :
  449. 'previousSibling'),
  450. nodes = scope.querySelectorAll(selector),
  451. i = nodes.length,
  452. toRemove = [],
  453. siblings,
  454. node;
  455. while(i--) {
  456. node = nodes[i];
  457. if (words.test(node.innerHTML) || !node.childNodes.length) {
  458. // drill up to the specified parent node if required
  459. if (params.parent) {
  460. while(node !== scope && !(node.matches(params.parent))) {
  461. node = node.parentNode;
  462. }
  463. }
  464. if (node === scope) {
  465. break;
  466. }
  467. toRemove.push(node);
  468. // add multiple nodes if defined more than one sibling
  469. siblings = Math.abs(params.siblings) || 0;
  470. while (siblings) {
  471. node = node[iterFunc];
  472. toRemove.push(node);
  473. if (node.nodeType === 1) {
  474. siblings -= 1; //count only element nodes
  475. }
  476. }
  477. }
  478. }
  479. i = toRemove.length;
  480. while(i--) {
  481. remFunc(toRemove[i]);
  482. }
  483.  
  484. return toRemove.length;
  485. }
  486.  
  487. // function to perform multiple checks if ads inserted with a delay
  488. // by default does 30 checks withing a 3 seconds unless nonstop mode specified
  489. // also does 1 extra check when a page completely loads
  490. // selector and words - passed dow to scissors
  491. // params - object with multiple extra parameters:
  492. // .root - selector to narrow down scope to scan;
  493. // .observe - if true then check will be performed continuously;
  494. // Other parameters passed down to scissors.
  495. function gardener(selector, words, params) {
  496. params = params || {};
  497. var scope = document.body,
  498. nonstop = false;
  499. // narrow down scope to a specific element
  500. if (params.root) {
  501. scope = scope.querySelector(params.root);
  502. if (!scope) {// exit if the root element is not present on the page
  503. return 0;
  504. }
  505. }
  506. // add observe mode if required
  507. if (params.observe) {
  508. if (typeof MutationObserver === 'function') {
  509. var o = new MutationObserver(function(ms){
  510. ms.forEach(function(m){
  511. if (m.addedNodes.length) {
  512. scissors(selector, words, scope, params);
  513. }
  514. });
  515. });
  516. o.observe(scope, {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|story__gag|profile\/ads"/i, {root: '.inner_wrap', 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. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址