Open CodeF53 opened 2 years ago
I have a different OS on my laptop (Manjaro Linux).
Running the same procedure on it gives me a different result.
python -m electron_inject -d -t 600 -r /home/f53/Projects/SlackMod/inject.js - /usr/lib/slack/slack
Python 3.10.5\ electron-inject 0.7\ all installed python packages\ I still dont know my way around linux well enoiugh to give much more info
Python 3.8.5 x64 Electron-inject: 0.7 Windows 10 x64 Slack: Production 4.32.122 64-bit
Running
python -m electron_inject --enable-devtools-hotkeys -d -t 60 - c:\CoolDood\AppData\Local\slack\app-4.32.122\slack.exe
Does not enable dev tools. The terminal has some logging info going on but that is.
Yep, doesn't work with Slack at all. Script is not injected, keys don't work.
Python 3.10.10 electron-inject 0.7 Manjaro Slack 4.32.122
Probable cause:
[__init__.py - inject() ][ INFO] injecting hotkeys script into 54D02EB3556E5B88E6981F034B2CB656
[102485:1107/070126.237769:ERROR:devtools_http_handler.cc(766)] Rejected an incoming WebSocket connection from the http://localhost:33859 origin. Use the command line flag --remote-allow-orig
ins=http://localhost:33859 to allow connections from this origin or --remote-allow-origins=* to allow all origins.
[__init__.py - inject() ][ ERROR] Handshake status 403 Forbidden -+-+- {'content-length': '241', 'content-type': 'text/html'} -+-+- b'Rejected an incoming WebSocket connection
from the http://localhost:33859 origin. Use the command line flag --remote-allow-origins=http://localhost:33859 to allow connections from this origin or --remote-allow-origins=* to allow all
origins.'
Edit:
running it like this seems to somewhat work - at least the script (not the keys).
python -m electron_inject -d -t 60 -r test.js - /usr/bin/slack '--remote-allow-origins=*' 2>&1 | tee ei_slack.log
Test Procedure
The following is the contents of
test.js
If it is successfully injected, we should see
test
logged to the console 10 times every secondTo ensure the process runs correctly, I run the following to make sure slack has no background instances
Running the following command leads to slack successfully launching, with a perfect trace of what is being logged into the devtools console.
Pressing F12 in this new slack window does not open devtools, despite us having the
-d
argumentRunning the
/slackdevtools
in any slack chat shows them manually.\ Looking at the console we just opened,test
is not being logged 10 times every secondPossibly relevant Info
Python 3.10.1\ electron-inject 0.7\ all installed python packages\ Windows 10 Enterprise N build 19044.1826\ Slack 4.27.154