Created
May 7, 2018 15:49
-
-
Save aconz2/2d6d3f363edd8006d316041cc05683d0 to your computer and use it in GitHub Desktop.
slack redirect rewrite (tampermonkey)
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 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