(Not) Mapping Firefox extension IDs to their names
2024-1-6 07:36:45 Author: www.hexacorn.com(查看原文) 阅读量:10 收藏

I have mapped an extensive list of Chrome Plug-in IDs to their names before. Of course, I knew for a long time that I will need to take a look at Firefox Add-ons too…. And in fairness, I did… I actually made a few approaches in the past but without much success.

If you are not familiar with Firefox Add-ons IDs, here’s your starter pack.

The forensics ramifications of the choices described in that article cannot be overlooked:

  • Add-on IDs are not MANDATORY – yup, some Add-ons use (unique) IDs, some – don’t
  • There are at least 2 versions of Add-on JSON manifest to take care of (manifest being the manifest.json file storing all the info about the plug-in, or so you wish — read below)

What the article doesn’t tell you is that the Firefox Add-on world is a total mess.

What that means is that you can’t just download all Firefox Add-ons in one go and then parse their manifests to build a table with all the names, IDs, and their descriptions…

Oh, no… this would be too easy.

The moment you try you will immediately discover that:

  • many manifest.json files are not following JSON standard requirements and can’t be parsed with standard Python libraries (f.ex. comments are not allowed and generate exceptions; hint: json5 works)
  • many entries inside these files include Unicode characters or encoded Unicode characters that can’t be rendered properly with standard Python libraries
  • many newer manifest.json files reference external _locales\<language-code> folders storing one or multiple messages.json files defining referenced localized strings inside the manifest.json files; while these external references are easy to spot as they are all prefixed with __MSG_ it’s an additional complexity
  • It’s all nice and cozy, except:
    • list of locale language-specific directories is messy and non-standard: en, en-us, en_us, en_gb – this is just for US and UK English and it’s just not quality-checked at all
    • many messages.json files do not include all localized fields (yup, your en\messages.json may define 2 strings, and ru\messages.json 20!)
    • many messages.json files include typos
    • many messages.json files include field names referenced by manifest.json files that are stored in a way that makes them inaccessible f.ex. fully capitalized string inside manifest.json file and lower-case, or camel-case inside the messages.json – seriously, is no one checking this when add-ons are submitted? :shockemoji:

I wish this was over, but it is not. So, I don’t have a list of Firefox Add-on ID to name mapping for you yet. I only have this rant 🙂 Sorry 🙂


文章来源: https://www.hexacorn.com/blog/2024/01/05/not-mapping-firefox-extension-ids-to-their-names/
如有侵权请联系:admin#unsafe.sh