A profile is just a directory containing files... these files include
various Firefox settings.
So yes, you can create a profile *directory* programatically. But see below.
> The idea : clicking on a button would load the temporary profile and
> configure Firefox into its default state, which would, for example,
> change the apparence (changing buttons with icons only to buttons with
This is... very difficult or impossible to within the same process: Firefox
code assumes that the profile directory will not change during runtime, and
many settings, including loaded extensions, preferences, history, etc are
cached in the process memory.
I think that you'd probably be better off creating a temporary directory and
launching a new Firefox process with the -profile command line flag pointing
to that directory (and -no-remote).
Followup to mozilla.dev.platform, please.
--BDS
But there's no way to use an interface to automatically create all the
necessary directories by just one "component call" ?
I've found some interesting piece of code
<http://xulfr.org/wiki/RessourcesLibs/Fichiers_Sp%E9ciaux> (at the
bottom of the page), but if there's an easy way than creating all the
directories manually, I'll take it.
>> The idea : clicking on a button would load the temporary profile and
>> configure Firefox into its default state, which would, for example,
>> change the apparence (changing buttons with icons only to buttons with
>
> This is... very difficult or impossible to within the same process: Firefox
> code assumes that the profile directory will not change during runtime, and
> many settings, including loaded extensions, preferences, history, etc are
> cached in the process memory.
>
> I think that you'd probably be better off creating a temporary directory and
> launching a new Firefox process with the -profile command line flag pointing
> to that directory (and -no-remote).
Allright. I'd like to avoid to the user the need to launch Firefox this
way, though.
I'm going to explore how the Weave extension works. It seems similar to
what I'm trying to build.
Thank you for the explanation.
> Followup to mozilla.dev.platform, please.
Is it the newsgroup where to ask about JS/XPCOM questions ?
--
kael
firefox -ProfileManager
There you can create a new (virgin) profile, select it, and start
Firefox with it. After a crash, the same command would allow you to
remove the temporary profile and re-enable the "full" one.
What I'm not sure of, however, is how you would know that you were
"about to crash" in order to close Firefox cleanly beforehand.
It is even possible, at least in theory, to restart the browser with a
different profile without -- or without much -- human intervention:
SeaMonkey (at least in the 2.0a1pre version I'm using, with the
extensions I'm using) has a "Tools -> Switch Profile" menu, and if Sm2
can do it, I suppose Fx3 could do it too without too much hardship.
Maybe even Fx2 but I'm less sure about that. This menuitem still
restarts the whole application though, it doesn't contradict what
Benjamin said.
Best regards,
Tony.
--
"... the Mayo Clinic, named after its founder, Dr. Ted Clinic ..."
-- Dave Barry
> But there's no way to use an interface to automatically create all the
> necessary directories by just one "component call" ?
There's only one directory, you don't need to create a complex structure or
anything.
> I'm going to explore how the Weave extension works. It seems similar to
> what I'm trying to build.
It works with the user's normal profile. Certainly no profile-switching
involved at all there.
> Is it the newsgroup where to ask about JS/XPCOM questions ?
This isn't really a JS or XPCOM question. It's a question about the Mozilla
platform in general.
--BDS