Last Comment Bug 717976 - Thunderbird getBrowserURL() may return (SeaMonkey) "chrome://navigator/content/navigator.xul"
: Thunderbird getBrowserURL() may return (SeaMonkey) "chrome://navigator/conten...
Status: RESOLVED FIXED
:
Product: Thunderbird
Classification: Client Software
Component: General (show other bugs)
: Trunk
: All All
: -- trivial (vote)
: Thunderbird 13.0
Assigned To: Magnus Melin
:
Mentors:
http://mxr.mozilla.org/comm-central/s...
Depends on: 359653
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-13 10:09 PST by Serge Gautherie (:sgautherie)
Modified: 2012-03-06 11:49 PST (History)
2 users (show)
mkmelin+mozilla: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
proposed fix (1.67 KB, patch)
2012-02-27 11:52 PST, Magnus Melin
standard8: review+
Details | Diff | Splinter Review

Description Serge Gautherie (:sgautherie) 2012-01-13 10:09:16 PST
(Noticed while checking bug 717753.)

Code is:
{
53 function getBrowserURL() {
54 
55   try {
56     var prefs = Components.classes["@mozilla.org/preferences-service;1"]
57                          .getService(Components.interfaces.nsIPrefBranch);
58     var url = prefs.getCharPref("browser.chromeURL");
59     if (url)
60       return url;
61   } catch(e) {
62   }
63   return "chrome://navigator/content/navigator.xul";
64 }
}

"browser.chromeURL" is obviously the right thing to try :-)
"chrome://navigator/content/navigator.xul" is SeaMonkey specific ;-<

I'm not sure whether this function could be allowed to fail somehow.
If not, maybe TB should provide a fake browser page documenting the "no browser" case?
Or default to "chrome://messenger/content/messengercompose/messengercompose.xul"?
...

Ftr,
{
/mail/app/profile/all-thunderbird.js
    * line 53 -- pref("browser.chromeURL", "chrome://messenger/content/messengercompose/messengercompose.xul");
}
Comment 1 Magnus Melin 2012-02-27 11:50:54 PST
*** Bug 722266 has been marked as a duplicate of this bug. ***
Comment 2 Magnus Melin 2012-02-27 11:52:32 PST
Created attachment 600996 [details] [diff] [review]
proposed fix

Or maybe we should just hardcode the string. Is there value in having it be a pref?
Comment 3 Mark Banner (:standard8) 2012-02-28 02:57:14 PST
Comment on attachment 600996 [details] [diff] [review]
proposed fix

So this will throw if getCharPref fails, but I'm fine with that because we should be finding out why that's failing, if it is.
Comment 4 Magnus Melin 2012-03-06 11:49:30 PST
http://hg.mozilla.org/comm-central/rev/1b3e8b3c517c 
-> FIXED

Note You need to log in before you can comment on or make changes to this bug.