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

Clear 10 seconds after last download instead of every 10 seconds #2

Open
jhard opened this issue Aug 18, 2017 · 2 comments
Open

Clear 10 seconds after last download instead of every 10 seconds #2

jhard opened this issue Aug 18, 2017 · 2 comments

Comments

@jhard
Copy link

jhard commented Aug 18, 2017

I have no idea if you're still active on this, it works flawless, so there might just be no need to change anything.
It's more of a feature request than a bug: sometimes the clear-event coincides with the completion of a download so that there's now time to click on it to open the file.
It would be nice if there would be an option to change the behavior so that it clears the bar 10 seconds after the last active download finishes.

@sindresorhus
Copy link
Owner

PR welcome if anyone wants this, but it's not something I'm going to spend time on.

@sindresorhus sindresorhus changed the title Clear 10 seconds after last Download instead of every 10 seconds Clear 10 seconds after last download instead of every 10 seconds Mar 16, 2019
@joshuabaker
Copy link

Looks like this can be done via the onChanged event.

Rough and untested...

chrome.downloads.onChanged.addListener(downloadDelta => {
  if (downloadDelta.state === "complete") {
    setTimeout(chrome.browsingData.removeDownloads.bind(null, {}), 10000);
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants