巴哈姆特-阻擋廣告

享受無廣告體驗的巴哈姆特吧!

  1. // ==UserScript==
  2. // @name 巴哈姆特-阻擋廣告
  3. // @name:zh-TW 巴哈姆特-阻擋廣告
  4. // @name:zh-HK 巴哈姆特-阻擋廣告
  5. // @name:en Bahamut - No more Ads!
  6. // @namespace BahamutAntiAd
  7. // @description 享受無廣告體驗的巴哈姆特吧!
  8. // @description:zh-TW 享受無廣告體驗的巴哈姆特吧!
  9. // @description:en Enjoy Bahamut Without any advertisement!
  10. // @author SeaBao
  11. // @include /https?:\/\/.+\.gamer\.com\.tw(\/.+)?/
  12. // @version 1.2.1
  13. // @grant none
  14. // @run-at document-body
  15. // @icon http://i.imgur.com/uvVy2nm.png
  16. // @date 2016-12-24
  17. // ==/UserScript==
  18. (function() {
  19. 'use strict';
  20. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  21. var observer = new MutationObserver(function(){
  22. killADs();
  23. });
  24. var option = {
  25. 'childList': true,
  26. 'subtree': true
  27. };
  28. observer.observe(document.body, option);
  29.  
  30. // Send 'AntiAd' function to its Death
  31. Object.defineProperty(window, 'AntiAd', {
  32. enumerable: true,
  33. writable: false,
  34. value: null
  35. });
  36.  
  37. function killADs() {
  38. // Remove the Ad elements on the website.
  39. var adList = document.body.querySelectorAll("#flyRightBox>div, #BH-bigbanner, .BA-billboard, .BA-cboxAD, #aswift_0_expand");
  40. for (var i=0; i < adList.length; i++) {
  41. adList[i].parentNode.removeChild(adList[i]);
  42. }
  43. }
  44. })();

QingJ © 2025

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