-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to navigate to a download or form submission #82
Comments
This seems to be getting out of the scope of an App History API and moving towards a Navigation API. |
History and navigation are very intertwined, so I don't think it's fruitful to draw a distinction based on the fairly-arbitrary name chosen for the top-level global. |
Could appHistory potentially make working with download links that need authentication (such as an auth header) easier? (e.g. a CSV report that requires auth) Currently a click on an Would that be considered part of this, or out of scope? |
Hmm, interesting. It's possible, but it seems a bit unlikely, as we don't allow (and don't want to allow) adding arbitary headers to navigations in general, and special-casing downloads seems like it goes against the grain of this issue. |
Makes sense. In a way, you could still probably have an easier time of it by just utilizing the appHistory.onnavigate = (evt) => {
if(evt.canRespond && evt.target.nodeName === 'A' && evt.target.getAttribute('download') === 'true') {
evt.respondWith(fetch(evt.target.url, headers)) // and so on
}
} or something. So adding a similar-type ability to |
Other things which
|
Seems to me like you could just use a fetch(url, {method: 'POST', body: 'PING'}); Having a way to do this built in to
This would probably be good to have.
The current documentation says that |
In offline discussion, @annevk mentioned that, in the spirit of
navigation.navigate()
being "a betterlocation.assign()
", maybe it should also get the ability to initiate a download or form submission. E.g.It seems likely that these capabilities can already be done today, by constructing the appropriate
<a>
andclick()
ing it, or the appropriate<form>
andsubmit()
ing it. So adding them here would not be costly. However, we'd want to double-check; e.g. I think there might be a user activation requirement for downloads?The text was updated successfully, but these errors were encountered: