隐藏Outlook广告

隐藏Outlook网页端的各种内嵌广告

当前为 2018-02-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Hide Outlook ads
  3. // @name:zh-CN 隐藏Outlook广告
  4. // @namespace https://greasyfork.org/zh-CN/users/42351
  5. // @require https://code.jquery.com/jquery-3.2.1.min.js
  6. // @version 0.7
  7. // @description Hide embedded ads in Outlook
  8. // @description:zh-CN 隐藏Outlook网页端的各种内嵌广告
  9. // @author Antecer
  10. // @match https://outlook.live.com/*
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. // outlook标准版广告屏蔽css
  15. var cssNomal = [
  16. '._n_h{display: none !important;}', //隐藏右侧广告
  17. '#primaryContainer > div{right: 0px !important; bottom:0 !important;}', //消除上一条广告的占位
  18. '._n_15{display: none !important;}', //隐藏"升级到 Premium"按钮
  19. '._n_05{bottom: 40px !important;}', //消除上一条广告的占位
  20. 'div[style*="height: 40px"][style*="bottom: 0px"]{display: none !important;}', //隐藏底部的推荐Edge广告
  21. 'div[style*="top: 40px"] > div > div { bottom:0 !important;}' //消除上一条广告的占位
  22. ].join("\r\n");
  23. // outlook测试版广告屏蔽css
  24. var cssBeta = [
  25. '._2qPmszDwBfYpF7PO9Mn3KN{display: none !important;}', //隐藏右侧广告
  26. '._20YsfelFmugQWgNkXdkYaF{display: none !important;}' //隐藏订阅outlook广告
  27. ].join("\r\n");
  28. // 合并css规则
  29. var cssAll = '<style>' + cssNomal + cssBeta + '</style>';
  30. // 执行css规则
  31. jQuery.noConflict();
  32. (function($){ $(function(){
  33. $("head:first").append(cssAll);
  34. });})(jQuery);