Last active
July 10, 2022 23:36
-
-
Save SomeoneSerge/08623e5c2cadeeb224410e0ba38f2c38 to your computer and use it in GitHub Desktop.
GreaseMonkey script to clean up links (remove "https://eur02.safelinks.protection.outlook.com/..." bits) in the emails as displayed by ms outlook web app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Replace href with originalsrc in outlook | |
// @version 1 | |
// @grant none | |
// @match https://outlook.office.com/* | |
// @run-at document-start | |
// ==/UserScript== | |
function replaceHrefs() { | |
document.querySelectorAll("a[originalsrc]").forEach(function(a) { | |
// NOTE: a.originalsrc is undefined | |
a.href = a.title.split("Original URL: ")[1].split(". Click or tap if you trust")[0]; | |
}); | |
} | |
replaceHrefs(); | |
window.addEventListener( | |
'DOMNodeInserted', | |
function (e) { replaceHrefs(); }, | |
false | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment