Open Bug 1990259 Opened 11 months ago Updated 7 months ago

No download events for links with download attribute leading to network error

Categories

(Remote Protocol :: WebDriver BiDi, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned, NeedInfo)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [webdriver:backlog])

Spotted while implemented browsingContext.downloadEnd.

For test pages such as

data:text/html,<a href="https://not.a.real.url/whatever" download="file.txt">click

No download activity can be observed on the Downloads helper. Instead we perform a navigation. Nothing in the webprogress updates allows us to detect that this was from a download link either:

[Parent 1380: Main Thread]: I/BCWebProgress OnStateChange({isTopLevel:1, isLoadingDocument:0}, {URI:https://not.a.real.url/whatever, originalURI:https://not.a.real.url/whatever}, STATE_START|STATE_IS_REQUEST|STATE_IS_DOCUMENT|STATE_IS_NETWORK|STATE_IS_WINDOW, NS_OK) on {top:1, id:5, url:data:text/html,<a href="https://not.a.real.url/whatever" download="file.txt">click}
[Parent 1380: Main Thread]: I/BCWebProgress OnStatusChange({isTopLevel:1, isLoadingDocument:1}, {URI:https://not.a.real.url/whatever, originalURI:https://not.a.real.url/whatever}, NS_NET_STATUS_RESOLVING_HOST, "Looking up not.a.real.url…") on {top:1, id:5, url:data:text/html,<a href="https://not.a.real.url/whatever" download="file.txt">click}
[Parent 1380: Main Thread]: I/BCWebProgress OnStateChange({isTopLevel:1, isLoadingDocument:1}, {URI:https://not.a.real.url/whatever, originalURI:https://not.a.real.url/whatever}, STATE_START|STATE_IS_REQUEST|STATE_IS_DOCUMENT|STATE_IS_NETWORK|STATE_IS_WINDOW, NS_OK) on {top:1, id:e, url:about:blank}
[Parent 1380: Main Thread]: I/BCWebProgress OnStateChange({isTopLevel:1, isLoadingDocument:1}, {URI:https://not.a.real.url/whatever, originalURI:https://not.a.real.url/whatever}, STATE_STOP|STATE_IS_DOCUMENT, NS_ERROR_UNKNOWN_HOST) on {top:1, id:e, url:about:blank}
[Parent 1380: Main Thread]: I/BCWebProgress OnStateChange({isTopLevel:1, isLoadingDocument:1}, {URI:https://not.a.real.url/whatever, originalURI:https://not.a.real.url/whatever}, STATE_STOP|STATE_IS_NETWORK|STATE_IS_WINDOW, NS_ERROR_UNKNOWN_HOST) on {top:1, id:e, url:about:blank}
[Parent 1380: Main Thread]: I/BCWebProgress OnLocationChange({isTopLevel:1, isLoadingDocument:0}, {URI:https://not.a.real.url/whatever, originalURI:https://not.a.real.url/whatever}, https://not.a.real.url/whatever, LOCATION_CHANGE_ERROR_PAGE) on {top:1, id:e, url:https://not.a.real.url/whatever}
[Parent 1380: Main Thread]: I/BCWebProgress OnSecurityChange({isTopLevel:1, isLoadingDocument:0}, <null>, 4) on {top:1, id:e, url:https://not.a.real.url/whatever}

Links with download attribute might even trigger a navigation as long as the href is not in the same origin. Check the spec and file a spec issue.

Severity: -- → S3
Flags: needinfo?(jdescottes)
Priority: -- → P3
Whiteboard: [webdriver:backlog]
You need to log in before you can comment on or make changes to this bug.