Closed
Bug 413437
Opened 17 years ago
Closed 17 years ago
Locking homepage buttons to disable them is broken (again)
Categories
(Firefox :: Settings UI, defect, P1)
Firefox
Settings UI
Tracking
()
RESOLVED
FIXED
Firefox 3 beta4
People
(Reporter: mkaply, Assigned: dev)
Details
(Keywords: regression)
Attachments
(1 file, 4 obsolete files)
2.07 KB,
patch
|
Details | Diff | Splinter Review |
Locking the preferences:
pref.browser.homepage.disable_button.current_page
pref.browser.homepage.disable_button.bookmark_page
pref.browser.homepage.disable_button.restore_default
Is supposed to disable the three buttons on the main page of preferences. It is not.
To test this, add these two preferences to your system:
pref("general.config.filename","mozilla.cfg");
pref("general.config.obscure_value", 0);
And create a file called mozilla.cfg in the same directory as the EXE:
lockPref("pref.browser.homepage.disable_button.current_page", true);
lockPref("pref.browser.homepage.disable_button.bookmark_page", true);
lockPref("pref.browser.homepage.disable_button.restore_default", true);
On trunk, two of the buttons disabled. On 1.8 branch, only one of the buttons disable.
This is a major bug for enterprise
Updated•17 years ago
|
Flags: blocking-firefox3?
Keywords: helpwanted,
regression
Updated•17 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
Assignee | ||
Comment 1•17 years ago
|
||
I'm not sure if this would constitute as a workaround or not. Never the less, it does work properly.
Attachment #302603 -
Flags: review?(mano)
Assignee | ||
Comment 2•17 years ago
|
||
Michael Kaply: I'm pretty sure you're aware of this - but I figured I might as well say it... Your mozilla.cfg file must begin with "//". So in essence, your demonstration file should look like this:
//
lockPref("pref.browser.homepage.disable_button.current_page", true);
lockPref("pref.browser.homepage.disable_button.bookmark_page", true);
lockPref("pref.browser.homepage.disable_button.restore_default", true);
Assignee | ||
Updated•17 years ago
|
Attachment #302603 -
Flags: ui-review?(beltzner)
Assignee | ||
Comment 3•17 years ago
|
||
New version. And its not even a workaround!
Attachment #302603 -
Attachment is obsolete: true
Attachment #302764 -
Flags: ui-review?(beltzner)
Attachment #302764 -
Flags: review?(mano)
Attachment #302603 -
Flags: ui-review?(beltzner)
Attachment #302603 -
Flags: review?(mano)
Comment 4•17 years ago
|
||
Comment on attachment 302764 [details] [diff] [review]
v1.2
This check should be done at the top of this function, before we even call getMostRecentWindow. Also, I think the correct check is document.getElementById("...").locked.
You don't need ui-r for bug fixes.
Attachment #302764 -
Flags: ui-review?(beltzner)
Attachment #302764 -
Flags: review?(mano)
Attachment #302764 -
Flags: review-
Assignee | ||
Comment 5•17 years ago
|
||
Why would you want to place that check at the top of the function, before the getMostRecentWindow call?
Assignee | ||
Comment 6•17 years ago
|
||
(In reply to comment #4)
> (From update of attachment 302764 [details] [diff] [review])
> This check should be done at the top of this function, before we even call
> getMostRecentWindow. Also, I think the correct check is
> document.getElementById("...").locked.
>
> You don't need ui-r for bug fixes.
>
Why would you want to place that check at the top of the function, before the
getMostRecentWindow call?
Assignee | ||
Comment 7•17 years ago
|
||
Thanks for the review ace, even though it was a -.
Updated patch.
Attachment #302764 -
Attachment is obsolete: true
Attachment #302777 -
Flags: review?(mano)
Assignee | ||
Comment 8•17 years ago
|
||
even better!
Attachment #302777 -
Attachment is obsolete: true
Attachment #302778 -
Flags: review?(mano)
Attachment #302777 -
Flags: review?(mano)
Comment 9•17 years ago
|
||
Comment on attachment 302778 [details] [diff] [review]
v1.4
>Index: browser/components/preferences/main.js
>===================================================================
>RCS file: /cvsroot/mozilla/browser/components/preferences/main.js,v
>retrieving revision 1.16
>diff -u -p -8 -r1.16 main.js
>--- browser/components/preferences/main.js 6 Jan 2008 03:59:16 -0000 1.16
>+++ browser/components/preferences/main.js 12 Feb 2008 09:55:57 -0000
>@@ -126,41 +126,48 @@ var gMainPane = {
>
> /**
> * Switches the "Use Current Page" button between its singular and plural
> * forms.
> */
> _updateUseCurrentButton: function () {
> var useCurrent = document.getElementById("useCurrent");
>
>+ var windowIsPresent;
> var win;
> if (document.documentElement.instantApply) {
> const Cc = Components.classes, Ci = Components.interfaces;
> // If we're in instant-apply mode, use the most recent browser window
> var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
> .getService(Ci.nsIWindowMediator);
> win = wm.getMostRecentWindow("navigator:browser");
> }
> else
> win = window.opener;
>
> if (win && win.document.documentElement
> .getAttribute("windowtype") == "navigator:browser") {
>- useCurrent.disabled = false;
>+ windowIsPresent = true;
>
> var tabbrowser = win.document.getElementById("content");
> if (tabbrowser.browsers.length > 1)
> useCurrent.label = useCurrent.getAttribute("label2");
> else
> useCurrent.label = useCurrent.getAttribute("label1");
> }
> else {
>+ windowIsPresent = false;
> useCurrent.label = useCurrent.getAttribute("label1");
>- useCurrent.disabled = true;
> }
>+
>+ if (document.getElementById
>+ ("pref.browser.homepage.disable_button.current_page").locked)
>+ return;
>+
>+ useCurrent.disabled = !windowIsPresent;
Add a comment here explaining that the button disabled state is set by preferences.xml if the preference is locked.
r=mano otherwise.
Attachment #302778 -
Flags: review?(mano) → review+
Updated•17 years ago
|
Assignee: nobody → dev
Priority: -- → P1
Target Milestone: --- → Firefox 3 beta4
Updated•17 years ago
|
Keywords: helpwanted → checkin-needed
Comment 11•17 years ago
|
||
mozilla/browser/components/preferences/main.js 1.17
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-litmus?
Keywords: checkin-needed
Resolution: --- → FIXED
Updated•12 years ago
|
Flags: in-litmus?
You need to log in
before you can comment on or make changes to this bug.
Description
•