我正在使用Apache Cordova,我偶然发现了这个功能:
navigator.app.loadUrl(x,y)
在console.log上,它显示为以下函数:
function (url, props) {
exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]);
}
然而,我对什么是"道具"无能为力?并且无法找到相关文档。因此,我想知道是否有人知道在哪里可以获得有关此功能的任何信息(文档最好)?
答案 0 :(得分:1)
/**
* Load the url into the webview or into new browser instance.
*
* @param url The URL to load
* @param props Properties that can be passed in to the activity:
* wait: int => wait msec before loading URL
* loadingDialog: "Title,Message" => display a native loading dialog
* loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error
* clearHistory: boolean => clear webview history (default=false)
* openExternal: boolean => open in a new browser (default=false)
*
* Example:
* navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
*/
loadUrl:function(url, props) {
exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]);
},
https://github.com/apache/cordova-android/blob/master/cordova-js-src/plugin/android/app.js#L33-L49