For the security conscious among us (or those on corporate networks that would kill us for including external code in a JS File in our slack), here's a version that inlines the contents of that file, and asks you for permission before updating so you can check out the "css" downloaded.
(I put "css" in quotes because there's a risk that the code could be compromised and not be CSS at all. Articles like this hackernoon.com/im-harvesting-credi... make me nervous about these types of attack vectors).
well, sounds like you don't have the right permissions to edit that file.
just add sudo at the beginning of the one-liner (on a ctrl + a gets you there).
Should have said this in my original post, but sudo doesn't seem to help. I have admin permissions on this computer, though it's running Mojave and I'm not sure if that added any complications. I also dragged Terminal into "Full Disk Access" in Security & Privacy preferences just to be sure. Weird.
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.
code one-liner for repeated injection:
just paste in terminal and hit enter
sudo tee -a fix from sven
For the security conscious among us (or those on corporate networks that would kill us for including external code in a JS File in our slack), here's a version that inlines the contents of that file, and asks you for permission before updating so you can check out the "css" downloaded.
(I put "css" in quotes because there's a risk that the code could be compromised and not be CSS at all. Articles like this hackernoon.com/im-harvesting-credi... make me nervous about these types of attack vectors).
In any case:
Hey fynn, I tried this command and got the following error:
-bash: /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js: Permission denied
Any idea why?
well, sounds like you don't have the right permissions to edit that file.
just add
sudo
at the beginning of the one-liner (on a ctrl + a
gets you there).Should have said this in my original post, but
sudo
doesn't seem to help. I have admin permissions on this computer, though it's running Mojave and I'm not sure if that added any complications. I also dragged Terminal into "Full Disk Access" in Security & Privacy preferences just to be sure. Weird.well, admin permissions and sudo aren't really the same. some files have an extra layer of "protection".
what does
ls -la /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
say?Here's what I get:
-rw-r--r-- 1 root wheel 3806 Oct 22 09:03 /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
(I edited the file manually this morning to get it working)
yeah so the file belongs to the
root
user.. not you, meaning you have to usesudo
orchown
Just use
to fix your permission issues.
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.
edit: Implemented Wayne's jsdelivr modification, used absolute path to ssb-interop.js in sed command
I love this community