Taking screenshots from the "chrome" context
Does anybody know how to take screenshots from the Firefox "chrome" context like so: ```js const { GeckoDriver } = ChromeUtils.importESModule( "chrome://remote/conte… (ebele ya kotanga)
Does anybody know how to take screenshots from the Firefox "chrome" context like so: ```js const { GeckoDriver } = ChromeUtils.importESModule(
"chrome://remote/content/marionette/driver.sys.mjs"
); const image = await GeckoDriver.prototype.takeScreenshot(); ```
The error I get is: "Browsing context has been discarded".
I'm rewriting the text-based browser https://brow.sh and have already been successfully using the screenshotter from the Web Extensions API. And of course I know that I can take screenshots directly from Webdriver (namely GeckoDriver in the case of Firefox), but they're just too slow, having to send the screenshot to Webdriver and then back to the web extension. So there are 2 reasons I'd like screenshots from the chrome context:
1. It'd save me having to manage the Browsh web extension. Having to have both a separate build process and the dedicated signed publishing process isn't fun. 2. The current version of Browsh only renders the "content" context of the browser, which is arguably the most important part I know, but it'd be nice if Browsh could also render things like the permissions dialog, URL history suggestions, etc.
So any other ideas that could address one or both of those points would be much appreciated.