Closed Bug 478768 Opened 16 years ago Closed 16 years ago

aWindow.getBrowser is not a function when calling nsSessionStore:getWindowState()

Categories

(SeaMonkey :: Session Restore, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.0a3

People

(Reporter: morac, Assigned: misak.bugzilla)

References

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2) Gecko/20081201 Firefox/3.1b2 (.NET CLR 3.5.30729) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090216 SeaMonkey/2.0a3pre The problem is with line 1482 in nsSessionStore.js: total._closedTabs = this._getClosedTabs(this._windows[aWindow.__SSi]); See bug 478470 comment #13. "This shouldn't work, as this._windows is a collection of window data, not DOMWindows. Unfortunately, we don't seem to have a test for detecting this, so far..." Reproducible: Always Steps to Reproduce: 1. Enter the following in the error console: var win = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser"); Components.classes["@mozilla.org/suite/sessionstore;1"].getService(Components.interfaces.nsISessionStore).getWindowState(win); Actual Results: Error: uncaught exception: [Exception... "'[JavaScript Error: "aWindow.getBrowser is not a function" {file: "file:///C:/Program%20Files/SeaMonkey/components/nsSessionStore.js" line: 2457}]' when calling method: [nsISessionStore::getWindowState]" nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "JS frame :: javascript:%20var%20win%20=%20Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser");%20Components.classes["@mozilla.org/suite/sessionstore;1"].getService(Components.interfaces.nsISessionStore).getWindowState(win); :: <TOP_LEVEL> :: line 1" data: yes] Expected Results: Should display the window state as a JSON. Similar to what Firefox does when the same command is used.
Confirming and taking. Seems one line patch, coming soon.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
I should get savedBrowsers from aWindow instead from sessionstore cached array.
Attachment #362613 - Flags: superreview?(neil)
Attachment #362613 - Flags: review?(neil)
Attachment #362613 - Flags: approval-seamonkey2.0a3?
Assignee: nobody → misak
Attachment #362613 - Flags: superreview?(neil)
Attachment #362613 - Flags: superreview+
Attachment #362613 - Flags: review?(neil)
Attachment #362613 - Flags: review+
Attachment #362613 - Flags: approval-seamonkey2.0a3? → approval-seamonkey2.0a3+
The patch appears good. I'm not getting the errors any more and the window data is being returned.
Keywords: checkin-needed
OS: Windows XP → All
Hardware: x86 → All
Comment on attachment 362613 [details] [diff] [review] use aWindow instead this._windows array [Checkin: Comment 4] http://hg.mozilla.org/comm-central/rev/f6dc1d644315
Attachment #362613 - Attachment description: use aWindow instead this._windows array → use aWindow instead this._windows array [Checkin: Comment 4]
Blocks: 478470
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.0a3
Version: unspecified → Trunk
Component: UI Design → Session Restore
QA Contact: ui-design → session.restore
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: