Passing active camera images to browser

According to the documentation, we can pass a string argument to a javascript function that is the HTML file.

I’d like to pass images the browser to be put in a div container. Is this possible?

General workflow should be like this: encode your screenshot as PNG, then do a base64 encoding, move it to the browser, use as data url in an img tag.