Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Learn More

Change Firefox filename pattern for Take Screenshots

  • 5 απαντήσεις
  • 0 έχουν αυτό το πρόβλημα
  • Τελευταία απάντηση από jonzn4SUSE

more options

Firefox can take screenshots of pages or screenshots of custom areas of pages.

According to the documentation, when we download the image, the filename should follow the pattern: Screen Shot yyy-mm-dd at hh.mm.ss.png. If I use the :screenshot at the console, the pattern works as documented.

But Firefox is using a different pattern when I choose Take Screenshot from the context menu. The pattern includes the page's title. Example: Screenshot 2024-04-14 at 18-35-16 General ‹ Settings ‹ Geomaster Lda — WordPress.png.

Since the page title can have non common filename characters, I have problems with such filenames. My uploads to MediaWiki fails with such filenames. I know I can report or improve MediaWiki, but my question here is quite simple.

Can I change the Firefox's default pattern for Take Screenshot's downloads?

Firefox can take screenshots of pages or screenshots of custom areas of pages. According to the documentation, when we download the image, the filename should follow the pattern: Screen Shot yyy-mm-dd at hh.mm.ss.png. If I use the :screenshot at the console, the pattern works as documented. But Firefox is using a different pattern when I choose Take Screenshot from the context menu. The pattern includes the page's title. Example: Screenshot 2024-04-14 at 18-35-16 General ‹ Settings ‹ Geomaster Lda — WordPress.png. Since the page title can have non common filename characters, I have problems with such filenames. My uploads to MediaWiki fails with such filenames. I know I can report or improve MediaWiki, but my question here is quite simple. Can I change the Firefox's default pattern for Take Screenshot's downloads?
Συνημμένα στιγμιότυπα

Όλες οι απαντήσεις (5)

more options

You can look at the filename function to see how this works.

EDIT: see also this bug.

  • 1744779 - Failing to download file due to missing filename sanitation

Note that you can save the screenshot to the clipboard.

Τροποποιήθηκε στις από το χρήστη cor-el

Χρήσιμο;

more options

You can modify the page title via document.title e.g. via a JavaScript bookmarklet and sanitize invalid characters. You can also set Firefox to always ask where to save the downloaded file what should allow to shorten/modify the filename.

Χρήσιμο;

more options

Hi cor-el,

Thank you for your very useful insights.

The JavaScript bookmarklet is promising, but it does not always work. The title on the browser changes immediately, but the downloaded file still uses the old title.

I'll try to understand why this simple bookmarklet sometimes fails:

javascript: (() => { document.title = 'Untitled'; })();

I'll come back if I find a working solution.

Χρήσιμο;

more options

If the problem is with full-page screenshots, the Save Screenshot extension lets you specify the elements to include in the file name. It has some level of sanitization for characters that are illegal in file names, but I don't know whether it addresses the characters that are giving you problems. Perhaps you could use the URL instead of the title as a workaround.

Χρήσιμο;

more options

Spectacle would be a far better option if you're in KDE.

https://apps.kde.org/spectacle/

Χρήσιμο;

Υποβολή ερώτησης

Πρέπει να συνδεθείτε στον λογαριασμό σας για να απαντήσετε σε δημοσιεύσεις. Ξεκινήστε μια νέα ερώτηση εάν δεν διαθέτετε ακόμα λογαριασμό.