thisiscam / math-with-slack

Rendered math (MathJax) with Slack's desktop client
MIT License
306 stars 28 forks source link

4.23 MacOS Monterey 12.2.1 not working? #40

Closed nieric closed 2 years ago

nieric commented 2 years ago

Hello,

I seemingly cannot get this to work on MacOS Monterey 12.2.1 with Slack 4.23. I've reinstalled Slack multiple times, and went through the computer to find files (eg. in Library/) left over from old installations that did not get removed. Still, seemingly unsuccessful.

PS. Additionally, using the --codesign flag seems to work, but when running the scripts manually in their folder, I get

% sudo sh macos-codesign-mws.sh  
Executable=/Applications/Slack.app/Contents/MacOS/Slack
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/slack-entitlements.lKA6pFuP: unrecognized blob type (accepting blindly)
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/slack-entitlements.lKA6pFuP: invalid length in entitlement blob

This probably has nothing to do with the other issue, just adding it as a note. DS.

albinahlback commented 2 years ago

What Python version do you use? Have you tried using Python 3.6? That is what is currently tested for this project (however, that is on macOS 11.6 machines).

thisiscam commented 2 years ago

I don't believe Python version matters here AFAIK

thisiscam commented 2 years ago

Additionally, using the --codesign flag seems to work, but when running the scripts manually in their folder, I get

If the codesign works then it's probably fine. There were some update to MacOS that I had fixed in the main script, but forgot to update the the separate bash scripts.

nieric commented 2 years ago

Hi @thisiscam, great, but I still cannot seem to get Latex to render in Slack on my machine. I've had no issues with this on Windows before.

Since there is no apparent error when running the script, does anyone have a suggestion what I could do to figure out what is wrong?

thisiscam commented 2 years ago

Perhaps you can try SLACK_DEVELOPER_MENU=1 open /Applications/Slack.app (change to your Slack.app path). Doing this should open slack. You can then right click anywhere in the UI and get an "inspect element" option. This gives you the chromium debugger. Look for log messages and console outputs, see if there are any related errors?

thisiscam commented 2 years ago

Before doing that, make sure you got a fresh install of slack and the plugin first

JoeyAndBlueWhale commented 2 years ago

I did this and found 1 issue and 3 warnings. The issue is A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced. To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData. Note that for performance reasons, only the first access to one of the properties is shown. Three warnings are

Screen Shot 2022-06-08 at 01 02 40
thisiscam commented 2 years ago

My script is working. I have the same "issue" but I don't see those warnings. So at least we can disregard that issue.

Before getting into anything deeper, what's your result of:

ls /Applications/Slack.app/Contents/Resources/app-*

, after installing the script?

JoeyAndBlueWhale commented 2 years ago

My script is working. I have the same "issue" but I don't see those warnings. So at least we can disregard that issue.

Before getting into anything deeper, what's your result of:

ls /Applications/Slack.app/Contents/Resources/app-*

, after installing the script?

ents/Resources/app-* /Applications/Slack.app/Contents/Resources/app-arm64.asar /Applications/Slack.app/Contents/Resources/app-x64.asar /Applications/Slack.app/Contents/Resources/app-x64.asar.mwsbak /Applications/Slack.app/Contents/Resources/app-arm64.asar.unpacked: dist node_modules /Applications/Slack.app/Contents/Resources/app-x64.asar.unpacked: dist node_modules

thisiscam commented 2 years ago

Aha, the script did not properly recognize your M1 chip. Let me take a look in an hour

thisiscam commented 2 years ago

@JoeyAndBlueWhale

What command did you use to install the script? And what's your output of python -c 'import platform; print(platform.machine())'?

thisiscam commented 2 years ago

I think I found the issue. It's likely that people who run into this issue are using M1 chip apple with Rosette-ed python interpreter. I don't have an M1 chip, but I implemented this answer in #45 --- hopefully this will solve the problem!

JoeyAndBlueWhale commented 2 years ago

python -c 'import platform; print(platform.machine())'

x86_64

JoeyAndBlueWhale commented 2 years ago

What command did you use to install the script?

sudo python3 math-with-slack.py --macos-codesign

JoeyAndBlueWhale commented 2 years ago

I think I found the issue. It's likely that people who run into this issue are using M1 chip apple with Rosette-ed python interpreter. I don't have an M1 chip, but I implemented this answer in #45 --- hopefully this will solve the problem!

It worked! Thank you!