Closed Bug 589962 Opened 14 years ago Closed 14 years ago

Sync UI: gBrowser is not defined

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- final+

People

(Reporter: zpao, Assigned: philikon)

Details

(Whiteboard: [sync-ui-followup])

Attachments

(1 file)

************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "gBrowser is not defined" {file: "chrome://browser/content/browser.js" line: 3910}]' when calling method: [nsIObserver::observe]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: resource://services-sync/ext/Observers.js :: anonymous :: line 122"  data: yes]
************************************************************

I've seen this a couple times before (and have heard of others see it), but had never figured out how to reproduce it, until now.

STR:
1. Start up Firefox,
2. Open a 2nd window
3. Close a window
4. Wait for error

The error is at http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser-syncui.js#60 and it's happening because the observer that was added in gSyncUI.init for that window is being notified. But the window doesn't exist anymore, so gBrowser isn't defined :(

Can fix this by removing the observer when the window closes (either with an unload listener or a domwindowclosed observer). Or maybe just try/catch & return from the catch.
blocking2.0? because we shouldn't do these things in a release...
blocking2.0: --- → ?
Attached patch v1Splinter Review
Remove observer when window is unloaded
Assignee: nobody → philipp
Attachment #468514 - Flags: review?(gavin.sharp)
Attachment #468514 - Flags: review?(gavin.sharp) → review+
blocking2.0: ? → final+
http://hg.mozilla.org/mozilla-central/rev/1ec65590029c
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
I'm still getting this error in Firefox 4.
Are you sure what you see is this specific bug and not caused by some other add-on, could you try temporarily disabling all add-ons and see if it still happens?
I don't see any error here.
Thanks for the tip. Disabling and then re-enabling my Firefox 4 addons seems to have resolved the issue, bizarrely. Is this expected behaviour?
No, it's not expected but it's possible that some add-on was somehow using broken preferences and re-enabling it fixed that problem, or such. Btw it's clearly not this bug and add-ons fault.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: