Bug 58613 "last page visited" cannot handle framed pages properly
patch by ian@arlen.demon.co.uk r=timeless sr=alecf git-svn-id: svn://10.0.0.236/trunk@144042 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -6542,6 +6542,26 @@ nsDocShell::AddToGlobalHistory(nsIURI * aURI, PRBool aHidden)
|
||||
|
||||
NS_ENSURE_SUCCESS(mGlobalHistory->AddPage(spec.get()), NS_ERROR_FAILURE);
|
||||
|
||||
// Only save last page visited if it is not a frame and one of the
|
||||
// startup, new window or new tab prefs is set to last page visited.
|
||||
// See bug 58613 for more details.
|
||||
if (mPrefs && !IsFrame()) {
|
||||
PRInt32 choice = 0;
|
||||
if (NS_SUCCEEDED(mPrefs->GetIntPref("browser.startup.page", &choice))) {
|
||||
if (choice != 2) {
|
||||
if (NS_SUCCEEDED(mPrefs->GetIntPref("browser.windows.loadOnNewWindow", &choice))) {
|
||||
if (choice != 2)
|
||||
mPrefs->GetIntPref("browser.tabs.loadOnNewTab", &choice);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (choice == 2) {
|
||||
browserHistory = do_QueryInterface(mGlobalHistory);
|
||||
if (browserHistory)
|
||||
browserHistory->SetLastPageVisited(spec.get());
|
||||
}
|
||||
}
|
||||
|
||||
// this is a redirect, hide the page from
|
||||
// being enumerated in history
|
||||
if (aHidden && browserHistory) {
|
||||
|
||||
Reference in New Issue
Block a user