6

For the company I work at, I have to develop an addon that takes screenshots of the page and then puts a watermark on it with a timestamp.

Is it possible to use Firefox's own screenshot function from within JavaScript? I know you can type :screenshot in the console which will make a screenshot and output where it was saved. Yet I doubt I can call this from javascript.

LDerksen
  • 61
  • 2
  • 1
    Even if it would be possible, you likely would need to force the user to use firefox, which is not exactly the best practice. I would suggest you to take a look at similar topics, like this: https://stackoverflow.com/questions/34272274/how-to-capture-screenshot-in-html-using-js-or-jquery , this: https://stackoverflow.com/questions/4912092/using-html5-canvas-javascript-to-take-in-browser-screenshots and this: https://stackoverflow.com/questions/5621907/how-to-screenshot-website-in-javascript-client-side-how-google-did-it-no-nee – briosheje Nov 14 '18 at 10:16
  • 1
    That would not be a problem. The addon would only be available in our own product, which is an adapted firefox browser that is served to the user through rdp. – LDerksen Nov 14 '18 at 10:52
  • Ok, then I guess you can try with this: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/captureVisibleTab (make your own extension and call it from your own js) Read more here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/What_are_WebExtensions – briosheje Nov 14 '18 at 10:54

0 Answers0