Search code examples
firefoxmozillaprofiles

Mozilla WebExtensions support for Firefox Profiles


I want to create a Firefox Addon using WebExtensions, that will;

  • Display user, list of already created Firefox profiles
  • Ability to switch Profile

Just like User Agent Switcher (it was built on top of Mozilla Addon SDK). Watch https://www.screencast.com/t/Zj4AkTmFfA

I am unable to find any api reference over https://developer.mozilla.org/en-US/Add-ons/WebExtensions to access profiles list or switch profile.

Not sure if Mozilla is going to remove accessing Firefox profiles from within WebExtensions like they have restricted access to Firefox preferences (about:config).


Solution

  • I'm afraid there is no API, at the moment, to deal with user profiles. Other than the list on MDN, there's a list of APIs that have been approved and are being implemented.

    However, there is one mid-term possibility: you can file a bug to request the support for a new API. This doesn't necessarily mean that your request will be implemented, but it does mean that it will be at least discussed. There's a guide here on how to do that.

    If none of these options address your situation, you can consider filing an API request. Before you do, please keep in mind:

    • The goal of WebExtensions is not to support every use case from legacy extensions. In most cases, the functionality you need can be
      built with WebExtensions APIs, but it requires some re-thinking and
      modification.
    • Generic or very broad bugs are hard to turn into actionable issues. Try to limit the focus if possible.
    • We do try to review all incoming API requests, but it takes time, so please be patient.
    • Do a search to see if the bug exists already.
    • Still want to file a new API? You can do so here.

    Please note that there are ideas for filesystem access post Firefox 57: this could potentially be used to at least show the different user profiles.