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

171
Visualizações
Downloading files in browser window after opening in Javascript?

Im trying to open a browser in Javascript and use that browser to download a file. I am doing this in a Microsoft Excel Add-in. The reason is because on MacOS on the desktop version of Excel, you cannot currently download files to the desktop via the addin.

According to the team, the workaround is to use: Office.context.ui.openBrowserWindow(url) to open the url and download the file once the browser is open.

But how do I download the file once its open? Ive tried doing something like:

Office.context.ui.openBrowserWindow("https://google.com", function() {
  const bl = new Blob([JSON.stringify(data, null, 2)], {type: "application/json"});
  const a = document.createElement("a");
  a.href = URL.createObjectURL(bl);
  a.download = "test.json";
  document.body.appendChild(a);
  a.click();
})

but im getting nothing working.

Any advice?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

openBrowserWindow doesn't take a second parameter.

I think the workaround is that you create a page on your add-in domain that has a UI for downloading the file. Then you use openBrowserWindow to open that page.

about 4 years ago · Juan Pablo Isaza Relatório
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