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

未关闭
#44,228 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
playwright, typescript

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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
主要语言
TypeScript
星标
100k
派生
6.9k
平均合并
16 小时 8 分钟
30 天内合并 PR
281

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/playwright 的其他 Issue

查看 microsoft/playwright 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。