Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Ko tenda hembiapoite sa’ivéta oñemba’apokuévo hese hembiapo porãve hag̃ua. Peteĩ jehaipyre nomoĩporãiramo ne apañuái ha eporanduséramo, roguerekohína ore nepytyvõ rekoha ikatútava ndeykeko @FirefoxSupport Twitter-pe ha avei /r/firefox Reddit-pe.

Eheka Pytyvõha

Emboyke pytyvõha apovai. Ndorojeruremo’ãi ehenói térã eñe’ẽmondóvo pumbyrýpe ha emoherakuãvo marandu nemba’etéva. Emombe’u tembiapo imarãkuaáva ko “Marandu iñañáva” rupive.

Kuaave

firefox "screenshot" command line option

  • 8 Mbohovái
  • 1 oguereko ko apañuái
  • 12 Hecha
  • Mbohovái ipaháva nealelliott1

more options

in previous versions of firefox, I was able to create screenshots with the following command line options:

/firefox.exe" -P headless --purgecaches --screenshot raw_weather.png --window-size=1920,1080 -browser "https://www.google.com/search?&q=weather+in+Washington+DC"

however, with the latest version 92.0.1, the "--screenshot" option no longer works. what has changed? what am I doing wrong?

in previous versions of firefox, I was able to create screenshots with the following command line options: /firefox.exe" -P headless --purgecaches --screenshot raw_weather.png --window-size=1920,1080 -browser "https://www.google.com/search?&q=weather+in+Washington+DC" however, with the latest version 92.0.1, the "--screenshot" option no longer works. what has changed? what am I doing wrong?

Opaite Mbohovái (8)

more options

You may have to create a new profile for running in headless mode.

more options

Thanks, I did create a new profile and called it "headless", however I'm having the same problem.

more options

The code I posted in the above mentioned thread still works for me with the current release. So you can use this as a test to check with issues for your command line.

Note that "-screenshot" implies "-headless" (so merely -screenshot is sufficient) and your code is also missing the dash before "headless" and that might confuse Firefox. Also make sure you clear the entire profile folder as that worked best for me because headless mode seems to be quite sensitive on how to initialize a profile and a normal profile didn't work.

Location used for the main profile that keeps your personal data (Root Directory on about:profiles).

  • C:\Users\<user>\AppData\Roaming\Mozilla\Firefox\Profiles\<profile>

Location used for the disk cache and other temporary files (Local Directory on about:profiles).

  • C:\Users\<user>\AppData\Local\Mozilla\Firefox\Profiles\<profile>
more options

thanks for the additional information to try. unfortunately, this does not work as well. when I run the command with the "headless" profile that I created, firefox runs for a few seconds, then immediately exits, without an error message, and fails to write an image. is there a way that I can get more debug information while running this command?

"C:\Program Files\Mozilla Firefox\firefox.exe" -screenshot test.png https://support.mozilla.org/en-US/questions/firefox -P headless -no-remote

more options

Did you try to clear the headless profile in both locations (i.e. no files and folder left) to make it possible for Firefox headless to initialize the profile ?

You can try to run the command in a command window.

more options

yes, I cleared the profile from both local and roaming app data locations, and created a few test profiles as well. when I'm running the firefox commands, I'm using the cmd shell.

more options

I tested it with a new profile created in the current release and cleared the entire profile. The problem might be where the test.png file is saved as that is the default folder that is selected when Firefox is run and you also need write permissions to this folder. So maybe specify the full path for the screenshot image.

Moambuepyre cor-el rupive

more options

thank you for the helpful feedback. I verified that I have permission in the directory where I want firefox to write the image file, but still no joy. the disappointing thing is that when firefox runs, it just exits without any error messages, or any clue why it fails to write the image.