Skip to content

How to navigate back? #231

Answered by Brendan-csel
Rkaede asked this question in Q&A
Jan 17, 2023 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

It looks like Twitter is specifically handling the click on their back arrow and deciding where to navigate themselves. Like if you inspect the button, it is not even an anchor <a> and where they navigate to doesn't match the browser history.

So essentially it looks like they are maintaining their own browser history stack. Or perhaps they have a global flag they set when arriving on a Twitter page, and if that flag was not set previously then the arrow navigates to their home page instead - otherwise it does navigate(-1) like normal ...something hacky like that.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Rkaede
Comment options

Answer selected by Rkaede
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants