Open Bug 676330 Opened 13 years ago Updated 2 months ago

js error when opening the Go menu without any windows open

Categories

(SeaMonkey :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: stefanh, Unassigned)

Details

Attachments

(1 obsolete file)

SM trunk, Mac.

STR:

1) Launch seamonkey
2) Close all open windows
3) Open the Go menu
4) Watch the console
--> JavaScript error: chrome://navigator/content/hiddenWindow.xul, line 1: updateGoMenu is not defined

The updateGoMenu resides in sessionHistoryUI.js, but we're not including that in hiddenWindow.xul. Including the file will, however, result in 2 new js errors:

1) When opening Recently Closed Tabs menu, getWebNavigation() at line 70 in sessionHistoryUI.js is null

2) When opening Recently Closed windows menu, browser is null at line 1513 in navigator.js
*sigh*  I get the feeling this is another one of the effects from bug #599731.
> 2) When opening Recently Closed windows menu, browser is null at line 1513 in
> navigator.js
Um you sure about this?
(In reply to Philip Chee from comment #2)
> > 2) When opening Recently Closed windows menu, browser is null at line 1513 in
> > navigator.js
> Um you sure about this?
Actually, it should probably be opening the "Recently closed tabs" menu. At the time of filing the bug the error was on line 1513.. The file have changed since I filed this, but I'd say the error is quite obvious since we don't have any browser here.

 function updateRecentTabs(menupopup)
 {
   var browser = getBrowser(); <-- no browser here since all windows are closed
 
   while (menupopup.hasChildNodes())
     menupopup.removeChild(menupopup.lastChild);
 
   var list = browser.getUndoList();
(In reply to Edmund Wong from comment #1)
> *sigh*  I get the feeling this is another one of the effects from bug
> #599731.

I haven't checked, but the code probably assumed an open browser window before your changes ;-)
  while (menupopup.hasChildNodes())
    menupopup.removeChild(menupopup.lastChild);

  var browser = getBrowser();
  if (!browser)
    return;
You also need to fix the error in sessionHistoryUI.js.
Can someone clarify if this is still happening on trunk?  I'm not getting
this with: 
Build identifier: Mozilla/5.0 (Windows NT 6.0; rv:12.0a1) Gecko/20120118 Firefox/12.0a1 SeaMonkey/2.9a1
(In reply to Edmund Wong from comment #7)
> Can someone clarify if this is still happening on trunk?  I'm not getting
> this with: 
> Build identifier: Mozilla/5.0 (Windows NT 6.0; rv:12.0a1) Gecko/20120118
> Firefox/12.0a1 SeaMonkey/2.9a1

You can't see this on windows because when you do step 2 in comment #0, you'll exit the application.
Attachment #9387315 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: