Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Avoid Slack's URL Redirect
// ==UserScript==
// @name Avoid Slack Redirect
// @namespace slackrediravoid
// @include https://*.slack.com/*
// @version 1
// @grant none
// ==/UserScript==
si = window.setInterval(clearanchors, 2000);
function clearanchors(){
anchors = document.getElementsByTagName('a')
for(i=0;i<anchors.length;i++){
if(anchors[i].getAttribute('onclick') != null || anchors[i].getAttribute('onmouseover') != null){
anchors[i].setAttribute('onclick', '');
anchors[i].setAttribute('onmouseover', '');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment