Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Rewrite OWA Links to direct URL
// ==UserScript==
// @name OWA Direct Links
// @version 0.1.0
// @description Rewrite OWA Links to direct URL
// @author Gavin Lloyd <>
// @match https://webmail.example.tld/*
// @require
// @grant none
// ==/UserScript==
(function($) {
'use strict';
var rewrite = function() {
var $links = $('a[href^="redir.aspx?"]');
console.log('Rewriting %s links', $links.length);
$links.each(function() {
var $a = $(this);
var href = unescape($a.attr('href').replace(/.*&URL=([^&]*).*/, '$1'));
$a.attr('href', href);
// go nuts
setInterval(rewrite, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.