Closed Bug 1247791 Opened 9 years ago Closed 8 years ago

Implement options.saveAs for chrome.downloads.download()

Categories

(WebExtensions :: General, defect, P2)

defect

Tracking

(firefox52 fixed)

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: aswan, Assigned: zombie)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

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

Attachments

(1 file)

Blocks: 1213445
Whiteboard: [downloads]
Priority: -- → P2
Whiteboard: [downloads] → [downloads] triaged
Depends on: 1282165
Assignee: nobody → tomica
Status: NEW → ASSIGNED
Component: WebExtensions: Untriaged → WebExtensions: General
Comment on attachment 8792654 [details] Bug 1247791 - Implement options.saveAs for downloads.download, https://reviewboard.mozilla.org/r/79572/#review78236 ::: toolkit/components/extensions/ext-downloads.js:462 (Diff revision 1) > + return Promise.resolve(target); > + } > + > + // Setup the file picker Save As dialog. > + const picker = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); > + picker.init(global.WindowManager.topWindow, null, picker.modeSave); eslint complains without the global
Comment on attachment 8792654 [details] Bug 1247791 - Implement options.saveAs for downloads.download, https://reviewboard.mozilla.org/r/79572/#review80122 ::: toolkit/components/extensions/ext-downloads.js:472 (Diff revision 2) > + > + // Open the dialog and resolve/reject with the result. > + return new Promise((resolve, reject) => { > + picker.open(result => { > + if (result === Ci.nsIFilePicker.returnCancel) { > + reject({message: "download canceled by the user"}); Please capitalize.
Attachment #8792654 - Flags: review?(kmaglione+bmo) → review+
Comment on attachment 8792654 [details] Bug 1247791 - Implement options.saveAs for downloads.download, https://reviewboard.mozilla.org/r/79572/#review80122 > Please capitalize. I was going by the format of reject messages a few lines above: http://searchfox.org/mozilla-central/source/toolkit/components/extensions/ext-downloads.js#408
Comment on attachment 8792654 [details] Bug 1247791 - Implement options.saveAs for downloads.download, https://reviewboard.mozilla.org/r/79572/#review80122 > I was going by the format of reject messages a few lines above: > http://searchfox.org/mozilla-central/source/toolkit/components/extensions/ext-downloads.js#408 (though now I understand those were property names)
Comment on attachment 8792654 [details] Bug 1247791 - Implement options.saveAs for downloads.download, https://reviewboard.mozilla.org/r/79572/#review80122 > (though now I understand those were property names) Ah. We should probably fix those too...
(In reply to Kris Maglione [:kmag] from comment #9) > > (though now I understand those were property names) > > Ah. We should probably fix those too... this miss-quoting is a result posting comments at almost the same time. Kris doesn't think we should capitalize property names (from irc).
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c017d2d3ffe2 Implement options.saveAs for downloads.download, r=kmag
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Updated compat data: -> https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/downloads/download#Compatibility_notes Marking dev-doc-complete, but let me know if I need anything else.
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: