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

Open
#44,228 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
playwright, typescript

Research direction

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.

Written by the indexing model from the issue text.

Description

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
Dominant language
TypeScript
Stars
100k
Forks
6.9k
Avg merge
16h 8m
Merged PRs (30d)
281

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/playwright

All issues in microsoft/playwright

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.