Mercurial > snowl
changeset 346:398b9ca0264b
when updating the URI in the river view, make sure we update the river document's URI rather than the URI for the current tab, since the river view might not be the current tab on startup
author | Myk Melez <myk@mozilla.org> |
---|---|
date | Fri, 24 Oct 2008 15:01:24 -0700 |
parents | 1bbcbc4d95d2 |
children | d95334ac5edc |
files | content/river.js |
diffstat | 1 files changed, 4 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/content/river.js Fri Oct 24 14:14:12 2008 -0700 +++ b/content/river.js Fri Oct 24 15:01:24 2008 -0700 @@ -447,14 +447,9 @@ if (this._periodMenu.selectedItem && this._periodMenu.selectedItem.value != "all") params.push("period=" + encodeURIComponent(this._periodMenu.selectedItem.value)); - let gBrowserWindow = window.QueryInterface(Ci.nsIInterfaceRequestor). - getInterface(Ci.nsIWebNavigation). - QueryInterface(Ci.nsIDocShellTreeItem). - rootTreeItem. - QueryInterface(Ci.nsIInterfaceRequestor). - getInterface(Ci.nsIDOMWindow); + let browser = gBrowserWindow.gBrowser.getBrowserForDocument(document); - let currentURI = gBrowserWindow.gBrowser.docShell.currentURI.QueryInterface(Ci.nsIURL); + let currentURI = browser.docShell.currentURI.QueryInterface(Ci.nsIURL); let query = params.length > 0 ? "?" + params.join("&") : ""; let spec = currentURI.prePath + currentURI.filePath + query; @@ -464,11 +459,11 @@ // Update the docshell with the new URI. This updates the location bar // and gets used by the bookmarks service when the user bookmarks the page. - gBrowserWindow.gBrowser.docShell.setCurrentURI(uri); + browser.docShell.setCurrentURI(uri); // Update the session history entry for the page with the new URI. // This gets used when the user reloads the page or traverses history. - let history = gBrowserWindow.gBrowser.sessionHistory; + let history = browser.sessionHistory; let historyEntry = history.getEntryAtIndex(history.index, false); if (historyEntry instanceof Ci.nsISHEntry) historyEntry.setURI(uri);