Open Bug 330590 Opened 17 years ago Updated 6 months ago

lockPref() in .cfg does not completely locks preferences

Categories

(Firefox :: Settings UI, defect)

2.0 Branch
x86
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: modesser, Unassigned)

References

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060313 Debian/1.5.dfsg+1.5.0.1-4 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060315 Firefox/1.6a1

If a simple pref is locked (ie: browser.history_expire_days), it behaves as expected : cannot alter value.
But if a UI element in the pref window is able to change the value of another element, then locking may be disabled with a click or two.

Reproducible: Always

Steps to Reproduce:
1. Add 'pref("general.config.filename","myconf.cfg");' and change value of general.config.obscure_value to 0 in $INSTALLDIR/greprefs/all.js
2. Create $INSTALLDIR/myconf.cfg that contains
lockPref("network.proxy.http_port", 80);
lockPref("network.proxy.http", "proxy.home.tld");
lockPref("network.proxy.no_proxies_on", "localhost, 127.0.0.1, *.home.tld");
lockPref("browser.startup.homepage", "http://home.tld/");
lockPref("app.update.enabled", false); 
lockPref("browser.history_expire_days",11);
3. Start Firefox and go to Edit->Preferences

Actual Results:  
Locked preferences have their UI element grayed as expected, with their specified values correctly set. But a click on "Use current page" or "Use blank page" button changes home page value.
For the proxy settings, If I click on "Direct connexion to the internet" then again to "Manual proxy settings", form fields are re-enabled.
Simple setting (like history expiration) are not affected.

Expected Results:  
Every setting element should be disabled, without any possibility to change the values.
This is a question of UI, but the preferences don't really change, do they?
(In reply to comment #1)
> This is a question of UI, but the preferences don't really change, do they?
> 

Clicking twice on "Use blank page" sets the home page to "about:blank". The setting is not saved for the current browsing session, but it _is_ saved in prefs.js. Therefore, if the lock on browser.startup.homepage is released, the loaded URL on startup will be about:blank.
This code is to be added at the beginning of methods setHomePageToCurrentPage(), setHomePageToBookmark(), setHomePageToDefaultPage() and setHomePageToBlankPage() in file chrome://browser/content/preferences/general.js
This code is to be added at the beginning of methods setHomePageToCurrentPage(), setHomePageToBookmark(), setHomePageToDefaultPage() and setHomePageToBlankPage() in file chrome://browser/content/preferences/general.js
This is also an issue in
Mozilla/5.0 (X11; U; Linux x86_64; es-CO; rv:1.9.0.4) Gecko/2008121822 Gentoo Firefox/3.0.4
Version: unspecified → 2.0 Branch
There are three additional preferences that when set and locked disable those buttons.

It's not tied to the locking of the homepage:

http://mxr.mozilla.org/mozilla-central/source/browser/components/preferences/main.xul#76 pref.browser.homepage.disable_button.current_page
pref.browser.homepage.disable_button.bookmark_page
pref.browser.homepage.disable_button.restore_default

If you set these three preferences to true and then lock the preferences, they will be disabled.

If you want to prevent the changes of the proxy preferences, you need to lock

network.proxy.type as well.

I'm going to mark this bug as INVALID.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.