Mail.com Helper

Quality of life changes to Mail.com

  1. // ==UserScript==
  2. // @name Mail.com Helper
  3. // @namespace ccn0
  4. // @version 3
  5. // @description Quality of life changes to Mail.com
  6. // @author CCN0
  7. // @license MIT
  8. // @match *://*.mail.com/*
  9. // @icon https://s.uicdn.com/mailint/1.0.0/assets/favicon.ico
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. function mailMailMailMail() {
  15. function removeElements(selector) {
  16. const elements = document.querySelectorAll(selector);
  17. elements.forEach(element => {
  18. element.remove();
  19. });
  20. };
  21. function fullScreenButtonButGood() { /*add this to the main thing if you want to use it, but it throws errors bc its always checking*/
  22. const fullscreenbutton = document.getElementById('fullscreen');
  23. fullscreenbutton.id = "";
  24. fullscreenbutton.setAttribute("onclick","document.getElementById('mail-detail').requestFullscreen()");
  25. }
  26.  
  27. removeElements('[data-test^="actions-menu__item-premiummail"]');
  28. removeElements('[data-test^="actions-menu__item-games"]');
  29. removeElements('[data-test^="actions-menu__item-cloud"]');
  30. removeElements('[data-test^="actions-menu__item-ooeditor"]');
  31. removeElements('[data-test^="actions-menu__item-mailcheck"]');
  32. removeElements('[data-test^="actions-menu__item-blog"]');
  33. removeElements('[title^="Upgrade to mail.com Premium"]');
  34. removeElements('li[title^="Increase cloud storage"]');
  35. removeElements('[data-area^="features"]');
  36. removeElements('.search.widget');
  37. removeElements('.native-content-box-ad__iframe'); /*idk why ad block doesnt work*/
  38. removeElements('.ad');
  39. removeElements(`.piba-compact`);
  40.  
  41. const links = document.querySelectorAll('a[href*="://deref-mail.com"]');
  42.  
  43. links.forEach(function(link) {
  44. var originalHref = link.getAttribute('href');
  45.  
  46. var url = new URL(originalHref);
  47. var redirectUrl = url.searchParams.get('redirectUrl');
  48.  
  49. var decodedRedirectUrl = decodeURIComponent(redirectUrl);
  50.  
  51. link.setAttribute('href', decodedRedirectUrl);
  52. });
  53. };
  54. setInterval(mailMailMailMail, 250);
  55. })();