RU AdList JS Fixes

try to take over the world!

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

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

QingJ © 2025

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