Monday, 9 September 2013

Programmatically create Firefox profiles

Programmatically create Firefox profiles

Question:
Is there a simple programmatic way to create new Firefox profiles?
nsIToolkitProfileService looks like it might do the trick but the docs say:
Starting in Gecko 18 (Firefox 18.0 / Thunderbird 18.0 / SeaMonkey 2.15 /
Firefox OS 1.0.1), you should no longer use either this service or
nsIToolkitProfile
Why:
I am interested to do this because I think it could be used to get
independent executables of Firefox running pretty easily (e.g., so one can
have a wholly separate icon in the task bar for each app) without the need
for the now defunct Prism/Chromeless/WebRunner projects.
My approach would be to create a Firefox add-on which allowed the user to
specify a web app URL and then would auto-create for them a namespaced
profile like "Executable1", "Executable2", etc. for the app as well as a
batch file which would invoke the command line "-no-remote" argument
against that profile and app (since -no-remote seems to require a profile
to create a new instance (the "-new-instance" argument I have seen
mentioned in a bug does not seem to work for me).

No comments:

Post a Comment