Bug 469302 - Page source code after form submit shows initial form page instead of new page, r=gavin, sr=mrbkap

This commit is contained in:
Stappel 2008-12-30 20:45:05 -08:00
parent 9dc14ca22c
commit 7c36e5a30e

View File

@ -227,15 +227,17 @@ function viewSource(url)
//
PageLoader.loadPage(arg, pageLoaderIface.DISPLAY_AS_SOURCE);
// The content was successfully loaded.
loadFromURL = false;
// Record the page load in the session history so <back> will work.
var shEntry = Cc["@mozilla.org/browser/session-history-entry;1"].createInstance(Ci.nsISHEntry);
shEntry.setURI(makeURI(viewSrcUrl, null, null));
shEntry.setTitle(viewSrcUrl);
shEntry.loadType = Ci.nsIDocShellLoadInfo.loadHistory;
getBrowser().webNavigation.sessionHistory.addEntry(shEntry, true);
// The content was successfully loaded from the page cookie.
loadFromURL = false;
getBrowser().webNavigation.sessionHistory
.QueryInterface(Ci.nsISHistoryInternal)
.addEntry(shEntry, true);
}
} catch(ex) {
// Ignore the failure. The content will be loaded via the URL