Gnome Protocol Handlers

After perusing Novell's new bounties, I noticed one about making Firefox
open gaim-remote for aim: links. So, this somehow got me thinking about
Gnome protocol handlers in general.

Here's how it is now, as I see it. We have a number of GConf settings
in /desktop/gnome/url-handlers which correspond to the protocol name.
They describe what application and string the user wants to launch the
URL with.

Here are the problems I see with this:

1. The responsibility of managing these protocols is not in the right
place. (desktop_gnome_url_handlers.schemas). This means, to add aim:
either a) the user must do it manually, by knowing about the aim: URL
schema and attaching it to gaim-remote, b) we must edit
desktop_gnome_url_handlers.schema to include gaim by default, or c) Gaim
must have some per user installation script or start up action to
register this URL handler in Gconf.

2. Multiple programs cannot both handle a single protocol. This most
notably comes into play with http://. How many browsers do we have now?
Epiphany, Galeon, Firefox, Mozilla, Opera and Nautilus (WebDAV)? When a
user clicks on a http link, what opens??? (I honestly don't know how
this is determined now!) Some interesting use cases present themselves
here. For instance, being able to right click on a ftp: URL in Epiphany
and choose "Open in Nautilus...". And that would seriously be cool!

3. Non-Gnome programs cannot access this information. Well, arguably,
they could just use GConf.

So I started to give this a little thought. Long story short, here's the
proposal. I'll rationalize it when I'm done. Don't respond until you
read it all please.

1. Programs (f.d.o or otherwise) install mime types into the shared-
mime-info system such as x-protocol/aim, x-protocol/http, x-protocol/
itms (!) (without the x if the proposal gains ground).

2. Applications which desire to handle these mime types do so exactly as
they do for any other mime types. .desktop file? application-registry?
I'm not even sure anymore.

3. Programs attempting to launch an application associated with a
particular protocol use the mime system exactly as they would for a file
type to resolve the application. Same API. These programs can certainly
give preference to certain applications for certain reasons. For
instance... two programs could register help://, Yelp and KDE's thing.
One likely wouldn't want to open KDE's Help app from a Gnome
application, as it probably wouldn't work. Or maybe it would, but would
totally confuse users with both desktops installed. Maybe a X-GNOME-
Official field in .desktop file would make an application the default
for Gnome apps. Discuss!

4. Associations between protocols and the applications which handle them
is exactly the same as for normal mime types. Stored in the same place.
Accessed in the same way. The only difference would be conditional UI
which would be more specific to "launching a protocol" than "opening a
document". Different language.

Rationalization. At first thought (and hopefully not yours) my reaction
to this was, "But MIME is for document and data types!" After I got over
my initial reaction I thought, "Well, yeah, it was designed for that.
But does this idea really compromise the mission of MIME in anyway? Does
it introduce bad ugly hacky code?. Does it confuse the concept of MIME?

MIME types describe the type of a resource. A resource can be a data
stream, it can be an inode (I noticed we have an inode/* namespace). Can
not a resource also be a protocol? Certainly. It's unfortunate it's
named "MIME" though!

As I see it, for this proposal to become reality, very little
centralized work is actually required. Somebody (I'd be happy to) would
have to create a MIME package file for the protocols currently listed in
GConf. Somebody (or me) would have to do a few little edits to
gnome_vfs_show_url and related functions to determine the application
from the MIME system. And somebody would need to fix or make a new UI. I
hear somebody is working on a new file association interface? This
SHOULD work with it by default. Only change would need to be some
language fix ups likely.

After those few, all it comes down to is application developers adding
these handlers into their .desktop files.

Basically, I just want to get some conversation started. What are
people's general feelings about this? How many people are going to flame
me for not keeping MIME "pure"? What problems are there?

Thank you for your time.

*steps down from podium*

Jerry Haltom <wasabi larvalstage net>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]