Screen sizes
The seed picks a machine class from the GPU model, then a screen for that class. Sizes are in CSS pixels, asscreen.width and screen.height report them.
A Windows screen of 1536x864 at 1.25 is a 1920x1080 panel at 125% scaling. The seed picks among these with the weights in
resources/profiles/dispersion/panel.json.
Taskbar, Dock and panels
The platform’s furniture takes part of the screen, so the available area,screen.availWidth by screen.availHeight, is smaller than the screen. The one exception is a Linux persona with no panel.
A Windows persona always has a taskbar, so its
availHeight is always less than its height. screen.availTop is the menu bar or top bar’s height.
Where the window opens
- x86-64 host
- Apple silicon Mac
outerHeight minus innerHeight, comes from the host’s browser layout. For a Windows persona it is 87 at 100% scaling, headless and headed, as in the x86-64 output above. The Mac’s headless launch at 125% reads 86. Browser chrome height compares it with real Windows.
On the first tab of a launch without a driver, or of any launch with --no-sandbox except a headless package launch, Chromium shows a bar that takes another 56 pixels from innerHeight. Google Chrome never shows it. The 0.4.3 packages pass --no-sandbox on every host. A bar on the first tab has the details and the workaround.
Viewport
Playwright and Puppeteer emulate a viewport by default. Playwright’s reportsscreen, innerWidth and the available area all as 1280x720 at a pixel ratio of 1, which no desktop does. The packages turn the driver’s viewport off: no_viewport=True in Python, viewport: null for Playwright and defaultViewport: null for Puppeteer in Node. The page then gets the persona’s screen and the real window size.
A viewport of your own replaces the persona’s geometry. With viewport={"width": 1280, "height": 720}, the same Windows persona reports:
--window-size instead.
Headless
Headless launches present the persona’s screen and window, as the output above shows. Host mode has no persona geometry, so headless host mode reports Chrome’s headless default:availHeight equal to height and an 800x600 screen. Run host mode headed, or use a seed.
Window size
--window-size=W,H sets the window. The screen stays the persona’s, and the window is no longer maximized:
linux/amd64 container the same launch printed [10, 10, 1280, 800, 1920, 1080].
--window-position=X,Y moves the window.
Set the screen size
--fingerprint-screen-width and --fingerprint-screen-height set the screen in CSS pixels, from 1 to 65535. The seed still picks everything else, and the browser works out the available area from the size you set.
--fingerprint-explain notes that a size you set has unknown prevalence and names the size the seed had picked. The browser refuses, and exits with status 1:
- A screen smaller than
--window-size: - A screen too small for the persona’s taskbar or menu bar:
- A value that is not a whole number from 1 to 65535:
LaunchError in Python and BrowserLaunchError in Node. The pixel ratio has no switch. It comes from the seed’s screen, or from a profile you write.
Virtual displays
Withheadless=False on a Linux host with no display, the package starts Xvfb for the browser. The virtual display is the size of the screen you set with both switches, or that a profile names. Otherwise it is 3840x2160, large enough for any screen a seed picks. Linux servers covers headed launches on a server.