{"id":8958,"date":"2024-01-05T23:36:45","date_gmt":"2024-01-05T23:36:45","guid":{"rendered":"https:\/\/www.hexacorn.com\/blog\/?p=8958"},"modified":"2024-01-05T23:36:45","modified_gmt":"2024-01-05T23:36:45","slug":"not-mapping-firefox-extension-ids-to-their-names","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2024\/01\/05\/not-mapping-firefox-extension-ids-to-their-names\/","title":{"rendered":"(Not) Mapping Firefox extension IDs to their names"},"content":{"rendered":"\n<p>I have mapped an extensive list of Chrome Plug-in IDs to their names <a href=\"https:\/\/www.hexacorn.com\/blog\/2023\/10\/20\/mapping-chrome-extension-ids-to-their-names-part-2\/\" data-type=\"post\" data-id=\"8794\">before<\/a>. Of course, I knew for a long time that I will need to take a look at Firefox Add-ons too&#8230;. And in fairness, I did&#8230; I actually made a few approaches in the past but without much success.<\/p>\n\n\n\n<p>If you are not familiar with Firefox Add-ons IDs, here&#8217;s your <a href=\"https:\/\/extensionworkshop.com\/documentation\/develop\/extensions-and-the-add-on-id\/\">starter pack<\/a>.<\/p>\n\n\n\n<p>The forensics ramifications of the choices described in that article cannot be overlooked:<\/p>\n\n\n\n<ul>\n<li>Add-on IDs are not MANDATORY &#8211; yup, some Add-ons use (unique) IDs, some &#8211; don&#8217;t<\/li>\n\n\n\n<li>There are at least 2 versions of Add-on JSON manifest to take care of (manifest being the <em>manifest.json<\/em> file storing all the info about the plug-in, or so you wish &#8212; read below)<\/li>\n<\/ul>\n\n\n\n<p>What the article doesn&#8217;t tell you is that the Firefox Add-on world is a total mess.<\/p>\n\n\n\n<p>What that means is that you can&#8217;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&#8230;<\/p>\n\n\n\n<p>Oh, no&#8230; this would be too easy.<\/p>\n\n\n\n<p>The moment you try you will immediately discover that:<\/p>\n\n\n\n<ul>\n<li>many <em>manifest.json<\/em> files are not following JSON standard requirements and can&#8217;t be parsed with standard Python libraries (f.ex. comments are not allowed and generate exceptions; hint: json5 works)<\/li>\n\n\n\n<li>many entries inside these files include Unicode characters or encoded Unicode characters that can&#8217;t be rendered properly with standard Python libraries<\/li>\n\n\n\n<li>many newer <em>manifest.json<\/em> files reference external <em>_locales\\&lt;language-code><\/em> folders storing one or multiple <em>messages.json <\/em>files defining referenced localized strings inside the <em>manifest.json<\/em> files; while these external references are easy to spot as they are all prefixed with  <em><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Add-ons\/WebExtensions\/Internationalization#retrieving_localized_strings_in_manifests\">__MSG_<\/a><\/em> it&#8217;s an additional complexity<\/li>\n\n\n\n<li>It&#8217;s all nice and cozy, except:\n<ul>\n<li>list of locale language-specific directories is messy and non-standard: en, en-us, en_us, en_gb &#8211; this is just for US and UK English and it&#8217;s just not quality-checked at all<\/li>\n\n\n\n<li>many <em>messages.json <\/em>files do not include all localized fields (yup, your <em>en\\messages.json <\/em>may define 2 strings, and <em>ru\\messages.json<\/em> 20!)<\/li>\n\n\n\n<li>many <em>messages.json <\/em>files include typos<\/li>\n\n\n\n<li>many <em>messages.json<\/em> files include field names referenced by <em>manifest.json<\/em> files that are stored in a way that makes them inaccessible f.ex. fully capitalized string inside <em>manifest.json<\/em> file and lower-case, or camel-case inside the <em>messages.json <\/em>&#8211; seriously, is no one checking this when add-ons are submitted? :shockemoji:<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>I wish this was over, but it is not. So, I don&#8217;t have a list of Firefox Add-on ID to name mapping for you yet. I only have this rant \ud83d\ude42 Sorry \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;. And in fairness, I did&#8230; I &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2024\/01\/05\/not-mapping-firefox-extension-ids-to-their-names\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/8958"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=8958"}],"version-history":[{"count":8,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/8958\/revisions"}],"predecessor-version":[{"id":9042,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/8958\/revisions\/9042"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=8958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=8958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=8958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}