How to lock Firefox's proxy settings for proxy filters

Write tutorials here
There are more tutorials here
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
Level 1
Level 1
Posts: 8
Joined: Tue Feb 15, 2011 7:56 pm

How to lock Firefox's proxy settings for proxy filters

Post by fishin4guitars »

Maybe I'm the only one who doesn't know this, but here goes...

If you use a proxy filter (such as DansGuardian), and have users with a slightly above average technical ability, they can easily get around said filter by using Firefox's proxy settings. This fix remedies this hole.

1) In $HOME/.mozilla/firefox/(random characters).default/, create a file user.js
For example, in my case it's ~/.mozilla/firefox/3ga6boxk.default/
2) In ./user.js, place the text

Code: Select all

lockPref("network.proxy.http", "");
lockPref("network.proxy.http_port", 8080);
lockPref("network.proxy.type", 1);
lockPref("network.proxy.share_proxy_settings", true);
Of course, you would replace with your proxy's ip address, and 8080 with the port your filter uses.

3) run

Code: Select all

sudo chmod 644 ./user.js
sudo chown root ./user.js
sudo chgrp root ./user.js
This changes the permissions to -rw-r--r--, and the owner and owning group to root so that, in case of an even more technical user, they can't edit the file.
You could also put a universal user.js file in a convenient location not in the users home directory, and place a link called user.js in its place in the (random characters).default directory.

I use this on Firefox 4, but it should work with earlier versions as well.
32 bit Linux Mint 10 Gnome

Favorite Distro? Arch Linux

Post Reply

Return to “Tutorials”