Skip to content

capture/device-screenshot

Photographs the DEVICE, not the web page.

captureObsidianScreenshot goes through Appium in the WebView context, so on Android it captures the page: no status bar, and — the reason this exists — no soft keyboard, because the IME is a system window and not part of the page. A frame that is meant to show what a phone looks like therefore cannot be taken that way.

adb exec-out screencap -p reads the framebuffer instead, which is the same route the trusted-input passes already use. The trade is deliberate and worth writing down at every call site: a device capture carries the status-bar clock and battery, so it is not byte-reproducible as captured the way a page capture is. paintOutStatusBar is what makes one — it removes the band those live in — and a frame that is going to be committed has to go through it. Reach for this only for the shots that need the keyboard; leave the rest on captureObsidianScreenshot.

Interface Description
CaptureDeviceScreenshotParams Parameters for captureDeviceScreenshot.
Function Description
captureDeviceScreenshot Captures the device’s framebuffer as a PNG.