Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

How to lock network settings so the proxy cannot be changed?

more options

Hello, I've been searching around and I still can't seem to be able to lock the network settings in Firefox 31.0. I've followed several tutorials including these:

http://kb.mozillazine.org/Locking_preferences http://ip5kb.stbernard.com/webhelp/iPrism/WhatsNew/50SupportFiles/SupportFiles/IP0460.htm http://daxserver.com/lock-preferences-in-firefox/ http://ilias.ca/blog/2005/03/locking-mozilla-firefox-settings/ http://stealthpuppy.com/prepare-mozilla-firefox-for-enterprise-deployment-and-virtualization/

I've tried to edit the channel-prefs.js and create a local-settings.js, but neither of them seem to work.

My channel-prefs.js looks like this: pref("app.update.channel", "release"); pref("general.config.filename", "mozilla.cfg");

And when I created the local-settings.js it looks like this: pref("general.config.obscure_value", 0); pref("general.config.filename", "mozilla.cfg");

and my mozilla.cfg file has the following: // lockPref("browser.startup.homepage", "http://www.eastonpl.org/Index.html"); lockPref("privacy.sanitize.sanitizeOnShutdown", true); lockPref("network.proxy.HTTP", "192.168.0.60"); lockPref("network.proxy.HTTP_port", 8080); lockPref("network.proxy.type", 1);

When I do that I expected it to look like the one example here: http://ip5kb.stbernard.com/webhelp/0460b.jpg

But here is what the Network -> Connection Settings actually looks like: http://i.imgur.com/q0uMMb5.png

So my above mozilla.cfg locks the radio buttons at the top, but I am still able to edit the text boxes with the proxies in it.

how do I get it so the users aren't able to change this proxies?

Thanks.

Hello, I've been searching around and I still can't seem to be able to lock the network settings in Firefox 31.0. I've followed several tutorials including these: http://kb.mozillazine.org/Locking_preferences http://ip5kb.stbernard.com/webhelp/iPrism/WhatsNew/50SupportFiles/SupportFiles/IP0460.htm http://daxserver.com/lock-preferences-in-firefox/ http://ilias.ca/blog/2005/03/locking-mozilla-firefox-settings/ http://stealthpuppy.com/prepare-mozilla-firefox-for-enterprise-deployment-and-virtualization/ I've tried to edit the channel-prefs.js and create a local-settings.js, but neither of them seem to work. My channel-prefs.js looks like this: pref("app.update.channel", "release"); pref("general.config.filename", "mozilla.cfg"); And when I created the local-settings.js it looks like this: pref("general.config.obscure_value", 0); pref("general.config.filename", "mozilla.cfg"); and my mozilla.cfg file has the following: // lockPref("browser.startup.homepage", "http://www.eastonpl.org/Index.html"); lockPref("privacy.sanitize.sanitizeOnShutdown", true); lockPref("network.proxy.HTTP", "192.168.0.60"); lockPref("network.proxy.HTTP_port", 8080); lockPref("network.proxy.type", 1); When I do that I expected it to look like the one example here: http://ip5kb.stbernard.com/webhelp/0460b.jpg But here is what the Network -> Connection Settings actually looks like: http://i.imgur.com/q0uMMb5.png So my above mozilla.cfg locks the radio buttons at the top, but I am still able to edit the text boxes with the proxies in it. how do I get it so the users aren't able to change this proxies? Thanks.

所有回复 (8)

more options

hello chrisharvey137, please leave the channel-prefs.js file untouched, a local-settings.js with the settings you have mentioned is enough...

since the mozilla.cfg file is case sensitive, please see if you can get it to work with the following:

lockPref("network.proxy.http", "192.168.0.60"); 
lockPref("network.proxy.http_port", 8080);
more options

Thanks for the quick response! But it doesn't seem to use the local-settings.js. I placed the file here: C:\Program Files\Mozilla Firefox\defaults\pref

Is there anything else that I need to do to point Firefox to the local-settings.js?

more options

the content of your local-settings.js file looks alright - can you look that it is ANSI encoded (instead of UTF-8)...

more options

When I go to save it in notepad the encoding shows ANSI.

more options

It should matter if the file is UTF-8 or ANSI because there should only be plain ASCII text in the file.

You should however make sure that the file is a .js (JScript) file and not a TXT file with a hidden .txt file extension.

The files may need to have Unix line endings (LF instead of CR/LF) to make it work.

more options

I checked the file and it is a .js, I'm a bit confused about the Unix line ending, could you explain how to do that for me?

Thank you so much for the help!

more options

You can try to use the Scratchpad (Firefox/Tools > Web Developer) to create the files.

It is best to leave the channel-prefs.js file with its default content and not add code to this file.

pref("app.update.channel", "release");

The mozilla.cfg file needs to be in the Firefox program folder and not in a sub folder.

What is the purpose of the mozilla.txt file? Are you using a byte shift (rot-13) on the mozilla.cfg file?

more options

I'm using this site for the byte shift:

http://www.alain.knaff.lu/howto/MozillaCustomization/cgi/byteshf.cgi

And here is where I put the mozilla.cfg file: C:\Program Files\Mozilla Firefox

The mozilla.txt file is what I edit and upload to the above site to get the .cfg file. Should I have the pref that you wrote out in the mozilla.cfg file or the local-settings.js file?

Thank you so much for the help!