Closed Bug 1362448 Opened 7 years ago Closed 7 years ago

downloads.download always saves to a non-private-window download manager

Categories

(WebExtensions :: General, defect, P2)

defect

Tracking

(firefox57 verified)

VERIFIED FIXED
mozilla57
Tracking Status
firefox57 --- verified

People

(Reporter: ianbicking, Assigned: robwu)

References

Details

(Keywords: dev-doc-complete, Whiteboard: downloads, triaged)

Attachments

(2 files)

This is a followup from an issue submitted to Screenshots: https://github.com/mozilla-services/screenshots/issues/2818

In Screenshots, when the user clicks on the download link it sends a message to the background page which initiates a download using browser.downloads.download (code: https://github.com/mozilla-services/screenshots/blob/cba6f750a522868c543d0fe0c5439993da69d4fd/addon/webextension/background/main.js#L267 )

Because the download is initiated from the background page it's not associated with any window, and gets put in the non-private-window download manager.

Perhaps the background page could indicate the tabId where the download originated from as an option to download.downloads.
Priority: -- → P2
Whiteboard: downloads, triaged
FVD wants this.
Assignee: nobody → rob
Status: NEW → ASSIGNED
Attachment #8886611 - Flags: review?(aswan)
Keywords: dev-doc-needed
Comment on attachment 8886611 [details]
Bug 1362448 - Support "incognito" in downloads.create

https://reviewboard.mozilla.org/r/157426/#review162988

Looks good, thanks!

::: toolkit/components/extensions/ext-downloads.js:528
(Diff revision 1)
>            return Downloads.getPreferredDownloadsDirectory()
>              .then(downloadsDir => createTarget(downloadsDir))
>              .then(target => {
>                const source = {
>                  url: options.url,
> +                isPrivate: options.incognito === true,

You can put `"default": false` into the schema and then just take the value from `options.incognito` here.
Attachment #8886611 - Flags: review?(aswan) → review+
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/f257d10ebc4a
Support "incognito" in downloads.create r=aswan
https://hg.mozilla.org/mozilla-central/rev/f257d10ebc4a
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
I've noted this in https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/downloads/download and have a PR to update the compat data: https://github.com/mdn/browser-compat-data/pull/421

Let me know if we need anything else here.
Flags: needinfo?(rob)
LGTM. Thanks Will!
Flags: needinfo?(rob)
I can reproduce this issue on Firefox 57.0b3 (20170925150345) under Wind 10 64-bit. 

This issue is verified as fixed on Firefox 57.0b14 (20171102181127), 58.0a1 (20171106100122) under Wind 10 64-bit and Mac OS X 10.13.
Status: RESOLVED → VERIFIED
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: