屏幕截图中缺少 firefox-headless 控制框 - selenium - linux
firefox-headless contol box is missing from screenshot - selenium - linux
我面临完全相同的问题https://github.com/mozilla/geckodriver/issues/1358。
从 linux 截取的 Firefox-headless 模式截图缺少输入框
问题:
我们有没有其他方法可以解决这个问题。我正在使用 FF 83
你没看错。对于 driven GeckoDriver initiated firefox Screenshot in headless mode doesn't show form controls correctly.
此问题已关闭,因为原始问题与 Firefox 有关,并且正在通过 Some input field are black when taking screenshot in headless mode is specific to linux 平台进行跟踪,其中 @Michael Smith
提到:
It looks like this is a result of an nsITheme object not being created
in headless mode under
GTK,
as nsNativeThemeGTK depends on APIs which we can't access in headless
mode. As a result this shouldn't affect the Windows and macOS
platforms.
他进一步详细说明:
We have existing fallback paths for when a nsITheme object is
unavailable, but it looks like they're not being exercised on any of
Windows, macOS, or Linux under normal conditions. For example, the
width of the dropdown button is determined by the width of the
scrollbar in the dropdown list. This is measured by
GetNondisappearingScrollbarWidth,
which boils down to asking the vertical scrollbar nsBoxFrame what its
preferred width
is.
Normally this ends up being calculated using
nsITheme::GetMinimumWidgetSize which calls out to platform-specific
code; in the absence of a theme, we rely on the computed size from the
CSS applied to the scrollbar XUL element and its children. Note that
vertical scrollbar thumbs have a minimum height
assigned,
but no minimum width, so the computed scrollbar width ends up being 0,
and the dropdown buttons end up being 0-width. Adding a minimum width
to thumb[orient="vertical"] causes the dropdown buttons to show up
under headless mode. It also causes the scrollbar to show up along the
side, but there's no color set for the slider, so it's just a white
strip.
结论
此问题已分配 优先级 3,并且仍处于 未解决 状态,没有其他选择。
这可以使用 firefox 设置解决。
widget.disable-native-theme-for-content
到 true
参考:
https://www.reddit.com/r/firefox/comments/k2nghh/any_alternatives_for_firefoxlinuxheadless/
PS:感谢 reddit user 回答了我的问题:)
我确认它正在工作。
我面临完全相同的问题https://github.com/mozilla/geckodriver/issues/1358。
从 linux 截取的 Firefox-headless 模式截图缺少输入框
问题:
我们有没有其他方法可以解决这个问题。我正在使用 FF 83
你没看错。对于
此问题已关闭,因为原始问题与 Firefox 有关,并且正在通过 Some input field are black when taking screenshot in headless mode is specific to linux 平台进行跟踪,其中 @Michael Smith
提到:
It looks like this is a result of an nsITheme object not being created in headless mode under GTK, as nsNativeThemeGTK depends on APIs which we can't access in headless mode. As a result this shouldn't affect the Windows and macOS platforms.
他进一步详细说明:
We have existing fallback paths for when a nsITheme object is unavailable, but it looks like they're not being exercised on any of Windows, macOS, or Linux under normal conditions. For example, the width of the dropdown button is determined by the width of the scrollbar in the dropdown list. This is measured by GetNondisappearingScrollbarWidth, which boils down to asking the vertical scrollbar nsBoxFrame what its preferred width is. Normally this ends up being calculated using nsITheme::GetMinimumWidgetSize which calls out to platform-specific code; in the absence of a theme, we rely on the computed size from the CSS applied to the scrollbar XUL element and its children. Note that vertical scrollbar thumbs have a minimum height assigned, but no minimum width, so the computed scrollbar width ends up being 0, and the dropdown buttons end up being 0-width. Adding a minimum width to thumb[orient="vertical"] causes the dropdown buttons to show up under headless mode. It also causes the scrollbar to show up along the side, but there's no color set for the slider, so it's just a white strip.
结论
此问题已分配 优先级 3,并且仍处于 未解决 状态,没有其他选择。
这可以使用 firefox 设置解决。
widget.disable-native-theme-for-content
到 true
参考:
https://www.reddit.com/r/firefox/comments/k2nghh/any_alternatives_for_firefoxlinuxheadless/
PS:感谢 reddit user 回答了我的问题:)
我确认它正在工作。