Skip to content

Instantly share code, notes, and snippets.

@bgrins
Created March 30, 2018 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgrins/434972c28bedfcc4eed85d9c6a05f308 to your computer and use it in GitHub Desktop.
Save bgrins/434972c28bedfcc4eed85d9c6a05f308 to your computer and use it in GitHub Desktop.
var el = window.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
el.width = window.innerWidth;
el.height = window.innerHeight;
var ctx = el.getContext("2d");
SpecialPowers.wrap(ctx).drawWindow(window, 0, 0, window.innerWidth, window.innerHeight, "rgba(0,0,0,0)",
ctx.DRAWWINDOW_USE_WIDGET_LAYERS | ctx.DRAWWINDOW_DRAW_VIEW | ctx.DRAWWINDOW_DRAW_CARET);
dump("\n" + el.toDataURL() + "\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment