Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Taking screenshots from the "chrome" context

  • பதில்கள் இல்லை
  • 0 இந்த பிரச்னைகள் உள்ளது
  • 4 views

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.

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.

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.