Optimize work experience at Microsoft

Optimize work experience at Microsoft!

  1. // ==UserScript==
  2. // @name Optimize work experience at Microsoft
  3. // @namespace https://www.microsoft.com/
  4. // @version 1.0.0
  5. // @description Optimize work experience at Microsoft!
  6. // @author Guosen Wang
  7. // @match https://ms.portal.azure.com/*
  8. // @match https://m365pulse.microsoft.com/*
  9. // @run-at document-start
  10. // @grant none
  11. // ==/UserScript==
  12. (function () {
  13. 'use strict';
  14. const host = location.host;
  15.  
  16. switch (true) {
  17. case 'ms.portal.azure.com' === host:
  18. azure();
  19. break;
  20. case 'm365pulse.microsoft.com' === host:
  21. m365pulse();
  22. break;
  23. }
  24. })();
  25.  
  26. function azure() {
  27. let checkExist = setInterval(function () {
  28. const selector = '#_weave_e_6';
  29. if (document.querySelector(selector)) {
  30. document.querySelector(selector).remove();
  31. const bannerLabel = document.querySelector("#_weave_e_5 > div.fxs-topbar-internal.fxs-internal-full");
  32. bannerLabel.innerText = bannerLabel.innerText.replace(" (Preview)", "");
  33. clearInterval(checkExist);
  34. }
  35. }, 100);
  36. setTimeout(() => {
  37. clearInterval(checkExist);
  38. }, 5000);
  39. }
  40.  
  41. function m365pulse() {
  42. // Remove the "New Version" link
  43. let checkExist_NewVersionLink = setInterval(function () {
  44. const newVersionLink = document.querySelector('a.right:nth-child(1)');
  45. if (newVersionLink) {
  46. if (newVersionLink.innerText === 'New Version') {
  47. newVersionLink.remove();
  48. }
  49. clearInterval(checkExist_NewVersionLink);
  50. }
  51. }, 100);
  52. setTimeout(() => {
  53. clearInterval(checkExist_NewVersionLink);
  54. }, 5000);
  55.  
  56. // Remove feedback widget
  57. let checkExist_FeedbackWidget = setInterval(function () {
  58. const feedbackWidget = document.querySelector('div[class^="feedback-"]');
  59. if (feedbackWidget) {
  60. feedbackWidget.parentElement.remove();
  61. clearInterval(checkExist_FeedbackWidget);
  62. }
  63. }, 100);
  64. setTimeout(() => {
  65. clearInterval(checkExist_FeedbackWidget);
  66. }, 10000);
  67. }

QingJ © 2025

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