OMS disable timeout

Disables 30 seconds timer and removes ad banners on ru.onlinemschool.com (use with Ublock Origin or Adblock Plus)

目前为 2017-01-29 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name OMS disable timeout
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Disables 30 seconds timer and removes ad banners on ru.onlinemschool.com (use with Ublock Origin or Adblock Plus)
  6. // @author hant0508
  7. // @include http://ru.onlinemschool.com/*
  8. // @grant none
  9. // @ran-at document-idle
  10. // ==/UserScript==
  11.  
  12. function f() {
  13. var path = "/html/body//div[@id and div [@style and (@onclick and img[@style]) or @style and div[@class and @style]] and @id != \"oms_r_center_2\"]";
  14. var ad = document.evaluate(path, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  15. if (ad.snapshotLength > 0) clearInterval(timer);
  16. oms.ads = true;
  17.  
  18. for (var i = ad.snapshotLength - 1; i >= 0; i--){
  19. var elm = ad.snapshotItem(i);
  20. console.log(elm);
  21. elm.parentNode.removeChild(elm);
  22. }
  23. }
  24.  
  25. var timer = window.setInterval(f, 50);