Skip Navigation

Associate Discord Server Invite Links With Discord Through xdg commands

Whenever I click a server invite link in my browser for example, I get the xdg-open popup window which in turn opens my browser with a link in the following format:

discord:///invite-proxy/some numbers

I'm relatively familiar with xdg-mime commands, but I'm not sure what the "filetype" I should be associating with my discord.desktop file should be. Anyone that can help?

Thanks

6
6 comments
  • I don't think XDG is really useful here, I've honestly haven't met much use online of "discord:" protocol – I see more of regular "https:" links instead. As a dev around Discord clients, I know it rather uses a WebSocket server or maybe even Unix sockets as well for the 3rd party applications to communicate and share any info, including the invite code.

    • So what does that mean for trying to open links from browser in discord desktop app? Its a trivial thing, but it would be nice to have it.

      haven’t met much use online of “discord:” protocol – I see more of regular “https:”

      Do you mean in the context of discord? Like you haven't encountered many sites using discord for links that lead to discord, or in general. Do most sites use https for their invite links?

      Sorry if these are dumb questions.

      • Sorry if these are dumb questions.

        Nah it's fine, for me these might occur dump for a reason I've been into development around the Discord for a while and actually partially reimplemented their WS/IPC handling a bit for my own use within Node.js (I mean it's FOSS so anyone could technically use it as well).

        So what does that mean for trying to open links from browser in discord desktop app? Its a trivial thing, but it would be nice to have it.

        That, as long as Discord or any site running within the browser can connect to the local ports on your computer (I believe Discord should use ports within the range 6463-6472), via the WebSocket API in JS, the one could send an invite link request directly to the Discord or even for other stuff like RPC or page redirection – this works by Discord in the browser doing a check for any Discord client opened and just communicating with it directly if found via locally-executed JS. So there should be no XDG involved in the process and there's no need to configure Discord in order to handle links, at least if you open links like https://discord.gg/[code] in the browser.

        Do you mean in the context of discord? Like you haven't encountered many sites using discord for links that lead to discord, or in general. Do most sites use https for their invite links?

        I just haven't seen any of the use for their own protocol and honestly I couldn't find the docs either for that once I was dealing with the implementation of the URL handling. However, if you've noticed like some people or pages using that instead, I would love to be proven wrong – I guess I could consider then working on that within my own client if it is worth it to implement it and their protocol is not something like the legacy implementation.

6 comments