How can I add the domain to either the path or filename used to save a fullpage screenshot taken in Firefox or another browser?

0

I take a lot of fullpage screenshots using the developer toolbar in Firefox. By default, they are saved to

~/Downloads/Screen Shot YYYY-MM-DD at HH:MM:SS-fullpage.png

Since the screenshots are images, they aren't text-searchable, and I would like them to be automatically organized by the domain of the webpage.

Either like

~/Downloads/Screen Shot amazon YYYY-MM-DD at HH:MM:SS-fullpage.png
~/Downloads/Screen Shot ebay YYYY-MM-DD at HH:MM:SS-fullpage.png

Or like

~/Downloads/amazon/Screen Shot YYYY-MM-DD at HH:MM:SS-fullpage.png
~/Downloads/ebay/Screen Shot YYYY-MM-DD at HH:MM:SS-fullpage.png

I've explored two four solutions:

  1. Alias the GCLI screenshot command with a parameter in the filename. I thought aliasing would definitely be supported, but it turns out the feature request was abandoned years ago here and here.

  2. Turn on this option for Firefox to remember last-used save locations per-domain. This gets closer assuming it works as advertised, but still requires a manual step to set the location for each new domain, by arbitrarily saving a file from the domain to the desired target location.

    Update: This does not work as advertised. Saving arbitrary content from a domain to a target directory does update the browser.download.lastDir preference to that directory, but subsequent screenshots of pages from that domain are still saved to the browser.download.dir preference setting. Update 2: This is because this preference setting only controls the file picker.

  3. Temporarily override the browser.download.dir preference setting programmatically by modifying a user.js file. The problem with this is that user.js is only loaded at startup. There isn't a way to trigger reloading it without restarting the whole browser.

  4. Modify the filename template string used for screen shots created by the operating system. Eric Meyer says that Firefox "uses the pattern of your OS screen capture naming." But it does not. Firefox uses a pattern hard-coded in screenshot.properties which is only coincidentally the same template pattern as Mac OS default.


Bonus points if there is also a way for screenshots taken using Command-Shift-4 in OS X to be saved the same way. But being able to take a full-page (scrolling) screenshot of a rendered webpage is more important to me. I am open to using a different browser if aliasing CLI commands is supported.

wemily

Posted 2018-05-24T05:17:24.867

Reputation: 111

Thanks for letting me know. Another reason to never update software. I'll edit the question, because I think screenshots can still be taken by clicking on some button somewhere, although that's not how I use it. – wemily – 2018-05-24T05:22:17.433

"is unmaintained for some time now, many commands are broken" – probably not a state where you want to stop updating. – user1686 – 2018-05-24T06:07:58.713

They are nixing it, not fixing it. So it's not as if I would a get a version that is maintained instead of unmaintained by updating. They also acknowledge that they are leaving users without a way to take full-page screenshots here and here

– wemily – 2018-05-24T08:01:28.203

Thanks @dsstorefile1. I continued to use GCLI in ESR releases until today. Apparently it was removed with the update to Firefox 68.0.1esr. So with this :screenshot command in Web Console, can I pass any kind of non-literal to the --filename option? I tried JavaScript, it seems not interpreted. Even ~ is not expanded to the user home directory. – wemily – 2019-08-01T03:50:52.623

No answers