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

Incorrect window.history.state data in IE11 #489

Open
TomFoyster opened this issue Apr 12, 2017 · 9 comments · May be fixed by #490
Open

Incorrect window.history.state data in IE11 #489

TomFoyster opened this issue Apr 12, 2017 · 9 comments · May be fixed by #490
Labels

Comments

@TomFoyster
Copy link

TomFoyster commented Apr 12, 2017

I'm submitting a bug report

Library Version:
"aurelia-router": "npm:aurelia-router@^1.0.0",

Operating System:
|Windows 7

Node Version:
6.10.1

NPM Version:
3.10.10

JSPM OR Webpack AND Version
JSPM 0.16.53

Browser:
Internet Explorer 11

Language:
ESNext

Current behavior:

  • I am a user, and I store data in window.history.state.
  • I then organically navigates to another page in the App, and then navigate back to the original page by using a link (not the browsers back button).
  • I then view the data stored in window.history.state.
  • In IE11 I see the data I stored in the earlier step

Expected/desired behavior:
As this page view should be a new entry in window.history I shouldn't see any data stored in window.history.state

I have tested this outside Aurelia - with 2 simple HTML pages using replaceState() and it performs as expected in IE11.

An example App to replicate this can be found;
https://github.com/TomFoyster/AureliaHistoryStateTest

@jwx
Copy link
Member

jwx commented Apr 12, 2017

Pretty sure this is due to different behaviours in the browsers. Looking into it.

@EisenbergEffect
Copy link
Contributor

I don't think this has anything to do with Aurelia.

@jwx
Copy link
Member

jwx commented Apr 12, 2017

@EisenbergEffect Not sure I agree. Aurelia's router is responsible for navigation within the app and the problem occurs since it doesn't take into consideration that IE/Edge behaves differently when using location.hash to "create navigation". I do however think I could create a PR that fixes this, if you want it.

@EisenbergEffect
Copy link
Contributor

EisenbergEffect commented Apr 12, 2017 via email

@TomFoyster
Copy link
Author

I'd also argue this shouldn't be closed until a solution is implemented.

If this were normal behaviour in IE11 outside of Aurelia I'd agree that it isn't an issue However, as covered by @jwx, the role of this package is to replicate the navigation behaviour one would usually encounter when using a non-SPA site. Part of that behaviour is window.history.state being cleared when a new page is loaded.

Closing it because you think it's nothing to do with Aurelia is a little premature IMO.

jwx added a commit to jwx/router that referenced this issue Apr 13, 2017
The router doesn't handle the different behaviour in IE/Edge for history state on new entries. This fix consolidates the behaviour with Chrome etc.

Depending on PR aurelia/history-browser/history-state-consolidation.
Closes aurelia#489.
@jwx
Copy link
Member

jwx commented Apr 13, 2017

@EisenbergEffect @TomFoyster It wasn't quite as straight forward as I had hoped, but there's now two PRs that will consolidate the behaviour of IE/Edge with that of Chrome and Firefox.

@EisenbergEffect
Copy link
Contributor

@jwx Thanks! We'll check them out and try to get them into the next set of releases.

@davismj
Copy link
Member

davismj commented Sep 30, 2017

@jwx I appreciate your fix. I'm trying to get a repro so I can confirm that your PR does in fact fix this. Using the @TomFoyster 's above.

jwx added a commit to jwx/router that referenced this issue Sep 19, 2018
The router doesn't handle the different behaviour in IE/Edge for history state on new entries. This fix consolidates the behaviour with Chrome etc.

Depending on PR aurelia/history-browser/history-state-consolidation.
Closes aurelia#489.
@Alexander-Taran
Copy link
Contributor

R.I.P. IE ?

@bigopon

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

Successfully merging a pull request may close this issue.

5 participants