Hacker News new | ask | show | jobs
by thaumasiotes 2968 days ago
You may not be able to <a> to them, but you can certainly issue redirects to them, and <a> to a URL that issues such a redirect.

You can also <a> to a URL that issues a redirect to a location given by a GET parameter, eliminating the need to stand up a site for every different idea you come up with.

1 comments

That used to be possible [1], but it looks like redirection to a data url is blocked on current versions of Chrome and Firefox.

[1] http://indirection.modusponens.org/data:text/html,Hello,%20w...!

In chrome, what's blocked is page-initiated top-level navigations to data URLs (because of spoofing concerns). You can load them in iframes, and you can still do a browser-initiated navigation to them (i.e., type them into the omnibox). They can be used freely as subresources.

Http Redirection to data: urls has been blocked in chrome for at least half a decade. There's really no reason to allow that, a server can just as easily return the data as the response body.