隐藏Outlook广告

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

  1. // ==UserScript==
  2. // @name Hide Outlook ads
  3. // @name:zh-CN 隐藏Outlook广告
  4. // @namespace https://gf.qytechs.cn/zh-CN/users/42351
  5. // @version 1.9
  6. // @description Hide embedded ads in Outlook
  7. // @description:zh-CN 隐藏Outlook网页端的各种内嵌广告
  8. // @icon64 https://antecer.gitlab.io/amusingdevice/icon/antecer.ico
  9. // @icon https://antecer.gitlab.io/amusingdevice/icon/antecer.ico
  10. // @author Antecer
  11. // @include http*://outlook.live.com/*
  12. // @run-at document-body
  13. // @grant none
  14. // @compatible chrome 测试通过
  15. // @compatible firefox 测试通过
  16. // @compatible opera 未测试
  17. // @compatible safari 未测试
  18. // ==/UserScript==
  19. // outlook标准版广告屏蔽规则
  20. var cssNomal = [
  21. '._n_h{display: none !important;}', //隐藏右侧广告
  22. '#primaryContainer > div{right: 0px !important; bottom:0 !important;}', //消除上一条广告的占位
  23. '._n_15{display: none !important;}', //隐藏"升级到 Premium"按钮
  24. '._n_05{bottom: 40px !important;}', //消除上一条广告的占位
  25. 'div[style*="height: 40px"][style*="bottom: 0px"]{display: none !important;}', //隐藏底部的推荐Edge广告
  26. 'div[style*="top: 40px"] > div > div { bottom:0 !important;}', //消除上一条广告的占位
  27. '[role=listbox]>div>div>div>[style] {display: none !important;}', //隐藏收件箱>其他选项卡的内嵌广告
  28. ].join("\r\n");
  29. // outlook测试版广告屏蔽规则
  30. var cssBeta = [
  31. '#app>div>div:last-child>div>div:first-child>div:last-child {display: none !important;}', //隐藏右侧广告
  32. '[data-focuszone-id=FocusZone8]~div:not([role]) {display: none !important;}', //隐藏订阅outlook广告
  33. '._1i5KvAsU83Sr-2zY9weMMY {display: none !important;}', //隐藏收件箱>其他选项卡的内嵌广告
  34. ].join("\r\n");
  35. // 创建CSS规则节点
  36. function addStyle(css) {
  37. var node = document.createElement('style');
  38. node.type = 'text/css';
  39. node.id = 'blockAD';
  40. node.appendChild(document.createTextNode(css));
  41. document.querySelector('body').appendChild(node);
  42. }
  43. // 注入CSS规则节点
  44. if(window.location.pathname.indexOf('mail') === 1){
  45. addStyle(cssBeta);
  46. }
  47. else if(window.location.pathname.indexOf('owa') === 1){
  48. addStyle(cssNomal);
  49. }
  50. else{
  51. window.location.hash = '缺少该页面的广告过滤规则!';
  52. }

QingJ © 2025

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