Using bypass history flag in LoadURI() allows entry in SHistory

VERIFIED FIXED in mozilla0.9.4

Status

()

Core
Embedding: APIs
P3
normal
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: David Epstein, Assigned: Radha on family leave (not reading bugmail))

Tracking

Trunk
mozilla0.9.4
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

17 years ago
Reproduced in mfcembed and testembed.
1. Use LOAD_FLAGS_BYPASS_HISTORY flag in LoadURI():
LoadURI(NS_ConvertASCIItoUCS2(theUrl).GetUnicode(), 
			      nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY);
2. Call LoadURI() with any url.
3. Get the session history index and urls:

nsCOMPtr<nsISHistory> theSHistory;
nsCOMPtr<nsIHistoryEntry> theHistEntry;
qaWebNav->GetSessionHistory( getter_AddRefs(theSHistory));

PRInt32 *theIndex;
PRInt32 *numEntries;
theSHistory->GetIndex(theIndex);
theSHistory->GetCount(numEntries);
theSHistory->GetEntryAtIndex(0,PR_FALSE,getter_AddRefs(theHistEntry));
for (theIndex = 0; theIndex < numEntries; theIndex++)
{
   theSHistory->GetEntryAtIndex(theIndex, PR_FALSE,                            
   getter_AddRefs(theHistEntry));
   nsCOMPtr<nsIURI> theUri;
   char *uriSpec;
   theHistEntry->GetURI(getter_AddRefs(theUri));
   theUri->GetSpec(&uriSpec);
   OutputFile(theIndex, uriSpec);   // local method
}

4. Track index and urls

Result: The session history includes the index and url that should have been
"bypassed".
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.0
Created attachment 41853 [details] [diff] [review]
patch to docshell
Created attachment 45995 [details] [diff] [review]
Patch to docshell
Target Milestone: mozilla1.0 → mozilla0.9.4

Comment 3

17 years ago
r=adamlock

Is it now a rule that LOAD_FLAGS_BYPASS_HISTORY can never be combined with any
other load flags?
Because of the way docloader uses the loadtypes defined in nsIDocShellLoadInfo
to pass along load information between itself and docshell, I have to adhere to
the attached methods to identify the actual loadFlags passed by the user. I
think after Rick's reworking of the flags, we will be able to combine flags, 

Right now, simply checking for the flag (like it was before) wouldn't work
because docloader remaps them to the loadTypes defined in nsDocShell.h and
nsIDocShellLoadInfo and repalces the loadFlag with LOAD_NORMAL if it can not
find the flag in the mapping. 

Comment 5

17 years ago
sr=rpotts
Fix checked in. 
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Reporter)

Comment 7

17 years ago
Tested against TestEmbed, 0.9.3+ 20010820 debug build. The url is now being
bypassed, but the *Title* replaces the previous one that isn't bypassed. So if
urls #1 & #2 are loaded with no flags, and url #3 w/ bypass history, url #3
doesn't appear in session history, but the Title of #3 replaces the title of #2.
I'll verify 86752 as fixed, but submit a new one for the title problem.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.