Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ondras/browsershot

Utility library for programmatic screenshots via getDisplayMedia
https://github.com/ondras/browsershot

util

Last synced: about 2 months ago
JSON representation

Utility library for programmatic screenshots via getDisplayMedia

Awesome Lists containing this project

README

        

# Browsershot

Taking screenshots programatically, using the [getDisplayMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia) API. Useful for debugging, feedback etc.

## Example

```js
let bs = await import("https://unpkg.com/browsershot/index.js");
try {
let canvas = await bs.toCanvas();
document.body.appendChild(canvas);
} catch (e) {
alert(e.message);
}
```