File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1424,6 +1424,14 @@ comment_xcf () {
14241424 fi
14251425}
14261426
1427+ # File type: xpi (Mozilla extension)
1428+ # requires: unzip (Info-ZIP version)
1429+ comment_xpi () {
1430+ # "safe" filename guaranteed not to start with a dash
1431+ sf=" $( safefn " $1 " ) "
1432+ COMMENT=$( unzip -p " $sf " manifest.json | jq -r .name)
1433+ }
1434+
14271435# File type: xpm (X pixmap image)
14281436# Could extract image size here as well
14291437comment_xpm () {
@@ -1794,6 +1802,9 @@ for f in "$@" ; do
17941802 * .xhb)
17951803 TYPE=xhb
17961804 ;;
1805+ * .xpi)
1806+ TYPE=xpi
1807+ ;;
17971808 * .xpm)
17981809 TYPE=xpm
17991810 ;;
Original file line number Diff line number Diff line change @@ -1098,6 +1098,16 @@ mtime_xcf_exiftool () {
10981098 TIME=$( echo " $RAWTIME " | sed -E -e ' s/^([0-9][0-9][0-9][0-9]):([0-9][0-9]):/\1-\2-/' -e ' s/([-+][0-9][0-9])(:)?([0-9][0-9])$/ \1\3/' )
10991099}
11001100
1101+ # File type: xpi (Mozilla extension)
1102+ # requires: unzip (Info-ZIP version), openssl
1103+ mtime_xpi () {
1104+ # Decode the signature rather than looking at the file mtimes since the latter
1105+ # seems to always be set to 1980-01-01.
1106+ RAWTIME=$( unzip -p " $f " META-INF/mozilla.rsa | openssl pkcs7 -print_certs -text -inform DER -in - | sed -n ' s/^[[:space:]]*Not Before:[[:space:]]*//p' | head -1)
1107+ # $RAWTIME is like Apr 19 22:52:53 2026 GMT
1108+ TIME=$( normalize_time_tz " $RAWTIME " )
1109+ }
1110+
11011111# File type: zip (zip archive)
11021112# requires: unzip (Info-ZIP version), findutils
11031113mtime_zip () {
@@ -1530,6 +1540,10 @@ for f in "$@" ; do
15301540 TYPE=xcf
15311541 ;;
15321542
1543+ * .xpi)
1544+ TYPE=xpi
1545+ ;;
1546+
15331547 * .zpaq)
15341548 TYPE=zpaq
15351549 ;;
You can’t perform that action at this time.
0 commit comments