Search code examples
cordovainappbrowser

Open another URL on same InAppBrowser instance


I use PhoneGap InAppBrowser to open a URL. After an event is triggered I use a Javascript function to show a barcode scanner on the top. The barcode scanner then opens another URL to the same (_self) InAppBrowser instance. Problem is that, if I login on the before scanning on that URL, the session does not appear to work after scanning, which means that I have to log in again. Any ideas?


Solution

  • Put the var in a place that is accessible by your method that re-loads the InAppBroswer.

    then use

    browserVar.show();
    browserVar.location = 'new location';
    

    http://cordova.apache.org/docs/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html#show