-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Support discord uri scheme #813
base: main
Are you sure you want to change the base?
Conversation
attempt to cover malformed or incomplete uris Use RegExp to avoid escape character hell
Confirmed Working on macOS Sonoma 14.6 via |
also consolidated restore function
Discord handles incorrect schemes pretty well but `discord:///settings` is a case where it doesn't, so this may be needed to ensure user experience
Looks clean for the most part. What's up with app.on("open-url", (_, url) => {
if (uriFiredDarwin) restoreVesktop();
else loadUrl(url);
...cut...
if (!uriFiredDarwin) loadUrl(uri); and there's no mention of needing to do that in the official Electron docs: https://www.electronjs.org/docs/latest/tutorial/launch-app-from-url-in-another-app Even if it's actually necessary, the current code with that variable is fragile and unclear (no clear flow). Can it be removed as per the Electron docs, or rewritten in a way that flows better? Or adding code comments to explain the reasoning behind the weird flow. Does it fix a platform-specific bug? Then please mention that in a comment. :) |
I actually tested it inside a vm this time instead of guessing :p
did anyone test this with flatpak? |
I've only had a really quick look at the new commit but the code definitely makes a lot more sense now. :) Now I finally understand its purpose. So it seems like when Vesktop is being called as URL Open handler, on Mac it triggers an "open-url" event, and on Linux/Windows it instead triggers a "app executed with arg The new code makes sense and seems robust. Nice work. :) Edit: The commit message is pretty funny too. ;) |
- - desktop-file-edit --set-key="Exec" --set-value="startvesktop" --set-icon=$FLATPAK_ID squashfs-root/vesktop.desktop
+ - desktop-file-edit --set-key="Exec" --set-value="startvesktop %U" --set-icon=$FLATPAK_ID squashfs-root/vesktop.desktop Will have to be done. Other than that I'm not familiar with the rest of the flatpak spec to know if any metadata is needed for flathub regarding consuming a MimeType. |
does this not work with args? for example jumping to a message or opening invites |
This is NOT for an existing instance. At most it focuses the window like youre experiencing. This is for launching Vesktop from a closed state (not to tray!!!). Discord desktop has this identical behaviour. arRPC handles existing instances via websockets. I'm assuming you have arrpc disabled since vesktop is not handling invites like you implied. I guess because of that case existing instance support can be implemented? "args" do work btw |
there are deeplinks that allow you to jump to a message that work on the normal discord app, but since arguments don't seem to be supported here they wont work (at least for me, even with arRPC enabled) |
@4A8 can you explain in detail what about this PR isn't working as expected and how youre testing it. Executing if this doesn't work youre doing something wrong with building this branch. im not gonna really be able to help you there. |
basically, doing exactly what you just did simply opens the vesktop window and does not highlight anything, i even tried with a link of my own |
closes: #769
Could someone on mac confirm this works as well? (I followed the electron docs so im like pretty sure it works but 🥴)