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

Try to use replaceState to verify history API. #635

Closed
wants to merge 5 commits into from
Closed

Try to use replaceState to verify history API. #635

wants to merge 5 commits into from

Conversation

stevemckenzie
Copy link

@mjackson
Copy link
Member

I think we need a way to do this without using replaceState because AFAICT it may trigger another request.

@stevemckenzie navigator.userAgent ? :P

@mjackson
Copy link
Member

@stevemckenzie do you have a sample User-Agent string from browsers that currently fail the check?

@gaearon
Copy link
Contributor

gaearon commented Dec 23, 2014

When would replaceState trigger a request? Do you mean buggy browsers?

@mjackson
Copy link
Member

Oh, wait. Sorry. I wasn't thinking straight. @stevemckenzie @gaearon Please ignore me :)

@gaearon
Copy link
Contributor

gaearon commented Dec 23, 2014

I'm still not sure about the implications in case this check happens when HashLocation is used.
It's a bit weird for a “getter” method to have side-effect like this.

Are we sure that window.location.pathname + window.location.search is precisely current path?

@stevemckenzie
Copy link
Author

I definitely agree that this would be better without using replaceState but from everything I tried using the latest version of Firefox, this was basically the only working route I found.

with @gaearon 's last comment, I guess location.hash should be included?

@tiye
Copy link

tiye commented Jan 21, 2015

Does it mean we can use history.replaceState {}, '', 'a-route' to trigger react-router re-rendering?

@ryanflorence
Copy link
Member

I borrowed that code from modernizr, has it changed there?

@stevemckenzie
Copy link
Author

Modernizr/Modernizr#1463

@stevemckenzie
Copy link
Author

@mjackson - I updated this a bit based on what we talked about at the conf. I didn't think this would become a priority again for a while but it now has for me.

For now I'm just using my fork though.

@ryanflorence
Copy link
Member

Have you experiemented with an iframe as mentioned in Modernizr/Modernizr#1463?

@ryanflorence
Copy link
Member

@stevemckenzie ping ^

@ryanflorence
Copy link
Member

closing due to inactivity, please holler if we should reopen this.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants