Is there any API for taking a screenshot of the screen I can use in Chrome App?

1,715 views
Skip to first unread message

Arthur Siyatelev

unread,
Jan 12, 2017, 8:33:25 AM1/12/17
to Chromium-Apps-Announce
I'm developing a screenshoter for Chrome OS and just realized (sigh...) that the only suitable API is getUserMedia captures only media streams (such as video or audio), but it seems like a hack to get the first frame from it.

Maybe there is a method of catching system screenshot event and redirect the data to my app (instead of saving it in Files which is the default action)? The key point is that the app should get the data for further processing.

If it can be implemented with Chrome Apps APIs or somehow, please give me a hint how to do that. It must not require any additional resources to install.


Chua, Chee How

unread,
Jan 12, 2017, 9:51:53 AM1/12/17
to Arthur Siyatelev, Chromium-Apps-Announce
I realise that you are developing a Chrome App. If you are flexible to changing it to a Chrome Extension, the desktopCapture API (https://developer.chrome.com/extensions/desktopCapture) will be the one you are looking for.

Alternatively, if possible, have a Chrome App AND an Chrome Extension where the App can send a message to the Extension to capture a screenshot and somehow pass the screenshot image back to the App?

--
You received this message because you are subscribed to the Google Groups "Chromium-Apps-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-apps+unsubscribe@chromium.org.
To post to this group, send email to chromi...@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-apps/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

PhistucK

unread,
Jan 12, 2017, 12:18:39 PM1/12/17
to Chua, Chee How, Arthur Siyatelev, Chromium-Apps-Announce
I think the original poster referred to the desktopCapture API as the API that gives you a stream, from which you have to capture the first frame ("it seems like a hack to get the first frame from it").


PhistucK

Chua, Chee How

unread,
Jan 12, 2017, 5:56:44 PM1/12/17
to PhistucK, Arthur Siyatelev, Chromium-Apps-Announce
Oops, my bad. I was thinking of the tabs API method captureVisibleTab (https://developer.chrome.com/extensions/tabs#method-captureVisibleTab) when referring to the desktopCapture API.
Reply all
Reply to author
Forward
0 new messages