Closed Bug 478579 Opened 16 years ago Closed 16 years ago

SessionStore - getClosedTabData API function returns blank arrays

Categories

(SeaMonkey :: Session Restore, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 478470

People

(Reporter: morac, Unassigned)

Details

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/20090214 SeaMonkey/2.0a3pre The getClosedTabData API function in the new nsSessionStore component will always return an array of empty arrays. The reason for this is because the code added to removeTab under bug 36810 to browser.xml (line 1458) copies the tabData object of the current tab into the gBrowser.savedBrowsers array. There is never a tabData object so the tabData object in the savedBrowsers array will always be {}. The getClosedTabData API function returns an array of gBrowser.savedBrowsers[].tabData objects which results in an array of empty arrays being returned. To fix this either tabData must be populated for tabs (or created in removeTab) or the getClosedTabData API function needs to return the entire savedBrowsers array. Basically it needs to return something that the calling function can parse. It is preferable that it return the same object structure that nsSessionStore returns in Firefox if possible. Reproducible: Always
I guess you mean tabbrowser.xml rather than browser.xml
(In reply to comment #1) > I guess you mean tabbrowser.xml rather than browser.xml Yes I did, sorry about the typo.
Blocks: 36810
Flags: blocking-seamonkey2.0a3?
Version: unspecified → Trunk
I think you wrong. Here is the code from removeTab method in tabbrowser.xml: // We're committed to closing the tab now. // Dispatch a notification. // We dispatch it before any teardown so that event listeners can // inspect the tab that's about to close. var event = document.createEvent('Events'); event.initEvent("TabClose", true, false); aTab.dispatchEvent(event); then sessionstore listens for TabClose: var tabsData = { state: tabState, title: tabTitle, image: aTab.getAttribute("image"), pos: tabState.entries.length - 1 }; aTab.tabData = tabsData; and then again in code from removeTab method in tabbrowser.xml: this.savedBrowsers.unshift({browser: oldBrowser, history: oldSH, tabData: aTab.tabData || {} }); The reason you getting empty array can be bad/broken function naming in patch for bug 478470. Can you please retest it with current patch ?
This bug can be surely closed. I've managed to install SessionManager (btw, you still have extra space in your sessionmanager.js line 50, which prevents sessionmanager to install in SeaMonkey), then closed some tabs, and able to see my closed tabs in Tools>Session Manager>Closed Tabs. Their favicons also displayed. Restoring them doesn't work, because SeaMonkey tabbrowser.xml doesn't have undoCloseTab. It uses restoreTab method. Either we should have undoCloseTab, or i'm suggesting you to use sessionstore's undoCloseTab as an universal method. WONTFIX ?
Okay I applied the patch for bug 478470 and it now works so I guess this is a dupe of that. Sorry.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
No longer blocks: 36810
Flags: blocking-seamonkey2.0a3?
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.