Rob--W/crxviewer

Cannot open fxmonitor@mozilla.org.xpi and others

Lekensteyn opened this issue · 2 comments

Some Firefox XPI files do not have the "50 4b 03 04" signature that is checked for in src/lib/crx-to-zip.js and fail with an "Invalid header: Does not start with Cr24." error.

Sample: fxmonitor@mozilla.org.xpi.zip

For reference, firefox 68.0.1-2 on Arch Linux:

$ for i in /usr/lib/firefox/browser/features/*; do echo "+ xxd -a $i | head -1"; xxd -a "$i" | head -1; done
+ xxd -a /usr/lib/firefox/browser/features/formautofill@mozilla.org.xpi | head -1
00000000: e1dd 0200 504b 0102 1403 0a00 0000 0000  ....PK..........
+ xxd -a /usr/lib/firefox/browser/features/fxmonitor@mozilla.org.xpi | head -1
00000000: fa4d 0000 504b 0102 1403 0a00 0000 0000  .M..PK..........
+ xxd -a /usr/lib/firefox/browser/features/screenshots@mozilla.org.xpi | head -1
00000000: 504b 0304 0a00 0000 0000 0000 213c 69e0  PK..........!<i.
+ xxd -a /usr/lib/firefox/browser/features/webcompat@mozilla.org.xpi | head -1
00000000: 8369 0000 504b 0102 1403 0a00 0000 0000  .i..PK..........
+ xxd -a /usr/lib/firefox/browser/features/webcompat-reporter@mozilla.org.xpi | head -1
00000000: 504b 0304 0a00 0000 0000 0000 213c b3d1  PK..........!<..

xpi-makes-sense-to-me

FYI, although it's extension is an xpi, the content is not like usual extension packages. Their format is described by "Jar archives optimized for Gecko" at https://searchfox.org/mozilla-central/rev/7a5022a31fff48c9ffe6524a5a0dfec9b2f4e465/python/mozbuild/mozpack/mozjar.py#525-550

Fixed in 1.6.11.