Closed jrandolf closed 9 months ago
@jgraham @gsnedders PTAL. We internally discussed what formats should be considered. I suggested we use the ones proposed here, but @OrKoN questioned whether they are compatible with other browsers. Considering implementations can throw unsupported operation, I think these should be okay.
Alternatively, we can make this a string and state it must be a image mime type. This is more flexible in case you folks have other requirements such as proprietary formats.
For example,
? format: string | browsingContext.ScreenshotFormat;
...
browsingContext.ScreenshotFormat = {
type: string
} & Extensible
We could then change the algorithm to allow implementation-specific formats when the format is not one of the predefined types (webp, png, and jpeg).
I think if there will be no agreement that we need to support a shared set of the formats, we can probably have a vendor prefixed extension for the screenshot types in chromium-bidi.
@jrandolf please link and see comments on https://github.com/w3c/webdriver-bidi/issues/383
@gsnedders @jgraham Is it ready to land?
@jrandolf are you going to add new wpt tests for this feature? CC @OrKoN.
This PR implements screenshot formats.
Closes https://github.com/w3c/webdriver-bidi/issues/383
FAQ
Do implementations need to support all formats?
No, if the implementation is unable to capture a screenshot of a context for any reason, then return error with error code unsupported operation.
Preview | Diff