Skip to main content
A persona presents the screen of its machine. The screen has a size, a pixel ratio, a colour depth, and a taskbar, Dock or panel that takes part of it. The browser serves these values in headless and headed mode alike, and the window opens where the persona’s platform would open it.

Screen sizes

The seed picks a machine class from the GPU model, then a screen for that class. Sizes are in CSS pixels, as screen.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

A Windows persona opens maximized, filling the work area above the taskbar, as Windows Chrome does. macOS and Linux personas get their platform’s default placement inside the work area. The browser places the window from the persona, not from the host’s display. On a headed launch the host display has to be at least as large, or the window manager may shrink the window. The browser’s own frame, 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 output above. 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 reports screen, 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:
The screen shrinks to the viewport, the taskbar disappears, and the window is larger than the screen. To change the size a page sees, set the screen switches below or --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:
No real desktop has 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:
--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.
Prefer a size from the tables above. --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:
Through the packages these raise 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

With headless=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.