Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!