隐藏Outlook广告

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

目前为 2018-03-05 提交的版本,查看 最新版本

  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.9
  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. // @compatible chrome 测试通过
  13. // @compatible firefox 未测试
  14. // @compatible opera 未测试
  15. // @compatible safari 未测试
  16. // ==/UserScript==
  17.  
  18. // outlook标准版广告屏蔽css
  19. var cssNomal = [
  20. '._n_h{display: none !important;}', //隐藏右侧广告
  21. '#primaryContainer > div{right: 0px !important; bottom:0 !important;}', //消除上一条广告的占位
  22. '._n_15{display: none !important;}', //隐藏"升级到 Premium"按钮
  23. '._n_05{bottom: 40px !important;}', //消除上一条广告的占位
  24. 'div[style*="height: 40px"][style*="bottom: 0px"]{display: none !important;}', //隐藏底部的推荐Edge广告
  25. 'div[style*="top: 40px"] > div > div { bottom:0 !important;}', //消除上一条广告的占位
  26. '._lvv_61 > div > div[style] {display: none !important;}' //隐藏收件箱>其他选项卡的内嵌广告
  27. ].join("\r\n");
  28. // outlook测试版广告屏蔽css
  29. var cssBeta = [
  30. '._2qPmszDwBfYpF7PO9Mn3KN{display: none !important;}', //隐藏右侧广告
  31. '._20YsfelFmugQWgNkXdkYaF{display: none !important;}', //隐藏订阅outlook广告
  32. '._254GqExCxnOxmPy7kKATP2{display: none !important;}' //隐藏收件箱>其他选项卡的内嵌广告
  33. ].join("\r\n");
  34. // 合并css规则
  35. var cssAll = '<style>' + cssNomal + cssBeta + '</style>';
  36. // 执行css规则
  37. jQuery.noConflict();
  38. (function($){ $(function(){
  39. $("head:first").append(cssAll);
  40. });})(jQuery);