I am trying to write a simple batch script to take some screenshots of internal webpages on my end and came across the fact that firefox has this ability to render the window to canvas:
var canvas = document.createElement('canvas');
var ctx = canvas.getContext("2d");
ctx.drawWindow(window, 0,0, 100, 200, "rgb(255,255,255)");
console.log(canvas.toDataURL("image/png"));
However, this seems to be reserved only form extensions and throws an Error: The operation is insecure.
I don't need to publish this to anyone else and I'm happy to make some internal adjustment to only my Firefox to avoid creating an extension. Is there some sort of about:config setting (or something else) I can tweak to just let this go through even if it's not in an extension?
Go to
about:config
and setdevtools.chrome.enabled
totrue
Restart
Go to the tab you want to take screenshot
Press Shift+F4
Switch environment to Browser
Paste the following snippet
Place the cursor at the end of the last line
Press Control+L
Mission accomplished!