Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use document.referrer as a key on history management. #36

Open
jongmoon opened this issue Feb 7, 2019 · 0 comments
Open

Use document.referrer as a key on history management. #36

jongmoon opened this issue Feb 7, 2019 · 0 comments

Comments

@jongmoon
Copy link

jongmoon commented Feb 7, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant