Closed Bug 1487159 Opened 8 years ago Closed 8 years ago

WebExtension API: downloads.download regression on Firefox developer edition

Categories

(Firefox :: Untriaged, defect)

63 Branch
x86
Windows 10
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: gildas.lormeau, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0 Build ID: 20180824192747 Steps to reproduce: 1 - Install SingleFile extension on Firefox developer edition from here: https://addons.mozilla.org/fr/firefox/addon/single-file 2 - Go to https://bugzilla.mozilla.org/ and click on the extension button Actual results: The download fails. If you uncheck "Misc > save pages in background" in the options page of SingleFile, the download does not fail. Unchecking this option allows downloading the page via a hidden link in the page itself instead of relying on the downloads.download API. This issue also exists on Firefox beta on Android. That's why you can uncheck the option on it. Expected results: The page should have been saved like on previous versions of Firefox
Summary: downloads.download regression on Firefox developer edition → webextension API: downloads.download regression on Firefox developer edition
Summary: webextension API: downloads.download regression on Firefox developer edition → WebExtension API: downloads.download regression on Firefox developer edition
OS: Unspecified → Windows 10
Hardware: Unspecified → x86
(In reply to Gildas Lormeau from comment #0) > User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) > Gecko/20100101 Firefox/63.0 > Build ID: 20180824192747 > > Steps to reproduce: > > 1 - Install SingleFile extension on Firefox developer edition from here: > https://addons.mozilla.org/fr/firefox/addon/single-file > 2 - Go to https://bugzilla.mozilla.org/ and click on the extension button > > > > Actual results: > > The download fails. If you uncheck "Misc > save pages in background" in the > options page of SingleFile, the download does not fail. Unchecking this > option allows downloading the page via a hidden link in the page itself > instead of relying on the downloads.download API. This issue also exists on > Firefox beta on Android. That's why you can uncheck the option on it. > > > Expected results: > > The page should have been saved like on previous versions of Firefox Sorry, I meant "That's why you *cannot* uncheck the option on it."
I found the cause of the issue. SingleFile uses a Blob URI to download a page content. The problem is that the Blob URI is revoked with URL.revokeObjectURL just after browser.downloads.download is called. In Firefox 62 and Chrome, it is not a problem. Since Firefox 63, it looks like URL.revokeObjectURL must be called later. The issue is fixed by calling it into the browser.downloads.onChanged handler when the download state is complete.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.