只需传递 url 网站即可创建 phone Gap 应用

create a phone Gap app by just passing the url of website

我通过将我开发的网站的 url 传递到我的 PhoneGap 项目中创建了一个 phone gap 应用程序,但是在应用程序地址栏即将到来时我想删除那个

document.addEventListener("deviceready", onDeviceReady, false);

            function onDeviceReady() {                 
                window.open('http://hitchmeright.com', '_self ', 'location=yes');
            }
        </script>

您的应用可能会在 InAppBrowser 中打开 url。来自 InAppBrowser docs:

_self: Opens in the Cordova WebView if the URL is in the white list, otherwise it opens in the InAppBrowser.

所以你需要whitelist your url

话虽如此,这对于 PhoneGap 应用程序来说并不是一个好的设计,并且可能会提供糟糕的用户体验。您将 PhoneGap 视为浏览器而不是混合应用程序。您应该正确构建您的 PhoneGap 应用程序(打包您的 Web 资产并在本地加载它们),并且仅在需要时从服务器加载数据。我建议做更多的研究并检查一些示例应用程序。