Skip to content

Instantly share code, notes, and snippets.

@aklef
Last active April 30, 2017 05:33
Show Gist options
  • Save aklef/6b85c6f46a1452190817b5b759234c72 to your computer and use it in GitHub Desktop.
Save aklef/6b85c6f46a1452190817b5b759234c72 to your computer and use it in GitHub Desktop.
Outlook Icon Replace
// ==UserScript==
// @name Outlook Icon Replace
// @version 0.1
// @description Replace the new outlook icon with the old one
// @author kleftotronic
// @date 10/09/2016
// @match *://outlook.live.com/*
// @namespace https://klef.ca/gmscripts
// @require https://code.jquery.com/jquery-latest.js
// @grant none
// @run-at document-end
// @compatibility Chrome
// @noframes
// ==/UserScript==
var $ = jQuery;
function hidePremiumButton()
{
$("div:contains('Upgrade to Premium')").last().hide();
}
function replaceIcons()
{
'use strict';
$('#O365_MainLink_NavMenu > .owaimg').removeClass('ms-Icon--waffle2 ms-icon-font-size-20').addClass('ms-Icon--outlook ms-icon-font-size-30');
$('.ms-bg-color-themeLighterAlt[role="toolbar"] .owaimg:first').removeClass('ms-icon-font-size-16-circle').addClass('ms-icon-font-size-20-circle');
}
var x = new MutationObserver(function (mutations) {
mutations.forEach(function(mutation)
{
if (mutation.removedNodes.length > 0)
{
mutation.removedNodes.forEach(function(node) {
if (node.id == 'owaLoading')
{
replaceIcons();
hidePremiumButton();
x.disconnect();
}
});
}
});
});
if ($('#owaLoading'))
{
x.observe($('body').get(0), { childList : true });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment