Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

351
Visualizações
Why is the download interrupted when i call chrome.downloads.download method with enabled "Ask where to save each file before downloading" option

I'm writing Chrome extension that saves some files using chrome.downloads.download method. I call it from my background.js and it works fine unless "Ask where to save each file before downloading" option of browser is enabled or saveAs option is true.

This is background.js which reproduces this problem:

chrome.downloads.download({
  url: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png',
  saveAs: false
}, (itemId) => {
  chrome.downloads.onChanged.addListener((delta) => {
    if (itemId === delta.id) {
      console.log(delta) 
    }      
  })  
})

It downloads google logo when saveAs is false. In console i can see events first with status in_progress then with status complete. But if i set saveAs to true, there will be event with status iterrupted and error USER_CANCELED. Chrome doesn't open "Save as" dialog for some reason i don't understand, even if "Ask where to save each file before downloading" is enabled. More to it if "Ask where to save each file before downloading" is enabled download will be interrupted regardless of the saveAs value.

Chrome documentation describes saveAs option: "Use a file-chooser to allow the user to select a filename regardless of whether filename is set or already exists". But for me it doesn't work regardless of the value of filename option. Am i missing something?

The Chrome version is the last as of today (Version 102.0.5005.115 (Official Build) (64-bit)) and manifest version is 3.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda