re: Easy Dark Mode for Slack VIEW POST

re: code one-liner for repeated injection: echo 'document.addEventListener("DOMContentLoaded", function() {$.ajax({url: "

i have modified Fynn’s one liner to allow the script to be executed multiple times without adding the code more than once. If you place this script in an automator application on your mac, you can add it as a startup program so that it runs on boot.

sed -i.bak '/darkmode BEGIN/,/darkmode END/d' /Applications/ && echo -e '//darkmode BEGIN\ndocument.addEventListener("DOMContentLoaded", function() {\n $.ajax({\n   url: "",\n   success: function(css) {\n     let overrides = `\n     code, pre { background-color: #535353; color: #ffffff; }\n     .c-mrkdwn__pre, .c-mrkdwn__quote, pre { background: #535353 !important; background-color: #535353 !important; }\n     #client_body:not(.onboarding):not(.feature_global_nav_layout):before {display: none;}\n     `\n     $("<style></style>").appendTo("head").html(css + overrides);\n   }\n })});\n//darkmode END' >> /Applications/

edit: Implemented Wayne's jsdelivr modification, used absolute path to ssb-interop.js in sed command

code of conduct - report abuse