Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do you start Firefox in Linux to use a pre-prepared profile?

862 views
Skip to first unread message

MWBradburne

unread,
Oct 26, 2015, 9:11:27 PM10/26/15
to mozilla-sup...@lists.mozilla.org
I have documented the two dozen steps it takes to set up Firefox the
way I want it set up every time it's invoked on Linux but I'm having
trouble saving that information so that firefox starts up the same
*every* time (no matter what happens during the firefox session).

Step 0 is deleting the ~/.mozilla hierarchy.
Steps 1 to 21 are the steps to set up Firefox the way I want.
Step 23 is to back up the profile directory to a safe place.
And step 24 creates a script that copies the backup back, and
then starts Firefox.

It's step 23 and 24 that I need advice on because it's not working
even though I thought I had the logic all figured out.

23. Exit Firefox and copy the profile directory to a safe place:
$ killall firefox
$ mkdir ~/.firefox_profile_template
$ cp -r ~/.mozilla/firefox/#####.Default User/firefox ~/.firefox_profile

24. Modify the ffox script that starts Firefox:
#!/bin/bash
cp -r ~/.firefox_profile /ramtmp/firefox
/usr/lib/firefox/firefox -new-instance -P /ramtmp/firefox &
exit 0

I'm sure something is wrong in the two steps above.

What would back up and then copy a full-configured Firefox (two dozen steps!)
and then invoke Firefox, always obtaining those two dozen customization steps?

MWBradburne

unread,
Oct 26, 2015, 9:16:44 PM10/26/15
to mozilla-sup...@lists.mozilla.org
On Mon, 26 Oct 2015 20:10:43 -0500, MWBradburne wrote:

> What would back up and then copy a full-configured Firefox (two dozen steps!)
> and then invoke Firefox, always obtaining those two dozen customization steps?

There was a minor set of typos in the backup sequence I listed
which was only in the usenet post and isn't the problem I'm running
into.

The problem I'm running into is that, once I have Firefox all set up
(dozens of tweaks, many of which are in about:config and settings),
I don't know how to back up and then restart Firefox so that only
that configuration is used *every time*.

How would you ensure Firefox starts *exactly* as you want it to start
given I already have a "ffox" script which calls Firefox any way I
want it to and which can copy any backed up files before it calls
Firefox.

Richard

unread,
Oct 26, 2015, 9:32:54 PM10/26/15
to mozilla-sup...@lists.mozilla.org


> Date: Monday, October 26, 2015 20:10:43 -0500
> From: MWBradburne <MWBra...@cisco.com>
>
> I have documented the two dozen steps it takes to set up Firefox
> the way I want it set up every time it's invoked on Linux but I'm
> having trouble saving that information so that firefox starts up
> the same *every* time (no matter what happens during the firefox
> session).
>
> Step 0 is deleting the ~/.mozilla hierarchy.
> Steps 1 to 21 are the steps to set up Firefox the way I want.
> Step 23 is to back up the profile directory to a safe place.
> And step 24 creates a script that copies the backup back, and
> then starts Firefox.
>
> It's step 23 and 24 that I need advice on because it's not working
> even though I thought I had the logic all figured out.
>
> 23. Exit Firefox and copy the profile directory to a safe place:
> $ killall firefox
> $ mkdir ~/.firefox_profile_template
> $ cp -r ~/.mozilla/firefox/#####.Default User/firefox
> ~/.firefox_profile
>
> 24. Modify the ffox script that starts Firefox:
> #!/bin/bash
> cp -r ~/.firefox_profile /ramtmp/firefox
> /usr/lib/firefox/firefox -new-instance -P /ramtmp/firefox &
> exit 0
>
> I'm sure something is wrong in the two steps above.
>
> What would back up and then copy a full-configured Firefox (two
> dozen steps!) and then invoke Firefox, always obtaining those two
> dozen customization steps?
>

What isn't working - what issues/problems are you seeing?

A couple things that I see include the embedded space in:

cp -r ~/.mozilla/firefox/#####.Default User/firefox

You'll need to quote that path so that that space is preserved.

I would also recommend using "-pr", rather than just "-r", so you
preserve dates, etc.

You create the directory "~/.firefox_profile_template", but then
copy the profile to/from "~/.firefox_profile". That won't break
anything, but it's a spurious step.

You don't indicate your linux distribution, but the default location
for the firefox binary on RHEL/Centos (and I suspect Fedora) is
"/usr/bin/firefox", so make certain you're calling the correct
binary.


»Q«

unread,
Oct 26, 2015, 10:38:54 PM10/26/15
to mozilla-sup...@lists.mozilla.org
In
<news:mailman.4770.144590828...@lists.mozilla.org>,
MWBradburne <MWBra...@cisco.com> wrote:

> It's step 23 and 24 that I need advice on because it's not working
> even though I thought I had the logic all figured out.
>
> 23. Exit Firefox and copy the profile directory to a safe place:
> $ killall firefox
> $ mkdir ~/.firefox_profile_template
> $ cp -r ~/.mozilla/firefox/#####.Default User/firefox ~/.firefox_profile
>
> 24. Modify the ffox script that starts Firefox:
> #!/bin/bash
> cp -r ~/.firefox_profile /ramtmp/firefox
> /usr/lib/firefox/firefox -new-instance -P /ramtmp/firefox &
> exit 0
>
> I'm sure something is wrong in the two steps above.

In (24) you are invoking firefox with a profile directory, not a
profile name, so you need the -profile option rather than the -P
option. That's all I can add to Richard's suggestions.






Good Guy

unread,
Oct 26, 2015, 10:56:41 PM10/26/15
to mozilla-sup...@lists.mozilla.org
How many different profiles have you got on your machine?

If you have only one profile then any changes you make to that profile will always load by default.  If you have multiple profiles then you need to read this article:

<https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles#w_use-the-selected-profile-without-asking-at-startup>

I suggest read the entire page because it says something about starting in terminal using something like:

firefox -P

It also says something about how to handle multiple profiles and how to start a specific profile of your choice at start-up.


--------------00060608010905060209

Good Guy

unread,
Oct 26, 2015, 11:12:52 PM10/26/15
to mozilla-sup...@lists.mozilla.org
On 27/10/15 01:10, MWBradburne wrote:
OK in Linux you need to start firefox in Terminal by typing:

firefox -P

Then you get something like this:

New-Profile in FF

The above picture is self explanatory so good luck.


--------------08080206050601050806

MWBradburne

unread,
Oct 27, 2015, 12:38:02 AM10/27/15
to mozilla-sup...@lists.mozilla.org
On Tue, 27 Oct 2015 01:32:14 +0000, Richard wrote:

> What isn't working - what issues/problems are you seeing?

What isn't working is that Firefox is starting up as if it's the first
time Firefox ever ran. That is, the two dozen changes I made are not
being used, even though clearly the backed up profile is being copied
before Firefox starts back up.

So, *all* my two-dozen changes are lost.

> A couple things that I see include the embedded space in:
> cp -r ~/.mozilla/firefox/#####.Default User/firefox

I was trying to simplify things by modifying the code that I
typed into the Usenet post. The space is meaningless because I
*never* create a file name with a space in it (for the obvious
reasons), whether on Linux or Windows or Android or whatever.

> You'll need to quote that path so that that space is preserved.

I'll post separately the *exact* commands, but the space isn't
the problem I don't think. However, the *syntax* of the way I
start up Firefox could very well be the problem, and that syntax
may be character sensitive.

> I would also recommend using "-pr", rather than just "-r", so you
> preserve dates, etc.

Thanks for that suggestion.

I have added the "p" to preserve dates. I'll post all 24 steps
separately so that you can see the exact commands used (but I didn't
want to complicate the question).


> You create the directory "~/.firefox_profile_template", but then
> copy the profile to/from "~/.firefox_profile". That won't break
> anything, but it's a spurious step.

That was a typo.
I was trying to simplify the Usenet post, so, I made a typo.
I'll post the actual 24 commands in the next post so you can see
exactly what I did.

> You don't indicate your linux distribution, but the default location
> for the firefox binary on RHEL/Centos (and I suspect Fedora) is
> "/usr/bin/firefox", so make certain you're calling the correct
> binary.

It's Kubuntu.
Firefox is never called directly. It's called by a shell script
named "ffox".

$ which firefox
RETURNS nothing.

$ which ffox
RETURNS /usr/local/bin/ffox

$ cat `!$`
RETURNS the following /usr/local/bin/ffox
#!/bin/bash
cp -pr ~/.firefox_profile_template/. /mytmp/firefox
# /usr/lib/firefox/firefox -new-instance -P xxx &
/usr/lib/firefox/firefox -P /mytmp/firefox &
exit 0

I'll post separately the procedure I used to install Firefox into
that location since I just typed it up a couple of days ago when
I most recently installed the latest version of Firefox.

MWBradburne

unread,
Oct 27, 2015, 12:58:15 AM10/27/15
to mozilla-sup...@lists.mozilla.org
On Mon, 26 Oct 2015 23:37:22 -0500, MWBradburne wrote:

> I'll post separately the procedure I used to install Firefox into
> that location since I just typed it up a couple of days ago when
> I most recently installed the latest version of Firefox.

Here are the steps used to install Firefox, and to set it up.
============================================================================
How to install Firefox on Kubuntu 14.04:
============================================================================
0. Download and unpack the Firefox binaries:
$ cd /tmp/
$ wget https://download.mozilla.org/?product=firefox-41.0.2-SSL&os=linux64&lang=en-US
This creates a file named "/tmp/firefox-*.tar.bz2".
Unpack Firefox binaries:
$ tar xjf firefox-*.tar.bz2
This creates a directory named "firefox".
1. Find where firefox currently lives:
$ which firefox
/usr/bin/firefox
$ ls -l /usr/bin/firefox
lrwxrwxrwx 1 root root 25 Nov 27 03:53 /usr/bin/firefox -> ../lib/firefox/firefox.sh
2. Get rid of the old Firefox:
$ sudo rm -rf /usr/lib/firefox/
3. Put the new Firefox in place:
$ sudo mv /tmp/firefox /usr/lib/.
4. Check your work:
$ /usr/lib/firefox/firefox --version
(process:28565): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Mozilla Firefox 41.0.2
5. Start up Firefox to test that it's working:
$ /usr/lib/firefox/firefox &
6. Kill Firefox and modify the ffox script to point to this new Firefox
$ killall firefox
$ sudo vi /usr/local/bin/ffox
#!/bin/bash
/usr/lib/firefox/firefox -new-instance -P xxx &
exit 0
7. Test ffox to see if it's working:
$ ffox
This brings up Firefox.
============================================================================
How to set up Firefox to always have the same settings on Kubuntu 14.04:
============================================================================
0. Remove all Firefox profiles and create a RAM file system for profiles:
$ rm -rf $HOME/.mozilla/
$ sudo vi /etc/fstab
tmpfs /mytmp tmpfs auto,nodev,nosuid,size=70% 0 0
$ sudo mkdir -p /mytmp && sudo chmod 1777 /mytmp && sudo mount /mytmp
$ mkdir /mytmp/firefox/
1. Start Firefox to make sure it comes up:
$ /usr/lib/firefox/firefox &
Kill Firefox once you've done that test.
2. Start Firefox with a script intended to create a new profile:
$ ffox
Where /usr/local/bin/ffox is:
#!/bin/bash
/usr/lib/firefox/firefox -new-instance -P xxx &
exit 0
3. The Choose User Profile form comes up where you have to press:
Create Profile > Next > Choose Folder > Create Folder > /mytmp/firefox
4. Disable all plugins (the combination of which can fingerprint you):
OpenH264 Codec, Shockwave Flash, Gnome Shell Integration, iTunes Application Detector
5. Load privacy extensions and turn off automatic updates:
NOTE: See step 21 first (in case the addons add URLs you need to remove).
Tools > Addons > Extensions > Settings > Update Addons Automatically = off
Tools > Addons > Extensions > Settings > Install Addon from file:
CanvasBlocker
CloseButton
Ghostery.xpi resource://firefox-at-ghostery-dot-com/ghostery/data/options.html
NoScript
RandomAgentSpoofer.xpi

Press the web page for each one to turn automatic updates off:
Tools > Addons > Extensions > Settings > {select the addon & then press More}
6. Set your desired preferences:
Edit > Preferences > General > Always check if Firefox is your default browser = off
Edit > Preferences > General > When Firefox Starts = Show a blank page
Edit > Preferences > General > Downloads = Always ask me where to save files
Edit > Preferences > Search > Provide search suggestions = off
Edit > Preferences > Search > Default Search Engine = DuckDuckGo
Edit > Preferences > Search > One-click search engines = (turn all off)
Edit > Preferences > Content > no changes
Edit > Preferences > Applications > no changes
Edit > Preferences > Privacy > History > Firefox will = never remember history
Edit > Preferences > Privacy > Location Bar > suggest History = off
Edit > Preferences > Privacy > Location Bar > suggest Bookmarks = off
Edit > Preferences > Privacy > Location Bar > suggest Open tabs = off
Edit > Preferences > Security > General > Block reported attack sites = no
Edit > Preferences > Security > General > Block reported web forgeries = no
Edit > Preferences > Sync > no changes
Edit > Preferences > Advanced > General > no changes
Edit > Preferences > Advanced > Data Choices > Enable Firefox Health Report = no
Edit > Preferences > Advanced > Data Choices > Enable Crash Reporter = no
Edit > Preferences > Advanced > Network > no changes
Edit > Preferences > Advanced > Update > Firefox updates = Never check for updates
Edit > Preferences > Advanced > Update > Automatically update > Search engines = no
Edit > Preferences > Advanced > Certificates > Requests > Query OCSP servers = no
7. Customize your firefox look and feel as desired:
Hamburger > Customize > (drag and drop icons as needed, e.g., CloseButton).
8. Customize your tabs look and feel as desired:
Control+t > Gear > Show your top sites = off (include suggested sites = off)
Control+t > Gear > Show blank page = on
9. Bear in mind that Firefox reads preferences in the following order:
a. about:config changes
b. prefs.js ($HOME/.mozilla/firefox/########.Default User/prefs.js)
c. user.js
For example:
user_pref("browser.chrome.site_icons", false); // Don't show bookmark icons
10. Opt out of the spying, once a day, on your extensions:
Set about:config extensions.getAddons.cache.enabled = false
11. Filter for "safebrowsing" and set all syncs to false and set all the string values to null:
about:config services.sync.prefs.sync.browser.safebrowsing.enabled;false
about:config services.sync.prefs.sync.browser.safebrowsing.malware.enabled;false
about:config browser.safebrowsing.downloads.remote.enabled;false
about:config browser.safebrowsing.downloads.enabled;false
Remove:
about:config browser.safebrowsing.appRepURL;https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%
about:config browser.safebrowsing.gethashURL;https://safebrowsing.google.com/safebrowsing/gethash?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2
about:config browser.safebrowsing.id;navclient-auto-ffox
about:config browser.safebrowsing.malware.reportURL;https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=
about:config browser.safebrowsing.reportMalwareMistakeURL;https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=
about:config browser.safebrowsing.reportPhishMistakeURL;https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=
about:config browser.safebrowsing.reportPhishURL;https://%LOCALE%.phish-report.mozilla.com/?hl=%LOCALE%&url=
about:config browser.safebrowsing.updateURL;https://safebrowsing.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2&key=%GOOGLE_API_KEY%
about:config browser.trackingprotection.gethashURL;https://tracking.services.mozilla.com/gethash?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2
about:config browser.trackingprotection.updateURL;https://tracking.services.mozilla.com/downloads?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2

12. Disable DOM storage
about:config dom.storage.enabled;false
13. Disable referrer headers
about:config network.http.sendSecureXSiteReferrer;false
14. Disables WebRTC, which can leak your IP if you are behind a VPN
about:config media.peerconnection.enabled = false
15. Double disable WebRTC
about:config media.peerconnection.turn.disable = true
16. Privacy Tracking:
about:config privacy.trackingprotection.enabled = true
17. Disable geolocation
about:config geo.enabled = false
18. Disable javascript:
about:config javascript.enabled;false
about:config services.sync.prefs.sync.javascript.enabled;false
19. I'm not sure what to do about the useragent.site_specific_overrides:
about:config general.useragent.site_specific_overrides;false
20. Tell Firefox to take hosts file changes immediately:
about:config browser.cache.check_doc_frequency;1
0 (check once per session),
1 (check every time the page is accessed no matter what) <use this
2 (never check no matter what),
3 (check when the cached copy of the page says it might be out of date). <default
21. Remove any web sites that will be notified if you click a button:
NOTE: Some of these may come from the addons so you might want to do this first:
about:config (search for "http") and you'll find dozens, for example:
about:config dom.mozApps.signed_apps_installable_from;https://marketplace.firefox.com
about:config gecko.handlerService.schemes.irc.0.uriTemplate;https://www.mibbit.com/?url=%s
about:config gecko.handlerService.schemes.mailto.0.uriTemplate;https://compose.mail.yahoo.com/?To=%s
about:config gecko.handlerService.schemes.webcal.0.uriTemplate;https://30boxes.com/external/widget?refer=ff&url=%s
about:config geo.wifi.uri;https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_API_KEY%
22. Save the current changes (prefs.js) to a safe "user.js" file:
??? how do we do this best ???
23. Exit Firefox and copy the profile directory to a safe place:
$ killall firefox
$ mkdir ~/.firefox_profile_template
$ cp -r /mytmp/firefox ~/.firefox_profile_template/.

WIP: Maybe I should figure out how to put it all into a "user.js" file?
24. Modify the ffox script that starts Firefox:
#!/bin/bash
cp -pr ~/.firefox_profile_template/. /mytmp/firefox
/usr/lib/firefox/firefox -new-instance -P xxx &
exit 0
============================================================================

MWBradburne

unread,
Oct 27, 2015, 1:09:44 AM10/27/15
to mozilla-sup...@lists.mozilla.org
On Tue, 27 Oct 2015 02:54:32 +0000, Good Guy wrote:

> How many different profiles have you got on your machine?

Just the one profile.
But I don't want it ever *changing* once I have set it up.
So that why I set it up, and then copy that setup.
Then, each time I invoke Firefox, I just want it to use that copy.

Good Guy

unread,
Oct 27, 2015, 1:13:10 AM10/27/15
to mozilla-sup...@lists.mozilla.org
I think you are making things difficult for you.

There is no need to install Firefox from the compressed bundle from the Mozilla website. To install Firefox in Kubuntu, just run the Firefox Installer - Search "Firefox" from the K menu and it will come up. This will install Firefox automatically.

If that doesn't work, which it should, just install the firefox package. This can be done by searching "Firefox" in Muon, or opening a terminal and running sudo apt-get install firefox.

Source: AskUbuntu
--------------07030306040905070003

MWBradburne

unread,
Oct 27, 2015, 7:04:56 AM10/27/15
to mozilla-sup...@lists.mozilla.org
On Tue, 27 Oct 2015 05:09:33 +0000, Good Guy wrote:

> There is no need to install Firefox from the compressed bundle from the
> Mozilla website. To install Firefox in Kubuntu, just run the Firefox
> Installer - Search "Firefox" from the K menu and it will come up. This
> will install Firefox automatically.
>
> If that doesn't work, which it should, just install the |firefox|
> package. This can be done by searching "Firefox" in Muon, or opening a
> terminal and running |sudo apt-get install firefox|.

The problem with the distribution Firefox is twofold.
1. A package distribution may be older than what's available today
2. The distributor (in this case, canonical), makes a mess of it

For example, I have to always add the additional step of deleting the
"distribution" hierarchy that is *added* to the distribution by the
distributor (/usr/lib/firefox/distribution/).

Who knows what else the distributor has added that isn't Firefox?

MWBradburne

unread,
Oct 27, 2015, 7:59:13 AM10/27/15
to mozilla-sup...@lists.mozilla.org
On Mon, 26 Oct 2015 21:37:02 -0500, Q wrote:

> In (24) you are invoking firefox with a profile directory, not a
> profile name, so you need the -profile option rather than the -P
> option. That's all I can add to Richard's suggestions.

I agree with you that I'm probably invoking Firefox wrong.
So that's why I mainly asked how to properly do step 24.

My goal is simply to start Firefox with a known pre-set setup,
where any changes to that setup that Firefox subsequently makes
without my knowledge are gone when I restart Firefox (or reboot).

Is this the correct syntax yet for step 24?

Steps 1-22 (set up Firefox the way you like).
23. Exit Firefox and copy the profile directory to a safe place:
$ killall firefox
$ mkdir ~/.firefox_profile_template
$ cp -r /mytmp/firefox ~/.firefox_profile_template/.

24. Modify the ffox script that starts Firefox:
#!/bin/bash
cp -pr $HOME/.firefox_profile_template/firefox/ /mytmp/.
/usr/lib/firefox/firefox -new-instance -profile /mytmp/firefox &
exit 0

It seems to work now in that my pre-prepared profile seems to be
read. If this is fine, then all I need to do is figure out how to
put all my changes into a user.js file that isn't ever overwritten.

»Q«

unread,
Oct 27, 2015, 11:02:47 AM10/27/15
to mozilla-sup...@lists.mozilla.org
In
<news:mailman.4800.144594714...@lists.mozilla.org>,
MWBradburne <MWBra...@cisco.com> wrote:

> On Mon, 26 Oct 2015 21:37:02 -0500, Q wrote:
>
> > In (24) you are invoking firefox with a profile directory, not a
> > profile name, so you need the -profile option rather than the -P
> > option. That's all I can add to Richard's suggestions.
>
> I agree with you that I'm probably invoking Firefox wrong.
> So that's why I mainly asked how to properly do step 24.
>
> My goal is simply to start Firefox with a known pre-set setup,
> where any changes to that setup that Firefox subsequently makes
> without my knowledge are gone when I restart Firefox (or reboot).
>
> Is this the correct syntax yet for step 24?
>
> Steps 1-22 (set up Firefox the way you like).
> 23. Exit Firefox and copy the profile directory to a safe place:
> $ killall firefox
> $ mkdir ~/.firefox_profile_template
> $ cp -r /mytmp/firefox ~/.firefox_profile_template/.
>
> 24. Modify the ffox script that starts Firefox:
> #!/bin/bash
> cp -pr $HOME/.firefox_profile_template/firefox/ /mytmp/.
> /usr/lib/firefox/firefox -new-instance -profile /mytmp/firefox &
> exit 0
>
> It seems to work now in that my pre-prepared profile seems to be
> read.

That looks ok to me.

> If this is fine, then all I need to do is figure out how to
> put all my changes into a user.js file that isn't ever overwritten.

Once you've got all the changes made in steps 1-22 and have exited
Firefox, prefs.js contains all the settings you want -- you could just
copy it to user.js, and Firefox won't modify user.js. OTOH, you've
also got a backup copy of the entire profile which is never touched by
Firefox, so you could just clobber /mytmp/firefox and then copy the
backup to /mytmp/firefox each time you want to start Firefox.

In case you want to lock some preferences system-wide (not for just this
one profile), see <http://kb.mozillazine.org/Locking_preferences>.

MWBradburne

unread,
Oct 27, 2015, 3:38:44 PM10/27/15
to mozilla-sup...@lists.mozilla.org
On Tue, 27 Oct 2015 10:01:02 -0500, »Q« wrote:

))Q(( <box...@gmx.net> wrote in message
mailman.4764.144595816...@lists.mozilla.org

> In case you want to lock some preferences system-wide (not for just this
> one profile), see <http://kb.mozillazine.org/Locking_preferences>.

That's extremely interesting, so thank you for pointing that out!
http://kb.mozillazine.org/Locking_preferences

Apparently you add "lockPref" to a /usr/lib/firefox/mozilla.cfg file
in your firefox installation hierarchy to lock a preference in place!

STARTING WITH:
about:config dom.storage.enabled;false

You can put that into prefs.js or user.js as:
user_pref("dom.storage.enabled", false);

But, to lock it, you put it in mozilla.cfg as:
//
lockPref("dom.storage.enabled", false); to lock it in place!

STARTING WITH:
about:config dom.storage.enabled;false

You can put that into prefs.js or user.js as:
user_pref("dom.storage.enabled", false);

But, to lock it, you put it in as:
//
lockPref("dom.storage.enabled", false);

So, it appears this is the sequence:
0. Decide which prefs you wish to lock.
1. Put them in /usr/lib/firefox/mozilla.cfg
e.g.,
//
lockPref("dom.storage.enabled", false); to lock it in place!
2. Create /usr/lib/firefox/defaults/pref/local-settings.js
Containing these two lines:
pref("general.config.obscure_value", 0); // needed if not ROT-13
pref("general.config.filename", "mozilla.cfg"); load /usr/lib/firefox/mozilla.cfg

3. Now when you go to about:config, that line will be in italic!
user_pref("/dom.storage.enabled/", /false/);

MWBradburne

unread,
Oct 27, 2015, 4:02:26 PM10/27/15
to mozilla-sup...@lists.mozilla.org
On Tue, 27 Oct 2015 14:29:06 -0500, MWBradburne wrote:

> That's extremely interesting, so thank you for pointing that out!
> http://kb.mozillazine.org/Locking_preferences

Given your helpful information on locking preferences, I see there are at
least three different ways to lock preferences in Firefox, each of which
has pros and cons, and other ramifications.

1. Put all your preferences into a user.js file in your profile directory:
http://kb.mozillazine.org/User.js_file
a. Here is how to set a specific preference:
about:config dom.storage.enabled;false
b. To lock that preference, you can add it to a user.js file:
user_pref("dom.storage.enabled", false);
c. Where the user.js file can reside in the idiotic location:
/$HOME/.mozilla/firefox/abcdefgh.default/ <<== idotic naming convention
d. It has the same syntax as the prefs.js file:
user_pref("dom.storage.enabled", false);
f. Note that most settings are NOT in the prefs.js, so, this won't work:
grep "dom.storage.enabled" prefs.js >> user.js

2. Put a hard lock on your preferences so it can't be changed in about:config:
http://kb.mozillazine.org/Locking_preferences
a. Here is how to set a specific preference:
about:config dom.storage.enabled;false
b. To lock it, you can put it in a mozilla.cfg file as:
//
lockPref("dom.storage.enabled", false);
c. The mozilla.cfg file resides here but it never read:
/usr/lib/firefox/mozilla.cfg
d. Unless you tell firefox to read the mozilla.cfg file here:
/usr/lib/firefox/defaults/pref/local-settings.js
e. By putting these lines in the local-settings.js file:
pref("general.config.obscure_value", 0); // needed if not ROT-13
pref("general.config.filename", "mozilla.cfg"); load /usr/lib/firefox/mozilla.cfg
f. A subsequent about:config shows that preference in italic as locked:
/dom.storage.enabled;false/

3. Just replace the entire profile directory upon each Firefox invocation:
#!/bin/bash
rm -rf /mytmp/firefox
cp -pr $HOME/.firefox_profile_template/firefox/ /mytmp/.
/usr/lib/firefox/firefox -new-instance -profile /mytmp/firefox &
exit 0

The advantage of the (1) user.js method is that it's easy, but, a
disadvantage is that the user.js can be overwritten rather easily by
accident (and it covers nothing else).

The advantage of the (2) mozilla.cfg method is that every user gets the
same preferences, and, they're locked so that about:config can't change
them. The only disadvantage is that it only covers preferences.

The advantage of the (3) profile-replacement method is that the pristine
profile is never messed with, and it's really fast because it's in a
tmp file system and it deletes all your changes upon every invocation
so you always start exactly where you want on more than just preferences.

MWBradburne

unread,
Oct 27, 2015, 5:14:54 PM10/27/15
to mozilla-sup...@lists.mozilla.org
On Mon, 26 Oct 2015 23:57:35 -0500, MWBradburne wrote:

> Here are the steps used to install Firefox, and to set it up.

Here is a summary of the new steps, thanks to everyone.
Any suggestions are welcome, but it's working now.
============================================================================
How to set up Firefox to always have the same settings on Kubuntu 14.04:
============================================================================
0. Remove all Firefox profiles and create a RAM file system for profiles:
$ rm -rf $HOME/.mozilla/
$ sudo vi /etc/fstab
tmpfs /mytmp tmpfs auto,nodev,nosuid,size=70% 0 0
$ sudo mkdir -p /mytmp && sudo chmod 1777 /mytmp && sudo mount /mytmp
$ mkdir /mytmp/firefox/
1. Start Firefox with a new profile in a fast ramfs:
$ ffox
Where /usr/local/bin/ffox is:
#!/bin/bash
/usr/lib/firefox/firefox -new-instance -P xxx &
exit 0
2. The Choose User Profile form comes up where you have to press:
Create Profile > Next > Choose Folder > Create Folder > /mytmp/firefox
3. Start Firefox and make a few mandatory settings:
$ ffox
FROM: about:config: layout.css.devPixelsPerPx;-1.0
CHTO: about:config: layout.css.devPixelsPerPx;0.8
$ cp -pr /mytmp/firefox ~/.firefox_profile_template/.
24. Modify the ffox script that starts Firefox:
#!/bin/bash
cp -pr $HOME/.firefox_profile_template/firefox/ /mytmp/.
/usr/lib/firefox/firefox -new-instance -profile /mytmp/firefox &
exit 0
============================================================================
Note: Of the three methods of protecting a Firefox setup, this is only one.

»Q«

unread,
Oct 27, 2015, 8:38:30 PM10/27/15
to mozilla-sup...@lists.mozilla.org
In
<news:mailman.4790.144598049...@lists.mozilla.org>,
MWBradburne <MWBra...@cisco.com> wrote:

> 11. Filter for "safebrowsing" and set all syncs to false and
> set all the string values to null: about:config

That prevents tracking protection, but...


> 16. Privacy Tracking:
> about:config privacy.trackingprotection.enabled = true

.... you seem to want tracking protection.

MWBradburne

unread,
Oct 28, 2015, 3:05:27 AM10/28/15
to mozilla-sup...@lists.mozilla.org
On Tue, 27 Oct 2015 19:34:52 -0500, »Q« wrote:

>> browser.trackingprotection.gethashURL;https://
tracking.services.mozilla.com/gethash?client=SAFEBROWSING_ID&appver=%
VERSION%&pver=2.2
>> about:config
>> browser.trackingprotection.updateURL;https://
tracking.services.mozilla.com/downloads?client=SAFEBROWSING_ID&appver=%
VERSION%&pver=2.2
>
> That prevents tracking protection, but...
>
>
>> 16. Privacy Tracking:
>> about:config privacy.trackingprotection.enabled = true
>
> .... you seem to want tracking protection.

I'm glad you brought that up, Q, because I was confused myself about
how to set those switches. I don't want *any* protection that requires
the protection to spy on me in the first place.

I got that setting from here, but I'm gonna switch it to "false" now:
https://thetinhat.com/blog/2015/02/15/lightweight-firefox-privacy.html

Thanks for looking at the specific settings, even though that wasn't
the reason for the original question, I much appreciate your advice!
0 new messages