[whatwg] registerProtocolHandler() in HTML 5 is not sufficient for real use

Ian Hickson ian at hixie.ch
Mon Apr 27 22:43:42 PDT 2009


On Wed, 25 Mar 2009, Mithgol the Webmaster wrote:
> 
> For a real web application dealing with non-standard URL schemes, having 
> just registerProtocolHandler() is not enough for effective management of 
> URLs, there should be some other function (or, better, an HTTP request 
> header) to provide feedback (from the browser to the site) about whether 
> the previous URL scheme registration is still valid (i.e. that 
> registration was initially successful and was not cancelled later by the 
> browser's user).
> 
> Let me show you some real world scenario as an example of how things 
> work now and how they should be altered for good.
> 
> By visiting http://fghi.pp.ru/handler.php you may register that site as 
> your handler for 'area://...' and 'fecho://...' hyperlinks.
> 
> Your browser (Firefox) will then know it, so you may copy an 'area://' 
> URL such as area://Ru.Blog.Mithgol?msgid=2:5063/88+49659a64 to your 
> address panel, it becomes 
> http://fghi.pp.ru/?area://Ru.Blog.Mithgol?msgid=2:5063/88+49659a64 
> automatically when you hit your 'Go' button or 'Enter' key.
> 
> But the site does not know whether the URL scheme is (still) registered 
> in your browser, and thus the site cannot safely strip 
> 'http://fghi.pp.ru/?' prefix out of URLs it gives to you.
> 
> For example, 
> http://fghi.pp.ru/?area://FTSC_PUBLIC?msgid=2:280/5555+48c0e781 is given 
> (instead of area://FTSC_PUBLIC?msgid=2:280/5555+48c0e781 which could be 
> made possible) in href attribute of some hyperlink given by that site. 
> And that site has to provide longer (prefixed) URLs, because the site 
> may not know whether 'area://' scheme is registered within the client.
> 
> That subsequently becomes a real problem: now, if you try 'Copy Link 
> Location' on any of such links, you get a prefixed URL. This means the 
> current situation promotes some loss of interoperability of non-standard 
> URLs between different (though otherwise compatible) handler sites. You 
> have to strip the prefix manually if you want some person to receive the 
> URL from you and be able to use whatever site that person (not you!) 
> have chosen as a handler for that URLs.

Why can't the site just register the handler each time it isn't sure if 
the handler was registered?

Generally speaking, the feature was intended for sites that wished to hook 
into URLs provided by _other_ sites, e.g. webmail hooking into mailto:, 
or web-based phone systems hooking into tel:. Only schemes that are actual 
registered schemes are supposed to be used:

   http://www.iana.org/assignments/uri-schemes.html

This is not intended for sites that make up their own.


> I reported the problem to [...] WhatWG's mailing list, but was not 
> successful in persuading people of any change's necessity:
> 
> http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-January/018101.html

Sorry about that, I didn't receive your e-mail for some reason. Generally 
speaking I intend to reply to every e-mail sent to the list, but for some 
reason this one got caught in my spam filters or something.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list