On Mon, Jun 23, 2014 at 06:02:02PM +0100, Mick wrote

> Taking this a step further I create additional one-off profile
> directories in /tmp, which are deleted when I reboot (this is a
> laptop), which ensures that tracing between sites does not happen.

  Here is more detail on my approach...

1) Generate a random 8-letter name for a directory with the command

head /dev/urandom | tr -d -c a-z | tail -c 8

   Let's say you got "cjyqsiqd" (without the quotes).

2) mkdir ~/.mozilla/firefox/cjyqsiqd
   (or whatever 8-character string you got)

3) Create directories for a template profile, plus the profiles you want
to use.  I'll call them "profile1", "profile2", etc, but in real life,
you'll want more descriptive names.

mkdir ~/.mozilla/firefox/cjyqsiqd/template
mkdir ~/.mozilla/firefox/cjyqsiqd/profile1
mkdir ~/.mozilla/firefox/cjyqsiqd/profile2
mkdir ~/.mozilla/firefox/cjyqsiqd/profile3
...
mkdir ~/.mozilla/firefox/cjyqsiqd/profilen

4) Create the profiles starting with the template profile.  Note that
there is a good reason for navigating into the profile dirs.  It will
become obvious later.  The command is...

firefox -new-instance -ProfileManager

Create Profile
Next
Enter new profile name: (more intuitive if it matches the directory name)
Choose Folder (Navigate into the corresponding folder before clicking Open)
Open
Exit

Rinse lather repeat for all the other profiles you'll want.

5) For the next step do not delete the template dir, but delete all the
other profile dirs you've just created.  No, this is not a joke.

cd ~/.mozilla/firefox/cjyqsiqd/
rm -rf profile1 profile2 profile3 ... profilen

6) Launch firefox with the template profile...

firefox -new-instance -P template

...and tweak it to your heart's content, keeping in mind what options
your profiles will need.  Install extensions, set font sizes, your
favourite behaviours, tweak the menu bars, set cookie options, etc.  And
make sure to set the browser to open to a home page (more on that
later).  When you're finished, exit Firefox.

7) Copy your template directory to replace the profile directories you
deleted in step 5.  This is a lot easier than doing the same changes in
several directories.  The names will be different depending on what did
in step 3.

cd ~/.mozilla/firefox/cjyqsiqd/
cp -r template profile1
cp -r template profile2
cp -r template profile3
...
cp -r template profilen

8) Open the profiles and do the final customizations for each profile
separately.  The command is

firefox -new-instance -P profilename

The customizing includes stuff like which cookie domain(s) to accept and
which page(s) to open on startup.  And yes, you can get Firefox to open
multiple tabs on startup.  When entering the homepage to open, separate
the pages with pipe signs " | ", e.g...

http://foo.com | http://bar.com | ftp://bad.example.com/data.txt

> Note, you will also need to remove any flash cookies (LSOs) which
> sit in your ~/ and are not deleted, unless you have installed the
> Better Privacy addon.  For a more pedestrian approach:
> 
>  rm -Rf .macromedia/Flash_Player/*

  There also seems to be ~/.adobe directory.  What I do is to create
*FILES* (yes) like so...

touch ~/.adobe
touch ~/.macromedia

  This blocks the creation of directories by that name.  Some idiot sites
will refuse to play videos in that situation.  I click on the Flash
button, and the video displays something like "Error #2046".  I have a
workaround for that, namely a script ~/bin/killflash like so...

#!/bin/bash
rm -rf ~/.adobe
rm -rf ~/.macromedia
sleep 20
rm -rf ~/.adobe
touch ~/.adobe
rm -rf ~/.macromedia
touch ~/.macromedia

  I launch killflash in an xterm, and then click on the video to play.
Note that the video only has to start within the 20-second window.  The
way that linux works, you can delete a file, but any app that has it
open will continue to see it, even though no other apps can.  As soon as
the last filehandle to the file is closed, its space is finally released.

-- 
Walter Dnes <waltd...@waltdnes.org>
I don't run "desktop environments"; I run useful applications

Reply via email to