Creating screenshots with own names (timestamps, domains, pathnames etc)

I hope I’ll be able to answer few requests you can found there:

FEATURE TITLE ► Screenshots names with timestamps
OBJECT TITLE ► shot.js

The answer describes procedure allowing change screnshot names in GNU/Linux (Debian Bullseye), but XPI files should be working in Win as well (not checked).

I assume you are acquainted well with the owners issues in GNU systems. I use Midnight Commander for every system doings (editing etc). Red background in MC windows informs me of root ownership (green was chosen for me, the main user).

  1. Go to the directory where you installed Firefox. I did it manually to the /opt directory.

  2. Create additional directory firefox.testbed there and new directory inside it.

  3. Go to /opt/firefox/browser/features/ directory where you’ll find xpi files. They are zipped files. Find and copy it to the /opt/firefox.testbed/ MC works as all the world File Commanders, so you won’t have any issues with using MC. You can turn to CLI environment too:
    cp /opt/firefox.testbed/

  4. Move to the target directory and then unzip the xpi archive:


  1. Go to the build directory, there is placed shot.js file - the culprit of all those evils of Firefox screenshot name issues. :wink:

  2. Open the file in an editor, I used MC’s mcedit (F4 in MC). It contains the following function code named get filenam() { :

Here I must stop. I beg your pardon, but you have to read the javascript code yourself. No place here to play with it, but the function code can be changed with a small intellectual efforts (for those who dares :wink: ). I did my homework, so I am able to share with forum readers my four xpi files which change Firefox screenshot names.

  1. When you “make the changes” you must to zip the directory from within: (the best use 7zip)
    7z a ../ * -r

  2. Move up from the directory to where you have created corrected xpi file.
    Apply (rename) to your new file a meaning name, e.g. I did that because I have made few xpi versions. Thanks to them:

  • all screenshots gained timestamp
  • all screenshot names gained domain names instead of traditional page titles - there are short names and very long ones, too long to my liking too, although one user requested opposite - unlimited page titles.
  • I make frequently screenshots of directory pages which have addresses starting with file prefix:
    In such cases new screenshot names contain pathnames instead of domain names. That’s why I have conjured up few versions to which I applied meaningful names, namely:
  • (screenshot names with timestamps, domain names or pathnames)
  • (page name limited to 127 characters)
  • (original Firefox xpi file with 255 characters limit)
  • (for screenshot names with page titles of unlimited length)


Why have I changed original file to To have flexibility in selection of screenshot names.

Anyway, there are some caveats. The first sad thing is that Firefox accepts original name only (to my scarce knowledge). The good is that you can change the contents. The second bad issue - after selection of new xpi file you’d have to reload Firefox.

  1. Back to the next steps. When you create all your new XPI files with different names copy them to Firefox original directory:

mv*.xpi /opt/firefox/browser/features

Do remember to remove (delete or move to other directory) original file Otherwise you will not be able to create symlink to original xpi name.

  1. Being in the /opt/firefox/browser/features directory, create symlink to your favorable xpi file, e.g.:
    ln -s

Screenshot I created and which illustrate the above text are placed in Yandex disk. All four versions of xpi files are there too. Use XPI SOURCES address presented at the beginning of this mini article.

There you’ll find a special image ssfx_0007.png (below). It needs explanation.

Numbers - 1,2,3,4 are names of screenshots I tested for the page shown on ssfx_0000.png (below).

'*' [star] =

No.1 is original screenshot name from unchanged Firefox. Consecutive names were tested. In the end I’ve chosen 4th version (**.domain.pathname.xpi* file)

Numbers 5-8 concerns domain
No.8 comes from *.domain.pathname.xpi.
No.7 was created by *.filename.127.xpi.
No.6 is result of *.filename.limitless.xpi.
No.5 name “produced” original file *.filename.255.xpi.

That’s all. Thank you.