Firefox logo
Categories: developers mobile

Prepare your Firefox desktop extension for the upcoming Android release

In the coming months Mozilla will launch support for an open ecosystem of extensions on Firefox for Android on addons.mozilla.org (AMO). We’ll announce a definite launch date in early September, but it’s safe to expect a roll-out before the year’s end. Here’s everything developers need to know to get their Firefox desktop extensions ready for Android usage and discoverability on AMO…

Firefox will become the only major Android browser to support an open extension ecosystem

For the past few years Firefox for Android officially supported a small subset of extensions while we focused our efforts on strengthening core Firefox for Android functionality and understanding the unique needs of mobile browser users. Today, Mozilla has built the infrastructure necessary to support an open extension ecosystem on Firefox for Android. We anticipate considerable user demand for more extensions on Firefox for Android, so why not start optimizing your desktop extension for mobile-use right away?

“There is so much creative potential to unlock within the mobile browser space. Mozilla wants to provide developers with the best support we can so they’re equipped and empowered to build modern mobile WebExtensions.” — Giorgio Natili, Firefox Director of Engineering

To support our ecosystem of extension developers, we will create additional guides, resources and host community events to support your transition to a managed multi-process environment like Android.

Transition background scripts to non-persistent event pages

We recently introduced support for multi-process in Firefox for Android Nightly. This means extensions are no longer hosted in the main process as Firefox’s user interface. This is a key consideration since Android is prone to shutting down resource-intensive processes, such as extensions. To mitigate the risk of unexpected extension termination, we’ve introduced event page architecture to be non-persistent and more resilient to process termination. Thus we strongly encourage developers to transition from persistent backgrounds to non-persistent Event pages to improve their extension’s stability. In summary, this means:

  • Update your manifest.json background key and add “persistent”: false.
  • Ensure listeners are registered synchronously at the top-level.
  • Record global state in the storage API, for example storage.session.
  • Change timers to alarms.
  • Switch from using extension.getBackgroundPage for calling a function from the background page, to extension messaging or runtime.getBackgroundPage.

Once you’re ready to test the mobile version of your extension, create a collection on AMO and test it on Firefox for Android Nightly (note you’ll need to make a one-time change to Nightly’s advanced settings; please see the “Enable general extension support setting in Nightly” section of this post for details). If you’d prefer to polish your extension before publishing it on AMO, you can also debug and run the extension with web-ext.

This is an exciting time for developers seeking to expand the reach of their desktop extensions into the mobile Android space. For community support and input, you’re welcome to join the conversation on Firefox Add-ons Discourse.

52 comments on “Prepare your Firefox desktop extension for the upcoming Android release”

  1. Steven wrote on

    > Once you’re ready to test the mobile version of your extension, create a collection on AMO and test it on Firefox for Android Nightly

    Just in case anyone missed this, it seems that Android Firefox STILL will not allow anonymous installation of extensions. Even if you wrote the extension yourself, and want to install on your own device.

    Only workaround is to only install approved extensions, or be forced into registering on AMO. if I am wrong I will be happy to hear it, but this upcoming release doesn’t seem to offer any meaningful change in regards to user privacy and control.

    1. Scott wrote on

      Seems Firefox wants to give up. Did not not notice the marketshare drop when they screwed Mobile users over?

    2. Stefano wrote on

      For what I could understand, they mean that before the open ecosystem is available, extensions developers are invited to update their extensions to work on Firefox for Android: to do this, at the moment, the collection workaround is needed.
      Then, when the open ecosystem will be available, people will be able to install extensions that are already tested and compatible with Firefox for Android, without needing a Mozilla account anymore.

    3. Maher wrote on

      Too late for such move , that is why mozila is behind others

  2. Orion wrote on

    When this comes out, will mobile users have to use collections, or can addons be installed directly?

    1. Ed Sullivan wrote on

      You will be able to install any add-on on AMO that has been marked as being compatible with Android. Collections will not be required.

  3. Harisankar P S wrote on

    This is amazing news. hoping to use wonderful extensions like adblock in mobile.

    1. Akash wrote on

      You already have the best adblocker in Firefox Mobile called uBlock Origin. Why are you waiting for the inferior adblockers?

    2. Kevin wrote on

      you can already install uBlock origin in firefox

    3. David wrote on

      uBlock is already on mobile.

    4. suman wrote on

      We already have ublock origin support for Android. Try out itworks effortlessly. Have been using since a ling time…

  4. Jeff wrote on

    How do you define “open extension ecosystem”? Will it be possible to install unsigned .xpi files? Or will extensions have to be listed on AMO and be subject to terms and condition, making it very much not open but a walled garden? Why do you then not count Samsung Internet Extensions (certainly a major browser on Android, too!) as “open extensions ecosystem”?

    1. Ed Sullivan wrote on

      It will not be possible to install unsigned .xpi files.

  5. someone wrote on

    poggers

  6. Bill Gates wrote on

    Cool

  7. Fennec wrote on

    Great news!

  8. Now wrote on

    It’s about time?

  9. Lneb wrote on

    Awesome news !

  10. jesus2099 wrote on

    Wow!
    It’s very good that add-ons are coming back “soon” to Firefox.

    I had to stay in v68 for long time before I knew about Kiwi Browser, that driver all my problems, I could thanks to Kiwi, keep using Violentmonkey and Stylus, the 2 requirements for internet for me.

    I know it was possible on Firefox Beta but I didn’t want to use Beta and the complex system to install add-ons on it.

    Now maybe I will come back to Firefox…

  11. jedward wrote on

    Tablet support please?

    2026?

  12. S.L. wrote on

    Wow! This is awesome!

  13. Admit your mistake wrote on

    In the old days anyone can install ANY signed XPI file from anywhere.
    An you take this freedom by forcing everyone use AMO.
    And now you allow us to install XPI again?

    Too late mate, I already swichted to Chrome-based extension-allowed browser.

    1. kiwilol wrote on

      Bye, don’t come back.

    2. Simon Müller wrote on

      I am sorry to disappoint you, but nowhere in this article have they stated you’ll only be able to install from there. The instructions which are given right now cater purely to developers which want to publish extensions on AMO for mobile in the future.

      It is NOT about the users. A user-facing announcement will come in september, as described in the first paragraph.

  14. ScottyKilmer wrote on

    Cool, now if only we could have this on iOS… oh wait… 🙁

    1. Kurt wrote on

      Blame Apple

  15. Pandora wrote on

    Nice. Hopefully .xpi files can be loaded as well… maybe themes? They kinda just don’t work on firefox since the rewrite, even if you manage to load one it will do nothing

  16. gerard wrote on

    woohoo! i recently had to finally leave v68 (WHICH HAD FULL ADDON SUPPORT BTW, you really should’ve acknowledged the LOSS of functionality since v68) because webpages stopped working. tired of AMO collection gimmicks to get the addons i like back, it will be good to have this supported again

    1. Simon Müller wrote on

      The loss of functionality was due to a whole rewrite. They remade the entire browser from the ground up, and ported components from the desktop version to Android. The reason full extension support was gone for a good while now was a lack of good support on Android’s side, especially regarding battery optimizations.

  17. SleeepyKat wrote on

    Fantastic news!

    I see misinformation in the comment: it is currently possible to install unsigned XPI files manually. I do it regularly with extensions published on Github.

    1. George Machen wrote on

      How? Link, please.

  18. Rich I am not wrote on

    You “anticipate considerable user demand for more extensions on Firefox for Android”? Wow, you are geniuses!

    In fact, this “considerable user demand” never went away! It had been there ever since you guys took extensions from us in mobile Firefox! You ignored us power users long enough, with the consequence that many, many of us looked elsewhere for a browser with support for the extensions we wanted. And, as I’m sure, a considerable amount of us found an alternative, leaving this restrictive Firefox you had created behind.

    You consciously pushed all of us away, and now you want what? Our applause? Too little too late, matey.

    In fact, I’ll do to you what you did to us for these past few years. As the German saying goes: Go to where the peppers grow…

    1. Simon Müller wrote on

      I’ll repeat myself from another comment:
      “The loss of functionality was due to a whole rewrite. They remade the entire browser from the ground up, and ported components from the desktop version to Android. The reason full extension support was gone for a good while now was a lack of good support on Android’s side, especially regarding battery optimizations.”

  19. Ribosome wrote on

    Modern Firefox is just Chrome from Wish.com.
    Modern Mozilla is just Google from Wish.com.
    Just as evil, condescending, and totalitarian, but moved by a bunch of fireworks rockets instead of a Saturn V.

    Call me when you got back to treating users as of age persons.

  20. grow online wrote on

    Ensure that your extension is compatible with both desktop and Android versions of Firefox. This might involve adapting the user interface, interactions, and functionality to suit the mobile environment.

  21. Zevel wrote on

    Scott, this announcement raises more questions than it answers.

    1. Will I be able to install extensions not on AMO?
    If not, then it is not an “open extension ecosystem” but a walled garden.
    The word “open” has a well defined meaning. If I cannot side-load an extension from a different repository, then the ecosystem is very much closed.

    2. Is it really the first?
    Samsung Internet, with a market share of over 9x of mobile FF, supported extensions since Feb 2020, three and a half years ago.
    Kiwi Browser supports extensions.

    Aside: Can FF mobile even be called a “major” browser with 0.5% market share?

  22. Scott wrote on

    Back to the future. We did have extensions. I can go back to what I used to enjoy. Firefox syncing between desktop and mobile, allowing use of plugins. It’s great, you’ve understood plugins on mobile are what people want. I never understood Quantum in 2016, that removed features, Mobile plugins etc. I gave up and switched to Chrome on mobile and desktop. Used Nightly to allow a few plugins, but then that became difficult. I had been using Firefox since with was Firebird!

  23. Faizal R wrote on

    Interesting news. Will come to iOS as well?

  24. Fire John wrote on

    Dear Mozillal team. Because of your politics, I discovered the Kiwi Browser.

    Why does it take so long until almost all extensions are allowed? With the Fennec Browser it has been possible for many months without any problems. Can you explain exactly what the difficulty was, especially given that the extensions, apart from the 22 or so you’ve allowed, have been working in Fennec for so long?

    Why call it “free” when the extensions have to be signed by you?

    Will it be possible to install .xpi files manually?

    Best regards

  25. I_afraid_Mozilla wrote on

    I agree with Admit your mistake

    > In the old days anyone can install ANY signed XPI file from anywhere.
    An you take this freedom by forcing everyone use AMO.
    And now you allow us to install XPI again?

    And don’t forget that AMO blocked Ublock Origin in China. How’s that “Keep the internet open and accessible to ALL”?

    https://discourse.mozilla.org/t/chinese-users-cant-use-ad-blocker-extensions/94823/11

    That means the extension you let AMO hostted for you, is out of your control they decide which country can install it, which can not. They obey the governments not the users.

  26. firetheworld wrote on

    pls pls pls
    impove firefox Tablet UI.

  27. Kim wrote on

    Kiwi Browser (Android) uses all Extensions since more then 3 years. But i am interested in getting another Browser.

  28. carlos884 wrote on

    Para navegar en casa (tengo que comprar una tablet) tengo un viejo galaxy s4 con firefox 68 y las extensiones que me gustan, no las que me obligue o permita un firefox posterior.
    Para la calle tengo un galaxy S10e con kiwi browser porque pongo las extensiones que me gustan como en firefox 68 y ademas puedo importar/exportar los marcadores como quiera.
    Firefox en android esta tomando decisiones que provocan enfado y huida de usuarios.
    Permitan tambien importar/exportar marcadores sin cuenta.
    En PC tengo firefox y esta bien.
    NO tengo cuenta en samsug, gmail ni firefox,
    Intento cuidar mi privacidad.

  29. Shiba wrote on

    Like many others, I stayed on 68 for as long as possible, but eventually I had to concede to a newer version. I’m really looking forward to this, because without extensions the Internet is really frustrating.

  30. Ed Sullivan wrote on

    Hi Folks – I am on the Developer Relations team here at Mozilla (just started so I don’t have a lot of history yet) and I will try to address the comments above and share as much as I know:

    1. The below is directly from the article regarding why now and not earlier:
    “For the past few years Firefox for Android officially supported a small subset of extensions while we focused our efforts on strengthening core Firefox for Android functionality and understanding the unique needs of mobile browser users.”

    2. No 3rd party installs at GA, but my understanding is that the team is exploring a solution for a future release. It will not be possible to install unsigned .xpi files.

    3. Tablet support – I have some feelers out internally to see if I can get an update on this. I will post any information I receive back here.

    4. Themes will not be supported to the extent that they are on desktop.

    If there are additional questions, let me know and I will see if I can chase down answers.

    1. Bryan wrote on

      > It will not be possible to install unsigned .xpi files.

      That’s simply unacceptable. Firefox cannot honestly claim to offer an “open extension ecosystem” on Android when it is preventing users from installing unsigned .xpi files. It is not Mozilla’s role to be the gatekeeper of what users can do on their own devices.

      I develop private WebExtensions for my own personal use in a web browser. Mozilla has no business reviewing the source code of a private add-on that is to be used solely by me. After Firefox removed the ability to install unsigned .xpi files in Android, I switched to SmartCookieWeb-Preview and Kiwi Browser.

      After seeing this very disappointing response from Mozilla’s developer relations staff, it looks like forks and non-Firefox browsers are the only path forward for anyone who is looking for a real “open extension ecosystem” on Android.

  31. remisc wrote on

    > It will not be possible to install unsigned .xpi files.

    how about signed but not by mozilla?
    The problem here is that you are forcing users to use AMO.

    Think about how androd apps can be sideloaded. They have to be signed but users are not forced to go through google play. there are hoops and warnimgs, but its possible. Developers and users domt have to limit
    themselves to whatever platstore TOS says.

  32. Bryan wrote on

    > It will not be possible to install unsigned .xpi files.

    That’s simply unacceptable. Firefox cannot honestly claim to offer an “open extension ecosystem” on Android when it is preventing users from installing unsigned .xpi files. It is not Mozilla’s role to be the gatekeeper of what users can do on their own devices.

    I develop private WebExtensions for my own personal use in a web browser. Mozilla has no business reviewing the source code of a private add-on that is to be used solely by me. After Firefox removed the ability to install unsigned .xpi files in Android, I switched to SmartCookieWeb-Preview and Kiwi Browser.

    After seeing this very disappointing response from Mozilla’s developer relations staff, it looks like forks and non-Firefox browsers are the only path forward for anyone who is looking for a real “open extension ecosystem” on Android.

  33. Robert Lee wrote on

    pls pls pls
    impove firefox Tablet UI.
    https://partyplexx.com/

  34. Trade Vision wrote on

    Really informative article, I had the opportunity to learn a lot, thank you.
    https://www.thetradevision.com/

  35. Dave Royal wrote on

    Hi Ed

    Tablet support: take a look at the issues I and others raised on the old github site. The big display is wasted – e.g. pinned sites – and key buttons are miles apart – e.g. ‘list tabs’ and ‘new tab’ at the top and bottom of the screen.

    And fenix needs to support MV3 host permissions – I want the same code to work on Fx and Chrome. MV3 is going backwards – see bug 1841438

    Dave

  36. Claudiu wrote on

    Looking forward to this! Also put the site translation option in Firefox Android.