我使用人行横道5.34.104.5来构建Android应用。
执行后
location.href = '/another_page.html'
在manifest.json定义的入口点index.html中,将弹出空白警报,并显示空白页面。
another_page.html
与index.html位于同一目录(即,它是apk文件,其路径assets/www/another_page.html
相对于apk的根目录),并且不通过网络提供。
如何实现预期的位置转换?
这是“ asserts / www / another_page.html”中的错字,应该是资产,对不对?我可以通过更改location.href来加载另一页来做同样的事情。
编辑:如果您正在使用make_apk.py打包您的应用程序,则可以传递“ --enable-remote-debugging”来为您的应用程序打开远程调试。在设备上启动应用后,请在主机上运行的Chrome浏览器中打开“ chrome:// inspect”,然后检查该页面以直接在控制台中执行“ window.location.href = xxx”,然后尝试修复该问题问题。有关详细信息,请参见https://crosswalk-project.org/#wiki/Remote-Debugging-on-Android。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句