How does this work with elements with a semi-transparent background? Will the resulting screenshots also be semi-transparent, or will they contain portions of the element beneath?
(I work for Mozilla) It captures the page cropped to the bounding box of the element, so any background content would also be captured. The results would not contain transparency.
What happens if there are elements below the one you're screenshotting by z-index?
You would see the element under it assuming it's possible. What this does is finds the bounding box cords and takes a full page screenshot and crops it to that region.
So in other words it doesn't work if the element has children that are transformed (tested that). Still useful though
And if there are non-child elements positioned to overlap with this one, presumably they get captured too?
Are there any plans to make this available through a Javascript API? With appropriate security warnings of course.
If you want to render an element with transparency, you have to seperate it from the page and render it yourself with ctx.drawWindow(window, x, y, dx, dy, "transparent") to a canvas