【问题标题】:cant convert existing website to phonegap using url无法使用 url 将现有网站转换为 phonegap
【发布时间】:2018-08-02 09:27:48
【问题描述】:
我有一个响应式移动视图网站。
我需要将网站转换为带有 url 的 phonegap 应用程序 - 只是将网站加载到应用程序中。
我对这个话题做了很多研究,但找不到任何好的答案。
我尝试通过 cordova.js 和 config.xml 加载 URL
有什么方法可以在不下载整个文件的情况下将网站加载到 phonegap 中?这个网站非常大,并且与用户和数据库有联系。
【问题讨论】:
标签:
phonegap-plugins
phonegap-build
phonegap
phonegap-cli
phonegap-desktop-app
【解决方案1】:
这不是 Phonegap 的预期用途。也就是说,如果您真的想这样做,您可以在 config.xml 中使用 content element:
<content src="http://somesite.com/somepage.html" />
还有whitelist它:
<plugin name="cordova-plugin-whitelist" />
<allow-navigation href="http://somesite.com/*" />
如前所述,这不是 Phonegap 的好用处。如果您只是要打开一个互联网网址,用户也可以在他们的移动浏览器中打开您的网站。
将您的网络资产本地打包到应用中,并为您的用户提供良好的体验。