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

Allow setting open_dispatcher for unknown schemes? #5303

Open
The-Compiler opened this issue Mar 21, 2020 · 3 comments
Open

Allow setting open_dispatcher for unknown schemes? #5303

The-Compiler opened this issue Mar 21, 2020 · 3 comments
Labels
priority: 2 - low Issues which are currently not very important.

Comments

@The-Compiler
Copy link
Member

The downloads.open_dispatcher setting allows using something other than xdg-open for opening downloads.

For unknown schemes (such as mailto: links), this currently isn't possible. The only way out for us is using QDesktopServices::setUrlHandler where we could have a handler function spawning something different. The remaining question is what schemes to do this for. I suppose we could expose a config option for those, and have something like ['mailto', 'magnet'] as a reasonable default.

@The-Compiler The-Compiler added the priority: 2 - low Issues which are currently not very important. label Apr 14, 2020
@lelgenio
Copy link

I was trying to get mailto: links working with mutt, I ended up with this:

# ~/.local/share/applications/neomutt.desktop
[Desktop Entry]
Name=Neomutt
TryExec=neomutt
Exec=neomutt %U
Terminal=true
Type=Application
MimeType=x-scheme-handler/mailto;

This seems to work for Firefox and my desktop launcher, but not Qutebrowser, and swaymsg exec xdg-open mailto:xxx; neomutt gets launched but not in a terminal.

Running a dummy script that dumps env I figured it was ignoring the Terminal=true line, because it runs with $TERM = linux. So I just did some hacking.

# here terminal is just "exec alacritty -e $@"
Exec=terminal neomutt %U
Terminal=false

I am not necessarily asking for; This is ugly and stupid, but works. If there's a better way lemmino :)

I assume this issue is related to this, the problems also appears if I :spawn xdg-open mailto:xxx instead of clicking a url.

@The-Compiler
Copy link
Member Author

@lelgenio I don't think there's much we can do about that, as the underlying QtWebEngine/Chromium takes care of opening those links at the moment. This issue isn't really related though, it's about configuring dispatchers inside qutebrowser rather than relying on xdg-open.

@The-Compiler
Copy link
Member Author

Relevant QtWebEngine change: Add a new signal "launchExternalProtocol" when launching external url (I744b6ca9) · Gerrit Code Review - unfortunately didn't make it in and seems abandoned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: 2 - low Issues which are currently not very important.
Projects
None yet
Development

No branches or pull requests

2 participants