Skip to content
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

chrome.downloads.download fails around filename determination #15781

Closed
jonathansampson opened this issue May 12, 2021 · 4 comments
Closed

chrome.downloads.download fails around filename determination #15781

jonathansampson opened this issue May 12, 2021 · 4 comments
Labels
bug feature/extensions OS/Desktop priority/P4 Planned work. We expect to get to it "soon".

Comments

@jonathansampson
Copy link
Contributor

Description

The chrome.downloads.download method doesn't appear to work as expected in Brave.

Steps to Reproduce

Create a new directory with the following files:

manifest.json

{
    "name": "chrome.downloads.download test",
    "version": "0.0.0.1",
    "manifest_version": 3,
    "permissions": [
        "downloads"
    ],
    "background": {
        "service_worker": "background.js"
    }
}

background.js

chrome.runtime.onInstalled.addListener(() => {
    const url = "https://brave.com/static-assets/images/brave-og.png";
    chrome.downloads.download({ url }, downloadId => {
        console.log(`Download ID is ${downloadId}`);
    });
});

Navigate to brave://extensions/ and enable Developer Mode. Then select Load unpacked, and find the extension directory with the contents above.

Actual result:

Nothing happens. No download is initiated, but a download ID is generated and returned.

Brave Nightly 1.26.11
brave-downloads

Expected result:

A download should automatically be initiated when the extension is loaded, or refreshed. Clicking the "service worker" link should also reveal a generated download ID in the console.

Chrome Canary 92.0.4505.0
chrome-downloads

Reproduces how often:

Consistently.

Brave version (brave://version info)

1.26.11

Version/Channel Information:

  • Can you reproduce this issue with the current release? Yes
  • Can you reproduce this issue with the beta channel? Yes
  • Can you reproduce this issue with the nightly channel? Yes

Other Additional Information:

  • Is the issue reproducible on the latest version of Chrome? No

Miscellaneous Information:

By hooking into the downloads lifecycle events, we can see that Brave stops around filename determination, whereas Chrome resolves a full path and filename and proceeds with the download:

chrome.downloads.onCreated.addListener( item => {
    console.log( "onCreated", item );
});

chrome.downloads.onChanged.addListener( item => {
    console.log( "onChanged", item );
});

chrome.downloads.onDeterminingFilename.addListener( item => {
    console.log( "onDeterminingFilename", item );
});

chrome.downloads.onErased.addListener( item => {
    console.log( "onErased", item );
});

image

image

@rebron rebron added the priority/P4 Planned work. We expect to get to it "soon". label Aug 26, 2021
@rebron
Copy link
Collaborator

rebron commented Aug 26, 2021

@jonathansampson Are you still seeing this in the latest nightly with Chromium 93?

@jonathansampson
Copy link
Contributor Author

jonathansampson commented Oct 17, 2021

@rebron No change in Chromium 95, Brave v1.33.10.

@jonathansampson
Copy link
Contributor Author

This appears to be working in version 1.44.105 Chromium: 106.0.5249.91 (Official Build) (64-bit)!

@SecretShell
Copy link

SecretShell commented May 18, 2023

I was using Brave v1.39.111
I had to turn off "Ask where to save each file before downloading"

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature/extensions OS/Desktop priority/P4 Planned work. We expect to get to it "soon".
Projects
None yet
Development

No branches or pull requests

3 participants