Skip to content

Instantly share code, notes, and snippets.

@jabyrd3
Created February 2, 2018 23:58
Show Gist options
  • Save jabyrd3/ab2e3dd9ff54f6785e63f711e74c9827 to your computer and use it in GitHub Desktop.
Save jabyrd3/ab2e3dd9ff54f6785e63f711e74c9827 to your computer and use it in GitHub Desktop.
Hides 'custom reply' messages from slackbot in a channel defined with 'indexof'
sed -i "" -e '/startup();/ a\
setTimeout(()=>require(\"electron\").remote.webContents.getAllWebContents().map(e=>e.on(\"did-navigate-in-page\",(e,t,n)=>n&&e.sender.executeJavaScript("if(document.title.indexOf(\\"project-sa-code\\") > -1){const style = document.createElement(\\"style\\"); style.type=\\"text/css\\";style.innerHTML = \\".c-message--custom_response { display: none; }\\"; document.getElementsByTagName(\\"head\\")[0].appendChild(style);}\"))), 6000);' /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment