DEV Community

Cover image for Three hours, one small extension, and Firefox Add-ons
Antonio for Necoz

Posted on Edited on

Three hours, one small extension, and Firefox Add-ons

Catches hidden manifest requirements and zip rules

After Chrome Web Store (approved in about 5 hours) and Edge Add-ons (in review), I thought Firefox would be the easy one. Same extension, same Manifest V3, same zip. πŸ˜…

It took me three hours. Not because the code was broken, but because Firefox Add-ons asks for a few extra things I didn't know about. Here is what I learned, so you don't have to learn it at 11 PM after a day at the factory.

1. Firefox wants an ID in the manifest

Chrome doesn't care, Firefox does:

"browser_specific_settings": {
  "gecko": {
    "id": "your-extension@yourdomain.com",
    "strict_min_version": "142.0",
    "data_collection_permissions": { "required": ["none"] }
  }
}
Enter fullscreen mode Exit fullscreen mode

data_collection_permissions is now required for new extensions, and it needs Firefox 142 or newer, otherwise the validator warns you about Firefox for Android.

2. Don't delete a draft add-on

I deleted my first submission to start fresh. Big mistake: the ID and the URL slug stay reserved forever. I had to pick a new ID and a new slug. The name can stay the same, only the link changes.

3. The manifest must be at the root of the zip

If you zip the folder instead of its contents, validation fails. Open the zip: manifest.json must be the first thing you see.

4. The innerHTML warnings

The validator gave me 9 warnings: "Unsafe assignment to innerHTML". Not errors, but I wanted a clean result. So I replaced them with DOM methods:

// Before
panel.innerHTML = `<b>FPS</b> ${fps}`;

// After
const label = document.createElement("b");
label.textContent = "FPS";
panel.replaceChildren(label, ` ${fps}`);
Enter fullscreen mode Exit fullscreen mode

Same HUD, same look, and the result: 0 errors, 0 warnings. βœ…

The result

BeeLadybug is now waiting for review on Firefox too. Three stores, one small vanilla JS extension, and a lot of patience.

If you're publishing your first Firefox extension, I hope this saves you a few hours. And if you have a Firefox story, tell me in the comments! 🐝

Top comments (12)

Collapse
 
nyaomaru profile image
nyaomaru Necoz •

Firefox Add-ons can be surprisingly picky 😹

But in this case, the innerHTML warnings were actually a nice catch. Directly writing HTML can definitely become risky, so replacing it with DOM APIs and ending up with 0 errors and 0 warnings is a great result. 😸

Nice write-up, this will probably save someone a lot of time when they publish their first Firefox extension! πŸ’š

Collapse
 
antonioprosperi2svg profile image
Antonio Necoz •

Thank you so much! At first those innerHTML warnings drove me crazy, but rewriting everything with clean DOM APIs ended up making the code much safer and easier to maintain. Glad it can save someone else a few hours! 🦊🐝

Collapse
 
userxnom profile image
Abdullah Naseer •

The manifest ID detail is the one that would have cost me the most time β€” I would have assumed the error was in the zip, not in a draft I had deleted. And going from 9 warnings to 0 by building the DOM instead of injecting HTML is a good reminder that the review feedback is often pointing at real fragility, not just policy. Did the reviewer flag anything else you had to rework, or was the innerHTML change the whole fix?

Collapse
 
antonioprosperi2svg profile image
Antonio Necoz •

Thanks! Glad it was helpful.

No other code rework was needed β€” replacing innerHTML with DOM methods (createElement, textContent, replaceChildren) and bumping strict_min_version to 142.0 (for data_collection_permissions) brought the automated validator down to 0 errors and 0 warnings.

Everything else was just the submission checklist (reviewer notes explaining the hotkeys and confirming there's no build/minification step). Now it's just sitting in the review queue waiting for approval! 🐝

Collapse
 
paullovelace profile image
Paul Lovelace •

The deleted draft keeping its ID and slug forever is the one that would have cost me a day β€” I'd have assumed the error was in my zip, not in a draft I deleted an hour ago. The innerHTML warnings turning out to be a real catch is the nice twist though: nine warnings that looked like noise and ended up making the code safer. Did the strict_min_version bump to 142 cause any friction on the Android side, or was that clean?

Collapse
 
antonioprosperi2svg profile image
Antonio Necoz •

Haha, that deleted draft trap is realβ€”good thing you caught it! Those innerHTML warnings looked annoying at first, but cleaning them up actually made the extension way safer. As for strict_min_version set to 142, so far it has been a clean change for me on desktop/standard builds, though I haven't run into weird Android issues with it yet.

Collapse
 
brookiecat profile image
Brookie •

chrome approved in five hours. firefox took three hours of your own life. same zip, but only one of those numbers was a clock you were sitting inside.

and the deleted draft keeping its id and slug forever is the most cat thing in that validator: we rub a doorway on the way past and everyone after knows whose it is. 🐾

Collapse
 
antonioprosperi2svg profile image
Antonio Necoz •

Haha, love that feline metaphorβ€”that deleted draft really did mark its territory forever! πŸ˜‚ Definitely a good lesson learned the hard way on how strict Mozilla's validator is compared to Chrome. Thanks for reading!

Collapse
 
gtref profile image
G-type Necoz •

Really like it and the codebase layout is good. The only thing, Where are the docs?

Collapse
 
antonioprosperi2svg profile image
Antonio Necoz •

Thanks a lot! You're right, I set up this Firefox repo quickly last night and haven't copied the README over yet.

Full documentation, shortcuts, and usage examples are here on the main repository:
github.com/antonioprosperi2-svg/Be...

And on the official site:
beeenginejs.com

I'll add the README to this repo soon too! 🐝

Collapse
 
star123 profile image
Sᴛᴀʀ⭐ Necoz •

πŸ₯°

Collapse
 
antonioprosperi2svg profile image
Antonio Necoz •

😻πŸ’ͺ