Changes

Jump to: navigation, search

Browser History:Redirects

692 bytes added, 20:49, 14 December 2005
Redirecting from the DocShell/DocLoader level
The state change firing notifies all WebProgressListeners that have been attached to the DocLoader. The DocShell, which is derived from the DocLoader, is registered as an event listener itself. Then we get the OnStateChange event with the SOURCE channel, which checks the STATE_IS_DOCUMENT and STATE_REDIRECTING flags. No information is available about the new destination channel or URI. When these flags are set, it calls AddToGlobalHistory with a redirect flag of true.
 
=== Proposal 1 ===
 
Add a virtual function to nsDocLoader "OnRedirectStateChange". This function would be called manually from OnChannelRedirect will full information on the source and destionation channels. DocShell will provide an implementation of this function, and we can move the redirect handling code from OnStateChange to there.
 
This redirect function would attempt to QueryInterface the global history to a new interface we define (let's call it nsIGlobalHistory3 for now). If unsuccessful, it would revert to calling the old nsIGlobalHistory2.AddURI. Otherwise, it would call nsIGlobalHistory3.AddURIFrom and give it information about the redirect and a pointer to the docshell.
202
edits

Navigation menu