O365_Unread_Email_Script

Tampermonkey script that changes the background color for unread emails in the Outlook page of Microsoft O365 (Office 365)

  1. // ==UserScript==
  2. // @name O365_Unread_Email_Script
  3. // @author jasonmclose
  4. // @version 0.1
  5. // @description Tampermonkey script that changes the background color for unread emails in the Outlook page of Microsoft O365 (Office 365)
  6. // @author Jason Close
  7. // @match https://outlook.office365.com/*
  8. // @grant none
  9. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js
  10. // @namespace https://greasyfork.org/users/31726
  11. // ==/UserScript==
  12. 'use strict';
  13.  
  14. function timerFunction() {
  15. $("._lvv_l1").find("[aria-label*=Unread]").addClass("unread_email");
  16. $(".unread_email.ms-bg-color-themeLight").removeClass("unread_email");
  17. }
  18.  
  19. $(document).ready(function() {
  20. $("head").append('<style type="text/css"></style>');
  21. var newStyleElement = $("head").children(':last');
  22. newStyleElement.html('.unread_email{background:#ffc2b3;} .clicked_unread_email{background:#A2D5E1;}');
  23. setInterval(timerFunction, 500);
  24. });