Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Hii, Can we lock a network preferance in firefox 38.01 or higher version, if then how?

  • 18 tontu
  • 3 am na jafe-jafe bii
  • 14 views
  • i mujjee tontu mooy shilpa123

more options

I want global config file of firefox which control all the available vesion of my firefox and it also lock my network preferance so that no other user can make changes in it.

Thanks in advance Shilpa

I want global config file of firefox which control all the available vesion of my firefox and it also lock my network preferance so that no other user can make changes in it. Thanks in advance Shilpa

Saafara biñ tànn

the mozilla.cfg file should be placed in the same folder as the firefox executable, so in /opt/firefox/ in your case.

Jàng tontu lii ci fi mu bokk 👍 1

All Replies (18)

more options

hi Shilpa, for locking preferences, please refer to the method described in http://kb.mozillazine.org/Locking_preferences

more options

shilpa123 said

I want global config file of firefox which control all the available vesion of my firefox and it also lock my network preferance so that no other user can make changes in it. Thanks in advance Shilpa

Hiii Thanks for reply But this not solve my problem I have Linux mint 17.1 Rebecca, in that default Firefox version 33 is there for that my below config file work perfectly for locking and changing a preferences. I have did changes in vendor-Firefox.js and Firefox.js file

Config file: lockPref("browser.startup.homepage", " "); lockPref("browser.startup.homepage_override", true); lockPref("pref.browser.homepage.disable_button.current_page", true); lockPref("pref.browser.homepage.disable_button.restore_default", true); lockPref("pref.browser.homepage.disable_button.bookmark_page", true); lockPref("network.proxy.type", 1); //lockPref("app.update.auto", false); //disable automatic update //lockPref("app.update.enabled", false); //disable updating Firefox //lockPref("browser.bookmarks.restore_default_bookmarks", false); //lockPref("pref.privacy.disable_button.view_passwords", false); //lockPref("network.proxy.backup.ftp", ""); //lockPref("network.proxy.backup.ftp_port", 0); //lockPref("network.proxy.backup.socks", ""); //lockPref("network.proxy.backup.socks_port", 0); //lockPref("network.proxy.backup.ssl", ""); //lockPref("network.proxy.backup.ssl_port", 0); lockPref("network.proxy.ftp", "172.16.1.71"); lockPref("network.proxy.ftp_port", 3128); lockPref("network.proxy.http", "172.16.1.71"); lockPref("network.proxy.http_port", 3128); lockPref("network.proxy.no_proxies_on", "localhost, 127.0.0.1,172.16.1.0/24"); lockPref("network.proxy.share_proxy_settings", true); lockPref("network.proxy.socks", "172.16.1.71"); lockPref("network.proxy.socks_port", 3128); lockPref("network.proxy.ssl", "172.16.1.71"); lockPref("network.proxy.ssl_port", 3128);


But when I install 38 or 39 version of this file changes wont get affected.

more options

philipp said

hi Shilpa, for locking preferences, please refer to the method described in http://kb.mozillazine.org/Locking_preferences

When I user just a pref option in channel-pref.js or pref.js file it work perfect for firefox 38.01 but with lock-pref option it does not change anything.

more options

you have a .cfg file locking the preferences and a .js file which is used to load the cfg file - where is that .js file located in your case?

more options

Nop But I have tried to make a file where channel-prefs.js get created and try to load it from prefs.js but it give me error that is wont be able to load a mozilla.cfg file but here my confussion is I have many prefs.js file i.e. in /etc/skel and in /opt also so in which exact file I have to load a my mozilla.cfg file without any error.

more options

probably the error is in the mozilla.cfg file - can you make sure that it's saved ANSI character encoded....

more options

sorry but how to do it.....

more options

you can set the encoding in a text editor like notepad++

more options

Did you create a mozilla.cfg file in the Firefox program folder?

Can you post the content of the mozilla.cfg file?

The mozilla.cfg file should start with a comment line (//) because this first line is skipped for security reasons.

more options

I have create a mozilla.cfg in /etc/skel/.mozilla/firefox/mwad0hks.default and a when I fire a command file mozzilla.cfg o/p is: file mozilla.cfg mozilla.cfg: ASCII text

My mozilla.cfg is:

// lockPref("network.proxy.type", 1);


And I have called a mozilla.cfg in channel-prefs.js file Its content is:

/* This Source Code Form is subject to the terms of the Mozilla Public

* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

pref("app.update.channel", "release"); pref("general.config.filename", "mozilla.cfg");


My channel-prefs.js file is in: /opt/firefox/defaults/pref

when I give command file channel-prefs.js its o/p is:

file channel-prefs.js channel-prefs.js: ASCII text


But it give me error that File can not be get read.

more options

Saafara yiñ Tànn

the mozilla.cfg file should be placed in the same folder as the firefox executable, so in /opt/firefox/ in your case.

more options

Hiii

I have move mozilla.cfg file /opt/firefox folder and file reading error has gone but still it is not locking my network-proxy-type option.


Plz Help!!!

more options

Hiii

I add a following code in mozilla.cfg lockPref("browser.startup.homepage", " "); lockPref("browser.startup.homepage_override", true); lockPref("pref.browser.homepage.disable_button.current_page", true); lockPref("pref.browser.homepage.disable_button.restore_default", true); lockPref("pref.browser.homepage.disable_button.bookmark_page", true); lockPref("network.proxy.type", 1);


and in channel-prefs.js and its o/p is: pref("app.update.channel", "release"); pref("general.config.filename", "mozilla.cfg"); pref("pref.browser.homepage.disable_button.current_page", true); pref("pref.browser.homepage.disable_button.restore_default", true); pref("pref.browser.homepage.disable_button.bookmark_page", true);

by this only current page button get lock not other bookmark and restore tab

more options

hi, i don't understand why you put the same content into channel-prefs.js and mozilla.cfg (also, i have no idea if pref.browser.homepage.disable_button.* are even genuine prefs to modify). put to keep it simple, let's just test with one preference to see if the lock works in principle and you can move on from there - the cfg file is quite sensible, one mistake in it will prohibit the whole file from working...

so please for testing purposes put just the following into channel-prefs.js:

pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");

and into mozilla.cfg:

//
lockPref("network.proxy.type", 1);

does this preference shop up as locked in firefox afterwards, when you search in about:config for it?

more options

Thank you for reply I have did this but not check it in about:config; but I can made changes in network proxy type.

more options

It is best to leave the channel-prefs.js alone and create an local-settings.js file instead to specify using mozilla.cfg file.

pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0);

Note that mozilla.cfg should start with a comment line (//) because this first line is skipped for security reasons.

The mozilla.cfg file is evaluated as a JavaScript file with full chrome privileges and thus can contain advanced JavaScript, but this also means that any error in the file will throw an exception and prevents Firefox from starting or from working correctly.

If the mozilla.cfg file is working properly then locked prefs should appear as italic and have Locked in the Status column.

more options

Hiiii

THANK YOU SO MUCH ALL OF YOU!

Finally it solve my problem and everything work prefect now.

more options

Hiii

I have one more doubt but it is not related with Firefox it is related with quota?

Sorry In advance If it inappropriate to ask this question here.

Can we reset a quota for user in Linux, if yes then how?

Thanks in advance. Shilpa