Search code examples
cordova

What parameters does "navigator.app.loadUrl" receive?


I am using Apache Cordova, and I stumbled across this function:

navigator.app.loadUrl(x,y)

On console.log, it is shown to be a function of:

function (url, props) {
  exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]);
} 

However, I am clueless about what is "props" and can't find any documentation on it. Therefore, I am wondering if anyone knows where can I get any info (documentation would be best) regarding this function?


Solution

  •  /**
    * 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