-
Notifications
You must be signed in to change notification settings - Fork 27
<a download> is a navigation; how does it interact with the navigation API? #76
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
Comments
If it did trigger a |
I think that a "navigate" has to enter into the history stack. If it doesn't change something about history, it's not a navigate. Clicking on a link to open in a new tab, I think, is not a navigate (for instance) |
There are essentially two cases here:
|
I agree that it's probably fine. Just need to put a note in the documentation so people know to expect it, or can find out what's going on. |
Should this be merged into #137? |
They're slightly different. #137 is about what happens if you do a non-download navigation but then the server sends This case is about |
For consistency there should be navigate in both cases but I guess also some notification that the navigation stopped/was cancelled. |
One scenario I'm concerned about is when I think a |
I'm torn on whether to expose a boolean or filename in v1. On the one hand, it's probably helpful for developers to avoid handling On the other hand, if we have Maybe if we gave it a really explicit name, like |
@annevk, @smaug----, @natechapin and I discussed this offline. We were roughly agreed on the plan of firing a The remaining discussion is then whether and how to signal the fact that a given navigation is attempting to download, to the
(I was voting for We think this name communicates that (a) it only covers "requested" downloads, not all downloads; e.g. it doesn't cover There is an additional question as to whether you can I will work on spec/implementation/test updates for this soon! Although the spec updates are probably going to be a bit vague until we improve the general HTML download spec, which is blocked on whatwg/html#6315. |
In Matrix @annevk pointed out that expanding this in the future would change This inclines me toward trying to see how hard it is to implement with |
What does right click > Save Link As... do? I think it should not fire any event. The current HTML spec does not distinguish between these possibilities but allowing interception of that UI gesture seems not-great. |
After writing up some small usage examples I prefer the name "downloadRequest" to "requestDownload". "request download" sounds like a verb or method name. "downloadRequest" is also more consistent with "hashChange". |
Background: whatwg/html#5548, which is basically about how
<a download>
is a type of navigation, even though the specs currently don't treat it as such.This means the navigation API should have a well-defined interaction with such downloads, in the spec and tests. Speccing this properly might require fixing whatwg/html#5548.
My instinct is that such downloads should not trigger the navigation API's
navigate
event.The text was updated successfully, but these errors were encountered: