Currently only URL is used as a key for different page. and URL is added on depths arrays. But It has some problem. it could have too many duplication of URL. So it removes previous URL and just adds new depth. For example,
A(1) -> B(2) -> C(3) -> D(4) -> A(5)
() means a depth.
Then history will be B -> C -> D -> A and it make problem when you go back to previous A and navigates to other sites. For example, A-> E... In this situation B-> C->D should be removed. But depth of A (5) is bigger than B, C, D(2, 3, 4).
To supplement this, we can use document.referrer with URL. It makes possible that A(1) followed by none can be distinguished by A(5) followed by D(4).
For example,
A(1) -> A-B(2)-> B-C(3) ->C->D(4) -> D->A(5)
And also it could manage history more correctly. For example if persist is not applied on page A, and You navigate like follows you could make depths unintended way.
A -> B , and Back
A -> C
Then B -> C is the depths of this history. But If you add A (referrer) on a history then you can acquire depth like A->C as you intended.
Currently only URL is used as a key for different page. and URL is added on
depths
arrays. But It has some problem. it could have too many duplication of URL. So it removes previous URL and just adds new depth. For example,Then history will be
B -> C -> D -> A
and it make problem when you go back to previous A and navigates to other sites. For example, A-> E... In this situation B-> C->D should be removed. But depth of A (5) is bigger than B, C, D(2, 3, 4).To supplement this, we can use
document.referrer
with URL. It makes possible that A(1) followed by none can be distinguished by A(5) followed by D(4).For example,
And also it could manage history more correctly. For example if
persist
is not applied on page A, and You navigate like follows you could make depths unintended way.Then B -> C is the
depths
of this history. But If you add A (referrer) on a history then you can acquire depth likeA->C
as you intended.