This article is in need of a technical review.
This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.
getScreenshot() method lets you request a screenshot of an
<iframe>, scaled to fit within a specified maximum width and height; the image may be cropped if necessary but will not be squished vertically or horizontally..
var instanceOfDOMRequest = instanceOfHTMLIframeElement.getScreenshot(maxWidth, maxHeight, mimeType);
- A number representing the maximum width of the screenshot in CSS pixels.
- A number representing the maximum height of the screenshot in CSS pixels.
MIME type specifying the format of the image to be returned; the default is
image/pngto capture the alpha channel of the rendering result by returning a PNG-format image. This lets you get the transparent background of the
Note: Beginning with Firefox OS 1.4, the dimensions of the screenshot are in actual device pixels. See bug 959066 for details.
Not part of any specification.