Created
October 18, 2023 21:55
-
-
Save oeo/6817df33212611d6148d4099abe78813 to your computer and use it in GitHub Desktop.
This file contains 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 revert-slack-ui | |
// @description reverts to the old slack ui for web based users (oct/18/23) | |
// @version 0.0.03 | |
// @match https://*.slack.com/* | |
// @grant none | |
// @run-at document-body | |
// ==/UserScript== | |
(function() { | |
let loop | |
function modifyLocalStorage() { | |
let localConfig = localStorage.getItem("localConfig_v2") | |
if (localConfig && /\"is_unified_user_client_enabled\":true/.test(localConfig)) { | |
document.write('') | |
localConfig = localConfig.replace(/\"is_unified_user_client_enabled\":true/g, '\"is_unified_user_client_enabled\":false') | |
localStorage.setItem("localConfig_v2", localConfig) | |
try { | |
clearInterval(loop) | |
} catch (e) {} | |
return location.reload(true) | |
} | |
return false | |
} | |
modifyLocalStorage() | |
loop = setInterval(modifyLocalStorage, 25) | |
setTimeout(function() { | |
try { | |
clearInterval(loop) | |
} catch (e) {} | |
}, 5000) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment