Re: Allow navigation to relative URLs?

On 25/02/15 18:36, Jason Leyba wrote:
> Why should this be supported? What is the benefit to the added
> complexity of translating URLs?

I'm not actually sure it is more complicated. For example if you are
implementing get by injecting javascript it becomes

function get(url) {
    window.location = url
}

rather than

function get(url) {
    check_url_is_absolute(url);
    window.location = url;
}

(where the implementation of check_url_is_absolute is left as an
exercise for the reader).

I doubt there is a significant compat problem because it seems hard to
imagine that many people are relying on get() failing for relative URLs;
they presumably just aren't calling it. The use case is simply reducing
the amount of url concatenation that has to be done on the client side
e.g. if you are testing a site on some local server that can run on a
runtime-specified port it allows you to load a single page with the full
URL and thereafter always use relative urls for navigation rather than
having to pass that port all over the code.

Received on Wednesday, 25 February 2015 22:38:49 UTC