Skip to content
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

[Feature Request] Implement discord:// scheme / protocol #769

Open
3 tasks done
Write opened this issue Jul 19, 2024 · 10 comments · May be fixed by #813
Open
3 tasks done

[Feature Request] Implement discord:// scheme / protocol #769

Write opened this issue Jul 19, 2024 · 10 comments · May be fixed by #813
Labels
enhancement New feature or request

Comments

@Write
Copy link

Write commented Jul 19, 2024

Discord Account

No response

Motivation

I'd like to use this app as a discord replacement.
This has been requested here #200 but closed without any response / reason.

Solution

Add support for discord:// url-scheme

Alternatives

Proxying discord:// to vesktop:// but this doesn't exist either.

Additional context

No response

Request Agreement

  • I have searched the existing issues and found no similar issue
  • This is not a plugin request
  • This is not a Vencord feature request
@Write Write added the enhancement New feature or request label Jul 19, 2024
@mmaietta
Copy link

Quick chime-in since I noticed this project leverages electron-builder. Adding a protocol scheme is very easy in the builder config.

  protocols: {
    name: "Vesktop Example",
    schemes: [
      "vesktop"
    ]
  },
  linux: {
    desktop: {
      MimeType: "x-scheme-handler/vesktop"
    },
  },

@Vendicated
Copy link
Member

This has been requested here #200 but closed without any response / reason.

I closed it because i decided it wasn't useful enough to warrant the time spent. I haven't seen the protocol used much, not even by Discord. What aspects of it do you consider useful? As in, which routes?

@Write
Copy link
Author

Write commented Jul 19, 2024

This has been requested here #200 but closed without any response / reason.

I closed it because i decided it wasn't useful enough to warrant the time spent. I haven't seen the protocol used much, not even by Discord. What aspects of it do you consider useful? As in, which routes?

First example coming to my mind : Every time a server is joined via a web link, it should open the app, to the correct server that is.

@Vendicated
Copy link
Member

that already works! :P it's done via RPC, not the protocol

@Write
Copy link
Author

Write commented Jul 19, 2024

that already works! :P it's done via RPC, not the protocol

This doesn't work for me ? It tries to open a discord:// url scheme when I click on "launch app" and it just says no app exist for such scheme, or something along those lines. At least on macOS + Safari.

Guessing RPC would require discord to be already running ?

@Vendicated
Copy link
Member

Oh i see, interesting! Indeed, RPC only works if you have Vesktop open. I wasn't aware they use the protocol when RPC is unreachable, but you are right

@Write
Copy link
Author

Write commented Jul 22, 2024

In the meantime,

I used Platypus to register discord:// scheme and open vesktop app.
It doesn't passtrough args to vesktop but merely just opens the app

Example of config for Platypus :
shot on 2024-July-22@11h44(26)

In script path, I just added a script containing this :

#!/bin/sh

open -jga /Applications/Vesktop.app

When you tick "Accept dropped items", click "Settings" and then tick "Register as URI scheme handler" and simply add discord:// (or discord, I don't remember). This will register the discord:// link to your new app, and this new app will simply launch Vesktop when launched :)

Covkie added a commit to Covkie/Vesktop that referenced this issue Aug 13, 2024
@Covkie Covkie linked a pull request Aug 13, 2024 that will close this issue
@Arcitec
Copy link

Arcitec commented Sep 11, 2024

I accidentally made a duplicate thread, so I'll bring the information here:


Motivation

Currently, Vesktop does not register itself to handle Discord links, so the browser won't offer to open Vesktop instead.

I am not sure if this can be solved.

Solution

The required MIME type for "Open in Discord App" support can be added with this command:

sudo desktop-file-edit --add-mime-type=x-scheme-handler/discord /usr/share/applications/vesktop.desktop

That command adds the following line to the .desktop file (which could be manually included in the project instead of relying on the above tool):

MimeType=x-scheme-handler/discord;

If someone already has Vesktop on the system, the MIME handler database has to be updated like this:

sudo update-desktop-database

(That last command might be needed as post-install in the packages such as RPM, I can't remember. It used to be required at least. But nowadays the system might detect the .desktop file and register MIME types automatically, at least with the DNF package manager. I really don't know.)

After registering this MIME support, you can verify that it works with this command in Terminal:

xdg-open "discord://test"

However, after registering this MIME support, I am not sure if something else will be needed to fully support "Open in Discord App" detection on pages such as https://discord.com/invite/GameSir

Most likely, the Electron wrapper will need some change too, so that the incoming discord:// URL gets forwarded to the built-in Discord web app.

@Covkie
Copy link
Collaborator

Covkie commented Sep 11, 2024

pure yappery ☝️

build #813 if you want this

@Write
Copy link
Author

Write commented Sep 11, 2024

pure yappery ☝️

build #813 if you want this

The fuck ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants