Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akalongman/slack
https://github.com/akalongman/slack
dark-theme slack
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/akalongman/slack
- Owner: akalongman
- License: mit
- Created: 2018-02-22T10:55:23.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-22T11:06:14.000Z (almost 7 years ago)
- Last Synced: 2025-01-03T05:06:44.458Z (8 days ago)
- Topics: dark-theme, slack
- Language: CSS
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slack dark theme
In the file `/usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js` add
```js
document.addEventListener("DOMContentLoaded", function() {// Then get its webviews
let webviews = document.querySelectorAll(".TeamView webview");// Fetch our CSS in parallel ahead of time
const cssPath = 'https://raw.githubusercontent.com/akalongman/slack/master/dark.css';
let cssPromise = fetch(cssPath).then(response => response.text());// Insert a style tag into the wrapper view
cssPromise.then(css => {
let s = document.createElement('style');
s.type = 'text/css';
s.innerHTML = css;
document.head.appendChild(s);
});// Wait for each webview to load
webviews.forEach(webview => {
webview.addEventListener('ipc-message', message => {
if (message.channel == 'didFinishLoading')
// Finally add the CSS into the webview
cssPromise.then(css => {
let script = `
let s = document.createElement('style');
s.type = 'text/css';
s.id = 'slack-custom-css';
s.innerHTML = \`${css}\`;
document.head.appendChild(s);
`
webview.executeJavaScript(script);
})
});
});
});
```