[Bug]: Headless Firefox gives every element `scrollbar-width: none`, whatever the page sets

Aperta
#44,228 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
playwright, typescript

Direzione di ricerca

Start with browser_patches/firefox/juggler/content/hidden-scrollbars.css and how Juggler.js registers that stylesheet for headless Firefox. Run the linked reproduction with Node 20 or later to confirm the computed values across browsers. Done when headless Firefox reports the page's specified scrollbar-width values while keeping scrollbars hidden.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

agent-triage-done
Version

main (28c4b2e), with the Firefox it pins, 159.0

Steps to reproduce
  1. Clone https://github.com/YevheniiKotyrlo/playwright-firefox-headless-scrollbar-width
  2. Run node repro.mjs with Node 20 or later and git. It clones main, runs npm ci and npm run build, installs the browsers main pins, and in Chromium, Firefox and WebKit, each launched headless, sets this page and reads getComputedStyle(element).getPropertyValue('scrollbar-width') for <html> and each <div>:
<!doctype html>
<style>div { width: 100px; height: 50px; overflow: auto } p { height: 200px }</style>
<div style="scrollbar-width: auto"><p></p></div>
<div style="scrollbar-width: thin"><p></p></div>
<div style="scrollbar-width: none"><p></p></div>
<div style="scrollbar-width: thin !important"><p></p></div>
Expected behavior

Each element reads the scrollbar-width the page gives it, as in headless Chromium and WebKit: auto for <html>, which sets no scrollbar-width (the initial value), then auto, thin, none and thin. The scrollbars can stay hidden: headless Chromium hides them with --hide-scrollbars and reads the page's values.

Actual behavior

Headless Firefox reads none for every element, thin !important included:

microsoft/playwright 28c4b2e, Chromium 159.0.8154.6, Firefox 159.0, WebKit 27.2, each headless; Node v26.12.1, win32 10.0.26300 x64
element                                         expected  chromium  firefox  webkit
<html>, which sets no scrollbar-width           auto      auto      none     auto
<div style="scrollbar-width: auto">             auto      auto      none     auto
<div style="scrollbar-width: thin">             thin      thin      none     thin
<div style="scrollbar-width: none">             none      none      none     none
<div style="scrollbar-width: thin !important">  thin      thin      none     thin
summary: microsoft/playwright 28c4b2e: headless Firefox 159.0 reads scrollbar-width none for 4 of the 4 elements that should read auto or thin; headless Chromium 159.0.8154.6 and WebKit 27.2 read the expected value for all 5 elements
Additional context

The value comes from hidden-scrollbars.css, which Juggler.js registers as a user-agent style sheet when Firefox runs headless.

Environment
microsoft/playwright 28c4b2e, Chromium 159.0.8154.6, Firefox 159.0, WebKit 27.2, each headless; Node v26.12.1, win32 10.0.26300 x64
Lingua principale
TypeScript
Stelle
100k
Fork
6.9k
Merge medio
16h 8m
PR unite (30g)
281

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/playwright

Tutte le issue di microsoft/playwright

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.