Software Archive
Read-only legacy content
17061 Discussions

Problem with Standard Cordova Plugin InAppBrowser

BerndB
Beginner
824 Views

Hi all,

i try to load a webpage into the InAppBrowser with:

var ref = window.open('http://apache.org', '_blank'); 

This is the standard example from cordova page, but unfortunately the page never loads. In the InAppBrowser it keeps showing an loading indicator on the lower left side (see screenshoot).

IMG_0210.PNG

Calling '_system' works as expected.

Another strange behavior is, that '_blank' seems to work in the emulator-tab !? There you see a "Back to App" button.

Does anyone has an idea how to solve this issue?

I use:

  • Intel XDK 2248
  • Plugin 0.5.4 (standard for recent XDK)
  • CLI 4.1.2

 

 

0 Kudos
7 Replies
Anusha_M_Intel1
Employee
824 Views

Hi,

I am currently working on an InAppBrowser sample. 

var ref = window.open('http://html5test.com', '_blank', 'location=yes');

The code above works fine on emulator and built app. Could you give this a try?

Are you testing on Android or iOS?

0 Kudos
Noah_S_
Beginner
824 Views

The symptoms sound like you don't have that domain whitelisted. Go into your project build settings and add an external whitelist item for that site.

0 Kudos
Anusha_M_Intel1
Employee
824 Views

I don't think access origin should be an issue unless you are using _self. Besides, the default is '*' which refers to all domains. Specifying origin="*" will implicity add rules for http and https protocols

I do suggest changing the 'Internal' to 'External' radio button for 'access list' to see if it makes a difference (build settings in project tab). In the meantime, I will test it on an iOS device and let you know.  

0 Kudos
Anusha_M_Intel1
Employee
824 Views

When you say on real device, do you mean on app preview or as a built app?

0 Kudos
Swati_S_Intel1
Employee
824 Views

@BemdB, the framework7 code is fine. If your target is '_blank' the above code will not be executed anyways. I tested on iPhone with iOS 8 with framework7 and it works fine. So, few things to check.

1. Make sure you have checked the InAppBrowser plugin under the Standard Cordova plugins section on Projects page

2. Make sure cordova.js is included in your index.html

3. Make sure you use window.open('http://apache.org''_blank');

if it still does not work, send your app through PM. 

 

0 Kudos
Gopi_A_
Beginner
824 Views

Hi All,

I am using Intel XDK (HTML5, JS) to build app for IOS & Andriod. In that I need to load a website inApp browser, for that i am using the below code line. Problem is that it is loading the website fine for sometimes but otherwise it is showing as a blank page. I even have the tracking on that website and the http request is not coming to the website during failure scenarios.

    iabRef = window.open('https://abc.com', '_blank', 'location=no,closebuttoncaption=test,toolbar=yes,toolbarposition=bottom,transitionstyle=fliphorizontal,enableViewportScale=no,hardwareback=yes,hidden=no,clearcache=no,clearsessioncache=no');

 

Does anyone has an idea how to solve this issue?

 

Thanks

0 Kudos
Swati_S_Intel1
Employee
824 Views

Are you seeing this issue on the built app? on iOS or Android or both? Which version of the OS? When you build your app, have you specified correct whitelisting? Which Cordova CLI version are you using? Does your website allow other domains?

0 Kudos
Reply