createScreenshot

Captures a screenshot-like image of the currently displayed content and returns it.

If executed on the AWT Event Thread, this returns an immediately resolved . If executed from another thread, the returned is resolved as soon as the screenshot has been taken (which must happen on the event thread).

The generated screenshot can either be returned as-is, containing all natively-rendered pixels, or it can be scaled to match the logical width and height of the window. This distinction is only relevant in case of differing logical and physical resolutions (for example with HiDPI/Retina displays, which have a scaling factor of for example 2 between the logical width of a window (ex. 400px) and the actual number of pixels in each row (ex. 800px with a scaling factor of 2)).

Return

the screenshot image

Parameters

nativeResolution

whether to return an image at full native resolution (true) or a scaled-down version whose width and height are equal to the logical size of the screenshotted browser window

Throws