laCour/slack-night-mode

Seems Slack changed something!

zedle opened this issue ยท 14 comments

zedle commented

Just had Slack refresh itself and now the background on the chat view is white rather than black. Going to revert to stock for now, just wanted to mention this issue!

Thanks again for this project.

Update to the latest version, this was fixed a few hours ago.

uninstalled slack and reinstalled and it's still broken on the desktop side.

Update the theme, not Slack.

How do you update the theme using the desktop hack? I've already re-appended it but it still does the white chat background like OP mentioned.

Hack here: #73 (comment)

I updated black.css in my desktop app but it seems like chat background is still white :(

osleg commented

Same here, fetched the last css from git but the background is still white
My bad, forgot to reapply the patch before refreshing slack window, works like a charm

@osleg what patch are you talking about?

osleg commented
#! /bin/bash

#since slack 2.6.3 there is some hack in that file, so make sure this piece of code goes before the:
#start(assignIn({}, require('electron').remote.getGlobal('loadSettings'), { windowType: 'WEBAPP' }));
#..line

cat << 'EOF' >> /usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js
document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: 'https://raw.githubusercontent.com/laCour/slack-night-mode/master/css/raw/black.css',
   success: function(css) {
     $("<style></style>").appendTo('head').html(css);
   }
 });
});
EOF
echo If Slack.app is already running, refresh with CTRL-R

This one, for linux tho

See my response on issue #160; there is a single line in the CSS that needs to be updated to fix this on desktop, but I do not think that @laCour wants to maintain this for windows.

I am in the process of forking the repository and will try to maintain a version specifically for the desktop client

As a temporary fix you can add this line as part of the custom case injection like this:

document.addEventListener('DOMContentLoaded', function () {
        // temp fix for white chat background from recent slack-app update
        .p-message_pane .c-message_list.c-virtual_list--scrollbar > .c-scrollbar__hider {
        background: #222; !important
        }
    `;
    $.ajax({
        url: 'https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css',
        success: function (css) {
            $('<style></style>').appendTo('head').html(css + tt__customCss);
        }
    });
});
zedle commented

The fix was in fact merged by @laCour yesterday - this is the script I use for OS X for those who are still having issues.

#! /bin/bash

# Don't want to interpret variables whilst reading from the HEREDOC - thus the single quotes... potto
cat << 'EOF' >> /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: 'https://raw.githubusercontent.com/laCour/slack-night-mode/master/css/raw/black.css',
   success: function(css) {
     $("<style></style>").appendTo('head').html(css);
   }
 });
});
EOF
echo If Slack.app is already running, refresh with CMD-R

@zedle you may want to review the commit history as the change was never committed past the initial fix.

@cryocaustik Don't use rawgit.com. Use the raw.githubusercontent.com URL which isn't cached permanently and has the committed fixes.

@laCour thank you for catching and pointing that out; I missed the part of permanent caching based on URL in rawgit. I will make sure to update my docs.