Open batjko opened 5 years ago
Hi @batjko,
As a workaround (for the stable version 4.0.0) I was able to make the theme work by doing a couple extra steps (it seems that Slack is loading the ssb-interop.bundle.js
from C:\Users\<username>\AppData\Local\slack\app-[4.x.x]\resources\app.asar
archive. So I did this:
npm
app.asar
archive and app.asar.unpacked
somewhere else (let's say our_dir
)our_dir
and install asar
package with npm install -g asar
app.asar
archive with asar extract app.asar app
(now you should have an app
folder alongside app.asar
and app.asar.unpacked
app\dist
folder and modify ssb-interop.bundle
by adding at the end of file:
document.addEventListener('DOMContentLoaded', function () {
$.ajax({
url: 'https://raw.githubusercontent.com/earlduque/Slack-Dark-Theme/master/dark.css',
success: function (css) {
$("<style></style>").appendTo('head').html(css);
}
});
});
C:\Users\<username>\AppData\Local\slack\app-[4.x.x]\resources\app.asar
app
folder into C:\Users\<username>\AppData\Local\slack\app-[4.x.x]\resources
After this steps are performed the theme should work properly.
Note: In the beta version I noticed that jQuery is not recognized by ssb-interop.bundle. So if you want to make it work you should change from jQuery AJAX request to Vanilla JS AJAX request.
alinoancea, Can you make the changes and upload the files needed and where to put them? I don't have npm or know how to use it. your help would be appreciated. thanks
Figured it out, Thank you for the help :)
Hi @FireRx, glad I could help.
I will try to push on the repo, I hope today, a script for Windows which executes the steps without needing user interaction.
If someone is using macOS or Linux (v4.0.0 for Linux is not released yet), I found this script which does the installation of the theme. You will need to create in the same directory from which you execute the script a file called event-listener.js
with the content:
document.addEventListener('DOMContentLoaded', function () {
$.ajax({
url: 'https://raw.githubusercontent.com/earlduque/Slack-Dark-Theme/master/dark.css',
success: function (css) {
$("<style></style>").appendTo('head').html(css);
}
});
});
So I managed to finish the script which install the theme automatically. For the script to run successfully npm
is required to be installed and added to PATH environment variable (by default when installing npm
).
PR is #36
I can also confirm that simply sharing the recreated app.asar between like/trusted machines (Win10 to Win10, etc.) works.
Thanks for your feedback. There should be no problem moving the archive between machines which have the same slack version (i.e >= 4.0.0). I think that a problem could be if we want to move an archive from an older slack version to a newer one.
Thanks again. :+1:
@alinoancea - you can ignore my other comment. This worked great.
@imjuststeve - I'm happy that it worked. Can you tell us how did you manage to get it working? Thanks.
I just followed you instructions. 😎
From: Alin Oancea notifications@github.com Sent: Wednesday, July 17, 2019 11:38 AM To: earlduque/Slack-Dark-Theme Cc: FireRx; Mention Subject: Re: [earlduque/Slack-Dark-Theme] Support Slack client v4 (#35)
@imjuststevehttps://github.com/imjuststeve - I'm happy that it worked. Can you tell us how did you manage to get it working? Thanks.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/earlduque/Slack-Dark-Theme/issues/35?email_source=notifications&email_token=AMT5XFE6HAK23NO4TVUM5RTP74ADJA5CNFSM4IBQGOL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2D5BLQ#issuecomment-512217262, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMT5XFCTOXP6GVY7NNNCT4TP74ADJANCNFSM4IBQGOLQ.
A simpler method for steps provided by @alinoancea: install 7zfm, then install Asar7z. Then in 7zfm you can just edit ssb-interop.bundle
directly. It will spawn an external editor and ask if you want to update the file after saving the edit and exiting the editor. Make sure to quit Slack before doing this, of course.
Did something happen to the script? the all white background in the chat windows is back again Yuck
Got it going again. have to use the Help/Troubleshoot/ reset App data to get it to show correctly again . Thanks,
After some investigation I found out that in some cases jQuery is not understand by Slack app after the script is ran. I tried the method suggested by @FireRx and everything worked just fine. Thanks.
the method works on build 4.01 also :)
It stopped working for me with 4.0.1.
Looks like v4 changes a few things, certainly the folder structure is different.
This folder, mentioned in the README instructions no longer exists:
C:\Users\username\AppData\Local\slack\app-[4.x.x]\resources\app.asar.unpacked\src\static
Instead ofsrc
they seem to now only give you thedist
folder (at least on Windows, but there's no reason to believe it's different on the other OS's):And no
ssb-interop.js
can be found anywhere, as far as I can make out.Not sure what else has changed.