无法使用 url 将现有网站转换为 phonegap

cant convert existing website to phonegap using url

我有一个响应式移动视图网站。 我需要使用 url 将网站转换为 phonegap 应用程序 - 只是将网站加载到应用程序中。

我对这个主题做了很多研究,但找不到任何好的答案。

我试图通过 cordova.js 和 config.xml

加载 URL

有什么方法可以在不下载整个文件的情况下将网站加载到 phonegap 中吗?这个站点真的很大,并且连接到用户和数据库。

这不是 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 的良好用途。如果您只是要打开一个 url 互联网,用户也可以在他们的移动浏览器中打开您的网站。

将您的 Web 资产本地打包到应用程序中,为您的用户提供良好的体验。