Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 1.55 KB

README.md

File metadata and controls

49 lines (37 loc) · 1.55 KB

screenshot.js

Take real screenshot with JS

Example

See: https://rawcdn.githack.com/amiad/screenshot.js/master/index.html

example gif

Installation

  • If you want to load script locally download its (here).

  • Load the script in the header

    <script src="https://raw.githubusercontent.com/amiad/screenshot.js/master/screenshot.js"></script>

Usage

new Screenshot({success: img => {
        // callback function
        myimage = img;
    }});

Your user need to allow the action and to select the screen, window or tab to share (tab support in Chrome only).

optional argurments

  • noSupport - callback for unsupport browser.
  • noPermit - callback that would run if the user did not confirm the screen share.
  • sound - play sound when taking screenshot.
    • true - default sound
    • url - custom sound (example: 'https://site.my/sound.mp3')
  • height - image height
  • width - image width
  • askNewShare - if true then the browser ask again permissions and select source for share.

Supported Browsers

Firefox 66, Chrome 72, Edge 79, Opera 60, Safari 13.

Mobile not supported!

See CanIUSe for more details.

Donate

donate

You like it? Please donate to me so I can continue developing.

Licnese

GPL