-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency: chrome.downloads.open() return value #528
Comments
Safari does not currently support the downloads API. But I agree a promise makes sense here. |
@patrickkettner Would you be interested in resolving this difference? |
Appreciate the ping.
I’ll dig in a bit. I am concerned about it being potentially a breaking
change. I’ll see what the team thinks is plausible
…On Sat, Feb 10, 2024 at 12:40 PM Anton Bershanskiy ***@***.***> wrote:
@patrickkettner <https://github.com/patrickkettner> Would you be
interested in resolving this difference?
—
Reply to this email directly, view it on GitHub
<#528 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADRUBW6VOR5BATLEWGOIELYS6WKLAVCNFSM6AAAAABCHCNZYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXGA3TSOJWGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks for opening https://chromium-review.googlesource.com/c/chromium/src/+/5274756 ! Checking the existing extension usage, the change seems safe. I pinged a reviewer to get the change merged. |
The relevant change was merged (commit), Chromium 123+ will return |
Since the inconsistency is resolved, I'm closing this issue. We might want to change labels: remove "supportive: chrome" and add "implemented: chrome", "implemented: firefox", "implemented: edge". |
Update: Firefox and Chromium 123+ now both return
Promise<void>
, Safari does not support this API, but is willing to match.Summary
Chromium treats
chrome.downloads.open()
as a sync operation, while Firefox returnsPromise<void>
.Chromium bug
Details
In Chromium, has the following signature (from docs, from source):
In Firefox, it returns a Promise (from MDN):
Safari does not support
downloads
API, but is willing to use promise.I believe that the function should return
Promise<void>
since opening a file is inherently an async operation. Chromium handles it async (code), but the declaration is sync (code). It is sync only if there is an error which is known right away like lack of proper permissions or user activation.(Updated Feb 15, 2024)
The text was updated successfully, but these errors were encountered: