You are not logged in.

#1 2012-09-30 17:58:50

djraymondnm
Member
From: Socorro, NM, USA
Registered: 2011-12-28
Posts: 59
Website

Configuring "mailto:" in chromium browser

The chromium browser used without a desktop environment doesn't respond
to "mailto:" entries on web pages in its default configuration.  This has been
discussed in the chromium wiki entry and in various forum threads.  A solution
to this problem discussed in a number of threads is to hack the /usr/bin/xdg-email
script to fake a recognized desktop environment, e.g., gnome or kde.  This works,
but is ugly, since one's xdg-email is likely to get overwritten if xdg is upgraded.

If no desktop environment is recognized, xdg-email (which chromium uses to
send email) invokes the default browser.  Here is a hack that requires no
intervention at the root level; simply export your favorite email client as the
default browser.  This can be done locally to the invocation of chromium by
defining a trivial shell script, e.g.

#!/bin/sh
# mychromium -- Make mutt the email client for chromium
export BROWSER=domutt.sh
chromium

if, for instance, one wants to use mutt.  The script domutt.sh simply invokes
mutt inside a terminal window:

#!/bin/sh
# domutt.sh -- Invoke mutt in a terminal window
# (choose your own favorite terminal, e.g., lxterminal, xterm, urxvt, etc.)
lxterminal -e mutt $@

Thiis should also work with thunderbird, etc.  (Of course, the separate
invocation script would not be needed for an X11 application such as
thunderbird.)

I invoke mychromium from icewm, but it should work with any other
window manager outside of a recognized desktop environment.  Domutt.sh
is located in my path at ~/bin.

My question is whether this hack is likely to have any adverse consequences
that I have not anticipated.

Offline

#2 2012-09-30 18:12:36

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Configuring "mailto:" in chromium browser

That's a good shot! The other simple solution would be to start your X session with "DE=xfce" and symlink /usr/bin/xdg-open to /usr/local/bin/exo-open (you can also symlink it to yout ~/bin, if it's in your path).

EDIT:
I currently use a symlink /usr/local/bin/x-www-browser -> /usr/bin/xdg-open, without $DE set. This is not without problems, as sometimes x-www-browser ends up invoking itself, forking into eternity. A quick killall x-www-browser solves this. Still dirty. The solution above does not come with this quirk. I guess one could solve this problem by using mimeo (which does not invoke x-www-browser), but one needs to call it a day sometimes.

Last edited by Awebb (2012-09-30 18:18:05)

Offline

#3 2012-12-02 20:22:48

ackalker
Member
Registered: 2012-11-27
Posts: 201

Re: Configuring "mailto:" in chromium browser

Reading a lot of posts in other forums, I think that another way to change how Chromium handles mailto: links might be to edit the file "$HOME/.config/chromium/Local State", specifically the 'protocol_handler' section, but I'm still looking for information on what exactly can be customized there.

EDIT:
It appears that the right place for such customizations would be $HOME/.config/chromium/Default/Preferences (assuming you're using the Default profile of course). This is also what gets updated when you enable f.i. GMail to be the protocol handler for email by clicking the protocol handler icon in the omnibox while being logged into GMail.

Trouble is that this seems to support only Web based (or at least HTML/JavaScript based) handlers. So one would have to write an extension (maybe even a NativeClient app) just to override Chromium's mailto: handling this way.
Bummer.

Last edited by ackalker (2012-12-02 23:52:20)

Offline

#4 2012-12-03 02:27:03

ackalker
Member
Registered: 2012-11-27
Posts: 201

Re: Configuring "mailto:" in chromium browser

Ok, so I got a bit angry and hacked up a way to override any of Chromium's internal protocol handlers without the need for wrapper scripts.
Since the method is generic, and doesn't just cover mailto:, I will start a new topic, then edit this post to add the link.

EDIT: Here is the link: Overriding Chromium's internal protocol handlers (mailto:, news:, etc)

Last edited by ackalker (2012-12-03 03:05:37)

Offline

Board footer

Powered by FluxBB