Issue with browser history implementation
Today I encontered a interesting defect reported by QA.
When trying to revert to previous page in an iframe, the behaviour varies across different browsers.
For Chrome, the browser can keep track of all iframe state changes, and all location hash changes, which allows us to use history.back() to revert to previous page.
This means a lot, since we are currently developing single page application using angular2 now, the location hash implemented by angular2 router will be picked up.
However, when the iframe's state stack is poped out, which means when it reaches the start point of the iframe, then something weird happened.
The parent window's state is also reverted back. This is somehow like a event bubbling, and it's hidden from us.
For IE, since we support down to IE9, so we only test in IE9.
It appears the location hash is not picked up as the browser history. So dissappointing.
After all this, all it seems practical that we build our own history object.
Luckily with angular2 provider it's easy to inject it.
Now have to say that IE9 is really a mystery ( crap).
posted on 2017-04-21 09:58 ayumiknight 阅读(87) 评论(0) 收藏 举报
浙公网安备 33010602011771号