Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

Firefox Headless ---Screenshot not working for local HTML files

  • 1 回覆
  • 1 有這個問題
  • 24 次檢視
  • 最近回覆由 cor-el

more options

I'm unable to generate a screenshot of a local HTML file using Firefox's (v60.9.0) [headless mode][1]

Here's the command I'm using:

   "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -P AJ --screenshot test.png "file:///C:/html_export.html"

I've tried with and without a profile and with different numbers of slashes after file. There are no errors in the command line - it just doesn't generate an output.

This command works fine when I substitute the file:// with an external website like:

   "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -P AJ --screenshot test.png google.com

Could it be related to the [redirect bug mentioned here][2]?

Any help is appreciated! Perhaps theres a way to turn on output verbosity for --headless mode?

 [1]: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode
 [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1546062
I'm unable to generate a screenshot of a local HTML file using Firefox's (v60.9.0) [headless mode][1] Here's the command I'm using: "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -P AJ --screenshot test.png "file:///C:/html_export.html" I've tried with and without a profile and with different numbers of slashes after file. There are no errors in the command line - it just doesn't generate an output. This command works fine when I substitute the file:// with an external website like: "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -P AJ --screenshot test.png google.com Could it be related to the [redirect bug mentioned here][2]? Any help is appreciated! Perhaps theres a way to turn on output verbosity for --headless mode? [1]: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1546062

所有回覆 (1)

more options

This could be related to this pref:

  • privacy.file_unique_origin = false

See also this thread for some remarks when I tested headless mode: