Greasy Fork 还支持 简体中文。

Hide youtube google ad

hide youtube google ad

目前為 2018-02-05 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Hide youtube google ad
  3. // @name:zh-CN 隐藏youtube google广告
  4. // @namespace vince.youtube
  5. // @version 1.0
  6. // @description hide youtube google ad
  7. // @description:zh-CN 隐藏youtube显示的google广告
  8. // @author vince ding
  9. // @match https://www.youtube.com/*
  10. // ==/UserScript==
  11.  
  12. function closeAd(){
  13. var css = '.ad-container,#player-ads{ display: none!important; }',
  14. head = document.head || document.getElementsByTagName('head')[0],
  15. style = document.createElement('style');
  16.  
  17. style.type = 'text/css';
  18. if (style.styleSheet){
  19. style.styleSheet.cssText = css;
  20. } else {
  21. style.appendChild(document.createTextNode(css));
  22. }
  23.  
  24. head.appendChild(style);
  25. }
  26.  
  27. closeAd();