Re: Allow javascript: URIs for registerProtocolHandler

> > When using registerProtocolHandler method to register a custom
> > protocol, according to the spec it is required that the uri parameter
> > allow to do a GET operation or their equivalent (so maybe it would be
> > used with ftp instead of http URIs, for example). I have done some
> > tests setting this custom protocol on an <img> tag and it seems to
> > works (at least on Chrome v28).
>
> Really? I thought registerProtocolHandler() was only a hook for
> navigation.

Really :-) I though the same, but since its a "GET equivalent operation"
just like XHR and in fact Google Charts creates on-demand graphics based on
the data on the URL query, so why not? So I created a custom fake protocol,
set it inside the <img> tag and after registering and removing the fake
protocol several times, I saw it only showed the image using the fake
protocol when it was registered :-)

Problem is, as I told before, that this needs a web server to precess the
request and the browser to be online... :-( I read about AppCache can fix
it, but not only it has its own bugs regarding to cache the full paths
(also the query fragment, so it doesn't work correctly offline) but also it
can only return actual static resources, not dinamically generated ones...
:-/

Received on Tuesday, 17 September 2013 20:34:53 UTC