Skip to content

Instantly share code, notes, and snippets.

@aconz2
Created May 7, 2018 15:49
Show Gist options
  • Save aconz2/2d6d3f363edd8006d316041cc05683d0 to your computer and use it in GitHub Desktop.
Save aconz2/2d6d3f363edd8006d316041cc05683d0 to your computer and use it in GitHub Desktop.
slack redirect rewrite (tampermonkey)
// ==UserScript==
// @name Avoid Slack Redirect
// @namespace slackrediravoid
// @include https://*.slack.com/*
// @version 1
// @grant none
// ==/UserScript==
let si = window.setInterval(clearanchors, 2000);
function clearanchors(){
let anchors = document.querySelectorAll('a[href^="https://slack-redir"]');
for (let i = 0; i < anchors.length; i++) {
console.log('Rewrote ' + anchors[i].href + ' to ' + anchors[i].text);
anchors[i].href = anchors[i].text;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment