Open Bug 1768547 Opened 2 years ago Updated 2 years ago

Allow customizing how screenshot downloads are named

Categories

(Firefox :: Screenshots, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: sfoster, Unassigned, NeedInfo)

Details

When we create a download for a screenshot image, we generate a filename using a pattern including the "Screenshots" prefix, the date, time and part of any document title. If that pattern was defined and read from a preference value, it would be possible to customize the filenames produced to follow individual user's requirements.

The preference would likely only be visible and editable via about:config.

This new pattern would be applied to all screenshot files - it wouldn't be practical to change it case by case from within Screenshots' UI.

This comes via a suggestion on the discourse forum

Looks like the logic should go here and here? If you're not already planning to take this one, I would be interested in working on it — though there are a lot of options to consider, so maybe you can mentor me through it a bit. Adding a { $domain } option is pretty straightforward, but that post you linked is pretty sophisticated.

Also we might consider whether to expose the clipping location [...] to the user somehow. It would be pretty neat if user could decide where to crop the string, i.e. left/right/center, or alternatively to determine which of the discreet components should be clipped. (What to do when cropSize exceeds the length of the component to be clipped would be an issue, but the clipping could start from the end of the token immediately preceding the [...] token, and then walk backwards from there, clipping over preceding components.)

That would allow user to define something like Screenshot of %title[...] (%domain) from %date at %time where [...] is just interpreted as defining the end of a hypothetical range of clipped characters. That way the user could prevent the domain, date, and time from being elided if the title is really long, without necessarily being required to put the title last.

I'm sure there are other useful tokens I'm not thinking of. The "Screenshot" string would also be nice to localize. Then it could be %prefix instead of Screenshot, but users could still replace that %prefix token with a fixed string of their choice if they prefer something like Firefox Screenshot, as in the linked thread.

Edit: Also, it could be nice to allow the user to disable clipping altogether if they're on a platform without the 255-byte limit. If we don't detect a [...] in the pref value, we could just check the platform and then only start clipping the string (from the default position, the end of the string) if it exceeds some other huge number that would cause problems on Windows/macOS. Idk if there are any other edge cases to consider for that though.

Flags: needinfo?(shmediaproductions)
Severity: -- → N/A
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.