WebView 未正确更新内容
导航某些页面并尝试使用 window.history.back() 返回后会出现问题,屏幕没有更新 - 最后加载的页面仍然可见 - 但日志中的 URL确实得到正确更新。
初始页=>第二页 => ThirdPage [此处发生 window.history.back() ]
ThirdPage 的内容仍然可见,但使用 WebViewClient 的 onPageFinished 记录的 URL > 方法正确,即记录了 SecondPage 的 URL。由于 ThirdPage 仍在显示,如果我使用按钮执行另一个 window.history.back() 操作,则会再次发生,ThirdPage 仍保留在屏幕中,但这次会记录 InitialPage 的 URL。
知道可能是什么问题吗?
The problem occurs after navigating some pages and try to go back using window.history.back(), the screen just doesn't get updated —the last one loaded remains visible—, but the URL in logs does get updated correctly.
InitialPage => SecondPage => ThirdPage [ here the window.history.back() occurs ]
The content of the ThirdPage remains visible, but the logged URL using WebViewClient's onPageFinished method is correct, that is, the SecondPage's URL gets logged. As the ThirdPage is still showing, if I do another window.history.back() —using a button—, it happens again, the ThirdPage remains in screen, but the InitialPage's URL gets logged this time.
Any idea of what could be the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系,最终一定是加载页面上的某些 JavaScript 阻碍了正常运行。我用自己的页面做了一个简单的测试,这些页面工作正常,但第三方页面不行。
Never mind, in the end it must be some JavaScript on the loaded page blocking the proper functioning. I did a simple test with pages of my own and these pages work fine, but the third-party pages not.