-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slack 4.0.0 doesn't contain src/static/ssb-interop.js #51
Comments
A colleague provided a link to this issue in another repo, where the same problem has been solved. It seems (at least on OSX) one needs to have |
I will take a look at this as soon as possible, but that will unfortunately be a few weeks. |
Took a look at this today. Turns out that Slack has added a Content Security Policy to avoid script injections. One can inject meta tags in the webapp by unpacking and repacking the asar file as suggested by @hwagyesa . However, it does not load the MathJax script from the CDN:
As I've understood it, it isn't possible to modify the CSP on the run, so it seems that using a CDN for script delivery is out of the picture. I also tried injecting a local copy of MathJax, but it was ignored because it wasn't in the electron manifest (and I'm unsure whether it would circumvent the CSP in any case). I guess it technically would be possible to inject the full MathJax library in the same way as the meta tags are injected now, but that is not feasible given that MathJax is over 100 mb. Does anyone have any ideas on a way forward on this? |
The unpack-inject-repack scheme is working for me in the latest version of App Store Slack provided I follow the suggestion in this comment before injecting. There is some discussion of this issue here, but it seems it is unclear why changing this setting helps. When using the version of the app downloaded from Slack's website, the unpack-inject-repack scheme was working for me even without changing the bootSonic setting. Based on the information you've posted, though, it looks like this kind of workaround likely won't be viable for long. |
@hwagyesa Could you clarify: do you manage to get math-with-slack running with this method or slack-dark-mode? |
@fsavje Both math-with-slack and slack-dark-mode work for me (and at least one of my colleagues) with this method. The script I am using with math-with-slack can be found in my fork of the repository. |
Thanks! Seems this route will work on Mac OS at least. If anyone tests it out on Linux or Windows, please report the results here. Working on a python script to avoid installing Node.js. In the meanwhile, manually unpacking and packing app.asar using node.js will work. |
@hwagyesa's route works on Linux too. |
I have Windows, but @hwagyesa didn't update the Windows version of the install script, so I can't test it. Looking forward to your python script install |
Dear fsavje, |
Hi @erikvannimwegen. I don't know if I can give anymore detailed instructions than those by @hwagyesa. However, I hope to have a draft version of the updated script up during the weekend. |
Ok great.. if there will be an updated version soon then I guess I don't need to learn. |
Dear @erikvannimwegen, you can perform the following steps to use my script, working for me and others on OSX:
The quality of my code is much worse than @fsavje's. If this seems problematic you may wait for his upcoming script. |
A draft version of the python script is up now: https://github.com/fsavje/math-with-slack/tree/v3 It should work with both Python 2.7 and 3. It has, however, not been tested on Windows or Linux. Please let me know if it doesn't work. It seems that Slack 4.0.1 overwrites the local settings JSON file. Any ideas on circumvent this would be welcomed. |
@fsavje I've had a quick try with "math-with-slack.py" on Ubuntu 16.04 and haven't been able to get it to work. I'm using the slack/slack-desktop packages (version 4.0.1) from the https://packagecloud.io/slacktechnologies/slack/debian/ repository (originally from https://slack.com/downloads/linux). I've ran the script and it changes app.asar. "grep fsavje app.asar" matches, though if I unpack then file with "npx asar extract app.asar /tmp/extract" the "ssb-interop.bundle.js" file is missing. Some things I noticed with the script:
|
I submitted a pull request #53 to make the python script work with Windows. |
Hi, I'm using Mac OSX. Running your .py script gives me this permission denied error. How can I make sure the script has write permissions?
|
I've got the following error even the latest releases. |
Ah ... Sorry. I should have tried the script below: just run
works for me. Thank you @fsavje |
My temporary fix was to hijack Basically, create rename this Slack executable to
Make it executable:
|
Trying this on Ubuntu 18.04.3 now, running just the python file I get:
if I supply the app file I get a missing local settings file:
I can't find any info on where this file might be on Ubuntu. EDIT: this call seems to have worked for me, in case it helps anyone:
|
Actually it ran successfully but didn't change anything. |
Same on Ubuntu 16.04 |
Hello! I also have a problem with unpacking user@host:~$ npx asar --verbose extract /usr/lib/slack/resources/app.asar asar_extracted/
npx: installed 21 in 2.442s
Unexpected token function |
Has anyone successfully used this script for Windows? When I run it in Python Shell, I receive a message saying `Not implemented,' and that's it. I would appreciate input from anyone who has successfully installed math-with-slack on Windows following the recent protections against code injections. |
The not implemented message means just that; nobody's implemented the functionality in the script on Windows. |
@pturne7 I submitted a pull request at #53 that makes it work on Windows. I believe that if you download the file then you'll be able to run it on Windows. |
Slack 4.2.0 seems to have finally killed the python script as well (I'm on Mac). The error is |
I'm not really sure what's happening. Given that Slack just updated on Mac, is it possible you are seeing this because of a new slack version (e.g. 4.3.3 is new on Ubuntu 18)? |
Alright, updated slack, run your new py script. So I played a bit to understand when the rendering started failing. I can trigger the issue by entering a line which contains only a latex formula. then all rendering in the current slack session is gone. If Slack is restarted, rendering works fine until the block containing this line is met, then no more rendering until new slack relaunch… by the way, both single and double $ formula trigger it. Hope you can reproduce it on your side! |
I can confirm this behavior. The key is that one has to enter a line that has ONLY a latex formula, i.e. no other text before or after it. This then breaks all rendering. A restart can fix it as long as one avoids trying to render such a 'latex only' line. |
btw I had to install the python |
Sorry, I thought that was built-in. Should be fixed by now |
@erikvannimwegen @julou So this is on Ubuntu 18, and an example single line formula as in I don't think I'm able to reproduce this in any ways above on a Mac. Maybe it's time to invoke my virtual machine |
I think I found something. The log @julou sent contains typesetting of elements with class |
Update: Ubuntu 16 + Slack 4.4.0 via Debian renders fine. |
@erikvannimwegen @julou Can you try the newest version? I pushed a fix that might solve your problem (likely not, but worth a try) |
hi @thisiscam I tried your newest version (using Slack 4.4.1 on MacOS 10.14.6). The problem is not solved yet, and occurs both on thread and person-to-person chat. But another example from @erikvannimwegen helped me specified better what triggers the bug: This renders fine
This stops all rendering after being displayed (for any latex formula in slack).
Please let me know if you can reproduce the issue on your mac, otherwise I will try to create a log for a problematic case. |
I tried after uninstalling |
I can reproduce this now. @julou Looking at mathjax/MathJax#2202, I fixed the problem by simply updating MathJax to 3.0.1 . You can try the updated script and see if it works for you? |
yeah… it works! 🍾🍾🍾 |
Not able to get it to work with Slack 4.6.0 (macOS Catalina). The script runs successfully but has no effect. |
I had the same experience. I was concerned when the release notes said the app sandbox was now enabled for all web content that Jax would be broken, and I should have trusted that instinct. I had it up and running for less than a day. |
Yes I can confirm that Slack 4.6.0 breaks this. One way around is maybe to somehow inject mathjax as a webpack transpiled module into the preload script.. it will be horribly large though and I'm not sure about its feasibility. Any suggestions are welcomed! |
Ok I pushed a commit thisiscam@80112ad, that includes an inline source of MathJax into preload.js. |
Never mind: wget downloaded the HTML, not the python script. I love when Github does that.
|
@thisiscam, does your version works for Slack 4.7? |
@YingzhouLi it is working for me. FYI I'm not the owner of this repo (so I can't close an issue or merge PR). If there are specific questions related to my fork, all are welcomed to leave issues there! |
@thisiscam Thanks. Your forked master branch works on my Ubuntu 20.04 with Slack 4.7.0. The code works for Windows as well. I have slightly modified the path search part for Windows in my fork. The readme is also updated slightly. If you prefer, I do a pull request back into your repo. |
This code is working for me as well, I have Windows and Slack 4.7.0. The search path for app.asar is implemented correctly. The only thing missing is having a version of this code not in Python, for those people that don't have Python installed. Thank you very much! |
@YingzhouLi I tried your fork on Windows 10, with Slack 4.8 and it worked. You might want to make the instructions more clear that you want to say "yes" to the most recent slack installation, because if you say "yes" to the oldest, it never prompts you for the newest. It turned out I had folders for both slack 4.7 and 4.8, and couldn't figure out why it wasn't working until I studied your script. |
@YingzhouLi If you can submit a PR to my repo, I will merge in your changes. Thanks! |
@Dr-Irv Thank you for the suggestion. I have revised the interface to select among multiple versions of Slack. (It seems that new Slack installation will also remove old versions from Windows.) |
Is there any version that works on Mac with Slack 4.8.0 ?? |
@Yuren-Zhong Try this fork https://github.com/YingzhouLi/math-with-slack . It worked for my colleague who has slack 4.8 on Mac |
https://github.com/thisiscam/math-with-slack works for me on Mac with Slack 4.8.0 |
I'm successfully using "thisiscam"'s fork with 4.8.
Marc Milgrom
[email protected] (mailto:[email protected])
…On Sep 10 2020, at 1:00 pm, Irv Lustig ***@***.***> wrote:
@Yuren-Zhong (https://github.com/Yuren-Zhong) Try this fork https://github.com/YingzhouLi/math-with-slack . It worked for my colleague who has slack 4.8 on Mac
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (#51 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ABE6JCOASUBFZ3ENZH37SXTSFEA3FANCNFSM4IBWROAQ).
|
I just tried to install this for Slack 4.0.0 (downloaded via the Mac OSX App Store) and it failed to find the correct file.
When I searched the file directory, no
ssb-interop.js
file was found:Any ideas which file to point it to instead?
The text was updated successfully, but these errors were encountered: