Closed
Bug 1561395
Opened 5 years ago
Closed 5 years ago
Improve drawSnapshot API
Categories
(Core :: Graphics, enhancement, P3)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla70
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: rhunt, Assigned: rhunt)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
- Expose it off of WindowGlobalParent so we can snapshot the whole browser window or just a specific remote iframe
- Allow specifying 'capture the whole viewport' instead of an explicit rect
Here's some sample code you can put in your browser console to test this out:
img = await docShell.browsingContext.currentWindowGlobal.drawSnapshot(null, 1, 'white');
canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
uri = canvas.toDataURL()
Assignee | ||
Comment 1•5 years ago
|
||
I would've liked to split this patch up into cleaner parts, but the logic is pretty tangled up. I hope it's still simple enough to be reviewed. At the least, no code is actively using or testing this so it's a low risk change.
Assignee | ||
Comment 2•5 years ago
|
||
Pushed by rhunt@eqrion.net: https://hg.mozilla.org/integration/autoland/rev/09fcee21b246 Move drawSnapshot API to WindowGlobalParent and allow specifying the whole viewport as a rect. r=mattwoodrow,nika
Comment 4•5 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox70:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Updated•5 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•