Fix for bug # 49913. Pressing enter in the url field adds duplicate entry

to Session History. r=adamlock sr=alecf
 VS: ----------------------------------------------------------------------


git-svn-id: svn://10.0.0.236/trunk@83791 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
radha%netscape.com
2000-12-18 20:02:26 +00:00
parent a5e0246dcc
commit 9d0d722f02

View File

@@ -3642,10 +3642,21 @@ nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, PRUint32 aLoadType)
UpdateCurrentGlobalHistory();
PRBool updateHistory = PR_TRUE;
PRBool equalUri = PR_FALSE;
// Get the post data from the channel
nsCOMPtr<nsIInputStream> inputStream;
if (aChannel) {
nsCOMPtr<nsIHTTPChannel> httpChannel(do_QueryInterface(aChannel));
if(httpChannel) {
httpChannel->GetUploadStream(getter_AddRefs(inputStream));
}
}
// Determine if this type of load should update history
if (aLoadType & LOAD_FLAGS_BYPASS_HISTORY ||
aLoadType & LOAD_CMD_RELOAD || aLoadType & LOAD_CMD_HISTORY)
aLoadType & LOAD_CMD_RELOAD || aLoadType & LOAD_CMD_HISTORY ||
(mCurrentURI && NS_SUCCEEDED(mCurrentURI->Equals(aURI, &equalUri)) && equalUri && !inputStream))
{
updateHistory = PR_FALSE;
}