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

App.setAsDefaultProtocolClient for Linux #6440

Closed
atypicalprogrammer opened this issue Jul 11, 2016 · 12 comments
Closed

App.setAsDefaultProtocolClient for Linux #6440

atypicalprogrammer opened this issue Jul 11, 2016 · 12 comments

Comments

@atypicalprogrammer
Copy link

atypicalprogrammer commented Jul 11, 2016

What is the reason App.setAsDefaultProtocolClient()is not available for Linux? I was under the impression this is possible, but requires different solutions for different distros.

@anaisbetts
Copy link
Contributor

On Linux this is declared in your .desktop file, which is something you set up at install-time, not something you can toggle. I could be full of it on this though, there might be a way to register for this dynamically

@zcbenz
Copy link
Contributor

zcbenz commented Jul 12, 2016

It can be done with xdg-settings, and Chromium uses it in shell_integration_linux.cc:
https://cs.chromium.org/chromium/src/chrome/browser/shell_integration_linux.cc?sq=package:chromium

@kevinsawicki kevinsawicki changed the title App.setAsDefaultProtocolClient for Linux? App.setAsDefaultProtocolClient for Linux Jul 12, 2016
@atypicalprogrammer
Copy link
Author

@paulcbetts For windows it should be done on install too.. But that doesn't mean this API call shouldn't be available. Right now we just do it on first run.

@anaisbetts
Copy link
Contributor

@atypicalprogrammer I'm not saying what people should do, I'm saying what I (incorrectly) believed was possible

@baconbrad
Copy link
Contributor

@zcbenz @atypicalprogrammer A possible solution might be checking for gnome-open, exo-open, xdg-open, gvfs-open, or kde-open and using which ever is available. You could never guarantee support for all Linux distros but you can hopefully target common desktop environments.

@bengotow
Copy link
Contributor

bengotow commented Jul 27, 2016

Just as a sidenote, we've been using xdg-mime default to make N1 the default mail client on Linux and it's been working fairly well for folks. Would definitely be nice to push it upstream. nylas/nylas-mail@43e9b4c

@baconbrad
Copy link
Contributor

@bengotow Mime type handlers and protocol handlers are two different things.

@bengotow
Copy link
Contributor

Yep! I'm aware - the full command we use in that commit above is xdg-mime default nylas.desktop x-scheme-handler/#{scheme}. I only bring it up because it has been successfully making N1 the default handler for the mailto protocol on Debian systems and might be more broadly incorporated into Electron.

@atypicalprogrammer
Copy link
Author

Any updates on this by anyone?

@Eugeny
Copy link

Eugeny commented Apr 18, 2017

This can also be done by editing the file directly: https://askubuntu.com/questions/514125/url-protocol-handlers-in-basic-ubuntu-desktop

@hron84
Copy link

hron84 commented Aug 3, 2017

@baconbrad Not neccessarily. On Linux, proto handlers are also handled via - special - MIME types.

@codebytere
Copy link
Member

This is now in master 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants