Some Adobe Acrobat Reader links fail to download since the patches in bug 1771423 landed
Categories
(Core :: DOM: File, defect)
Tracking
()
| Webcompat Priority | P1 |
| Tracking | Status | |
|---|---|---|
| firefox-esr91 | --- | unaffected |
| firefox-esr102 | --- | unaffected |
| firefox104 | --- | unaffected |
| firefox105 | --- | unaffected |
| firefox106 | --- | affected |
People
(Reporter: twisniewski, Unassigned)
References
(Regression, )
Details
(Keywords: regression)
This was just reported on our Matrix webcompat channel. It seems that the download page for some Adobe Acrobat reader versions, at least Windows 10, which is where I found the link given (which works on other OSes). The page never actually downloads the file, despite making the network request.
Via mozregression, I discovered that this was broken as of the patches in bug 1771423 landing. And indeed, their code seems to be downloading a blob of the file with XMLHttpRequest, and then setting the location of the document to that blob:
(l = i.downloadURL.replace('http://', 'https://'), 'standalone' !== i.installer ? M() ({
url: l,
method: 'GET',
responseType: 'blob',
onDownloadProgress: function (e) {
e = Math.max(Math.round(100 * e.loaded / e.total), 1);
t(e)
}
}).then(function (e) {
(0, A.saveAs) (new Blob([e.data]), i.saveName.replace('install', 'mdr_install')),
t(100)
})
// where saveAs ends up in here:
: 'download' in HTMLAnchorElement.prototype && !p ? function (e, t, n) {
var r = l.URL || l.webkitURL,
o = document.createElement('a');
t = t || e.name || 'download',
o.download = t,
o.rel = 'noopener',
'string' == typeof e ? (o.href = e, o.origin === location.origin ? s(o) : i(o.href) ? f(e, t, n) : s(o, o.target = '_blank')) : (o.href = r.createObjectURL(e), setTimeout(function () {
r.revokeObjectURL(o.href)
}, 40000), setTimeout(function () {
s(o)
}, 0))
}
```
I'm not sure why the patch would break this use-case, but the obvious guess is that Firefox does not attempt to download blobs with no content type when they become the location via JS? If so I would imagine that more download sites will be broken by the patches if they hit release before this is addressed.
Comment 1•3 years ago
|
||
This looks like it is a duplicate of bug 1786128. I have a potential fix here.
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Set release status flags based on info from the regressing bug 1771423
Comment 3•3 years ago
|
||
The fix for bug 1786128 also fixes this, so I'm closing as a duplicate. Thanks for reporting the issue!
| Reporter | ||
Updated•3 years ago
|
Description
•