Take a full page screenshot with Firefox on the command-line

后端 未结 6 1546
梦如初夏
梦如初夏 2020-12-04 04:34

I\'m running Firefox on a Xvfb in a VPS. What I want to do is to take a full page screenshot of the page.

I can redirect Firefox to particular page using

<         


        
6条回答
  •  生来不讨喜
    2020-12-04 05:22

    Update 2018-07-23

    As was just pointed out in the comments, this question was about getting a screenshot from the command line. Sorry, I just read over that. So here is the correct answer:

    As of Firefox 57 you can create a screenshot in headless mode like this:

    firefox -screenshot https://developer.mozilla.com
    

    Read more in the documentation.

    Update 2017-06-15

    As of Firefox 55 there is Firefox Screenshots as a more flexible alternative. As of Firefox 57 Screenshots can capture a full page, too.

    Original answer

    Since Firefox 32 there is also a full page screenshot button in the developer tools (F12). If it is not enabled go to the developer tools settings (gear button) and choose "Take a fullpage screenshot" at the "Available Toolbox Buttons" section.

    developer tools toolbar source: developer.mozilla.org

    By default the screenshots are saved in the download directory. This works similar to screenshot --fullpage in the toolbar.

提交回复
热议问题