Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Prohledat stránky podpory

Vyhněte se podvodům. Za účelem poskytnutí podpory vás nikdy nežádáme, abyste zavolali nebo poslali SMS na nějaké telefonní číslo nebo abyste sdělili své osobní údaje. Jakékoliv podezřelé chování nám prosím nahlaste pomocí odkazu „Nahlásit zneužití“.

Zjistit více

Taking screenshots from the "chrome" context

  • Žádné odpovědi
  • 0 má tento problém
  • 12 zobrazení
more options

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.

Pro přidání odpovědi se musíte přihlásit ke svému účtu. Pokud dosud nemáte účet, položte nový dotaz.