FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
How We Fixed Firefox's localStorage Race in Playwright: Two Navigation Helpers
NewsWeb Development

How We Fixed Firefox's localStorage Race in Playwright: Two Navigation Helpers

via Dev.toChris1mo ago

TL;DR Firefox's addInitScript can race against page rendering when seeding localStorage for E2E tests. We fixed it by splitting navigation into two helpers: gotoPage (fast, commit ) for interactive flows and gotoAgreementPage (reliable, domcontentloaded ) for data-dependent pages. The Problem We use Playwright's addInitScript to seed localStorage with mock agreement data before each test. This works perfectly in Chromium — the init script runs, sets localStorage, and by the time React mounts, the data is there. Firefox? Not so much. About 25% of our lifecycle tests were failing with "Loading agreement..." stuck on screen. The page rendered before the init script finished writing to localStorage. The Diagnosis Playwright's error context snapshots told the story. On first failure: - paragraph : Loading agreement... On retry (with more time): - heading "Retainer Agreement" - button "Connect Wallet" # Auth data missing too! The page loaded fine on retry, but auth data from localStorage was

Continue reading on Dev.to

Opens in a new tab

Read Full Article
37 views

Related Articles

Pidgin 3.0 Alpha 1 2.95.0 has been released
News

Pidgin 3.0 Alpha 1 2.95.0 has been released

Lobsters • 7h ago

Write Once, Run Anywhere (For Real This Time)
News

Write Once, Run Anywhere (For Real This Time)

Medium Programming • 7h ago

Anker’s power bank with built-in cables is one of my favorite gadgets, and it’s cheaper than usual
News

Anker’s power bank with built-in cables is one of my favorite gadgets, and it’s cheaper than usual

The Verge • 8h ago

Meta was finally held accountable for harming teens. Now what?
News

Meta was finally held accountable for harming teens. Now what?

TechCrunch • 8h ago

Every Senior Engineer I Respect Has Read These Books (Have You?)
News

Every Senior Engineer I Respect Has Read These Books (Have You?)

Medium Programming • 8h ago

Discover More Articles