URL redirects should not create multiple navigation items |
||||||||||||||
Issue descriptionRight now, the way we deal with URL redirects (both server side and client side) is to create a navigation item for each redirect, which is incorrect, and instead, we should stack them together into a single item.
,
Mar 22 2017
,
Mar 22 2017
Sure. NavigationEntries represent stops in the back/forward session history, so we don't have separate NavigationEntries for server redirects (which you can't go back to). Client redirects involve a commit of one page followed by a commit of another, so I think they tend to create a new NavigationEntry that replaces the first NavigationEntry. The redirect chain is supposed to include all the URLs we redirected through on the way. I thought it would include both server and client redirects, but estark@ was mentioning today that it might not include client redirects. This might be fixable if necessary. (In general, I've found PageTransition isn't very reliable for making policy decisions about navigations, so I tend not to rely on it when possible.)
,
Mar 22 2017
I was merely guessing that the redirect chain wouldn't include client-side redirects; I don't have any real knowledge on the topic. :) But now that I'm poking at the code, it does seem that the redirect chain is populated only via network requests redirecting, for example NavigationResourceThrottle::WillRedirectRequest. I'm not even really sure what the definition of a "client redirect" is. Would we want to consider it a client redirect if a page does `location.replace` at any point? What about assigning to location.href?
,
Mar 22 2017
There's some magic, I think. location.href assignments before some point in time (onload?) get treated as client redirects, and later ones don't. japhet@ might remember.
,
Mar 22 2017
Yep, client redirect never get history entries before onload *completes*. So:
window.onload = function() {
location = 'foo.html';
}
...will never create a history entry. But the following generally will:
window.onload = function() {
setTimeout(function() {
location = 'foo.html';
}, 0);
}
,
Mar 24 2017
Since content uses a redirect chain to keep all the redirects, do you have an example when the chain is used? or may be useful?
,
Mar 27 2017
Looks like ios/web does not crate extra navigation items for server side redirects and the problem is only limited to client-side redirects
,
Mar 30 2017
Issue 661670 has been merged into this issue.
,
Apr 13 2017
It turns out that we still create extra navigation items for server side redirects, but in rare cases: One example of re-producing is with AMP (accelerated mobile page), and steps are as following: (1) Navigate to an AMP (Accelerate Mobile Page) -- I do this from news.google.fr (2) Shutdown Chrome on iOS (i.e. switch to another app, then kill the app) (3) Relaunch Chrome on iOS Somehow, when relaunches Chrome, a server side redirect is fired, and due to crbug.com/676129, a new item with server side redirect transition type is added.
,
May 17 2017
,
May 17 2017
,
May 25 2017
,
May 31 2017
The following revision refers to this bug: https://chrome-internal.googlesource.com/chrome/ios_internal.git/+/5bc2b7751a2861cb1cf631b5f214720d8ac31b2a commit 5bc2b7751a2861cb1cf631b5f214720d8ac31b2a Author: mrefaat <mrefaat@google.com> Date: Wed May 31 19:14:30 2017
,
Jul 10 2017
,
Jul 10 2017
,
Jul 13 2017
,
Oct 10 2017
We will get consistent behavior as mobile Safari after switching to WKBasedNavigationManager (crbug.com/734150), which is no extra NavigationItem entry for server-side redirects, and same for client-side redirects that happen before page onload (as described in comment #6). The new navigation manager is targeted for M64. Eugene -- is it worth fixing this on the old navigation stack before then?
,
Oct 10 2017
I don't think we should fix old navigation stack before getting any results from WKBasedNavigationManager experiment.
,
Nov 29 2017
,
Sep 14
|
||||||||||||||
►
Sign in to add a comment |
||||||||||||||
Comment 1 by kkhorimoto@chromium.org
, Mar 21 2017