InAppBrowser plugin odd behavior

Thread is closed for posting
2 posts, 0 answers
  1. Giancarlo
    Giancarlo avatar
    9 posts
    Member since:
    Jul 2015

    Posted 02 Sep 2015 Link to this post

    I'm using AppBuilder within Visual Studio 2015 targeting Cordova 4.0 using Crosswalk in Android and WKWebView in iOS. I'm having some issues with the InAppBrowser core plugin. I have the following whitelist in the config.xml under App_Resources/Android/xml/config.xml and App_Resources/iOS/config.xml.

    <access origin="*" />
    <allow-navigation href="*" />

    Additionally, in index.html I have the following Content-Security-Policy:

    <meta http-equiv="Content-Security-Policy" content="default-src *;">

    Basically everything is wide open for now during development.

    Android Issue-

    The app doesn't exactly seem to crash, but the splash screen shows when I execute the following code:;

    iOS Issue-

    The app does nothing when I execute the following code. Probably expected behavior for if a site isn't in the whitelist.;

    When I dial down the Cordova version to 3.7 (followed by "Build and Deploy"), Android no longer shows the splash screen upon executing but iOS still doesn't do anything when executing

    I appreciate any help you can offer.

  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 07 Sep 2015 Link to this post

    Hello Giancarlo,

    I was able to replicate only one of the issues you reported - on an Android device using Crosswalk, the call opens the default Cordova WebView and invokes the splash screen. In order to workaround this issue you can set a target of "_blank" for the call and explicitly define that the external link should be opened in the InAppBrowser. Alternatively, you can look into using this new InAppBrowser Crosswalk plugin as it provides a web browser view, which is using the Crosswalk engine to render the external pages.

    Both approaches work for me on Android and I was not able to detect any issues on an iOS device even if I don't set a target for the method. I attached the sample project I used for testing so you can have a look at it on your side and let me know if there is anything I am missing. The project is based on this InAppBrowser sample but it also incorporates the InAppBrowserXwalk plugin and the openExternalInAppBrowser() method is modified to take advantage of the custom plugin API.

    Also, if you can replicate the iOS issues on a device with my project, please let me know the type and OS version of the device.

    Tina Stancheva

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

Back to Top