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

133
Visualizações
Firefox optimization bug?

Recently when i did some adventofcode, i came across a bug:

The bug happens in firefox except for if you run the code as multiple chunks, but doesnt happen in chrome.

When i run this code in the firefox console, in a tab with url https://www.google.com/robots.txt :

// Fetch input
var input = await fetch("https://www.google.com/robots.txt").then(r => r.text());

var lines = input.split("\n");

// Iterate
while(lines.length > 0) console.log(lines.shift());

It prints nothing, but when i run the code as two pieces (separated by // Iterate) it works. Note that you can change the fetch url and url of the tab, i chose robots.txt and made them the same to avoid CORS errors.

Does anyone know why this happens or how to fix this?

Edit: The code works if you wrap the code in an async function and call it, but it should work regardless.

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