Software Archive
Read-only legacy content
17061 Discussions

Cordova access for remoteSite

vinay_m_
Beginner
1,720 Views

Hi all, I'm using intel xdk to launch my remote site in app using window.open(URL) . Now in my remote site I want to show some PDF reports in child window for this I'm calling window.open(myreportURL) but pop-up is blocked and user is unable to disable pop-up blocker from app. For this i want to use cordova child browser. How to access cordova in remote site. Please let me know Thanks in Advance :)

0 Kudos
1 Solution
Anusha_M_Intel1
Employee
1,720 Views

I believe you are looking for or is already using the InAppBrowser plugin. 

We have a sample app that ships with the XDK that opens PDF files etc. Look for it under -> Start a new project -> Samples and Demos -> HTML5+Cordova -> InAppBrowser sample (fourth on top row)

Here is documentation to the plugin: https://github.com/apache/cordova-plugin-inappbrowser

View solution in original post

0 Kudos
12 Replies
Elroy_A_Intel
Employee
1,720 Views

I recommend that you add any domain names that your applications will be communicating with to the whitelist field on the Projects panel > Build Settings > Android-Crosswalk, Android, or iOS . For more information on Intel XDK whitelist, visit https://software.intel.com/en-us/xdk/docs/using-cordova-whitelist-rules-with-intel-xdk.

0 Kudos
Anusha_M_Intel1
Employee
1,721 Views

I believe you are looking for or is already using the InAppBrowser plugin. 

We have a sample app that ships with the XDK that opens PDF files etc. Look for it under -> Start a new project -> Samples and Demos -> HTML5+Cordova -> InAppBrowser sample (fourth on top row)

Here is documentation to the plugin: https://github.com/apache/cordova-plugin-inappbrowser

0 Kudos
vinay_m_
Beginner
1,720 Views

Thank you All,

My question is i'm opening a remoteSite in which I want to call window.open(URL) to show report in child browser. Can I access cordova from my remote Site.?

0 Kudos
Elroy_A_Intel
Employee
1,720 Views

No, you will not be able to access Cordova from the remote site. Cordova is only accessible from your local project files.

0 Kudos
vinay_m_
Beginner
1,720 Views

Hi,

With Cordova inAppBrowser I'm able to load website from server and showing it in webview. but in my website there is a call of window.open which should open URL in system browser (_system) but it is opening in webview itself.

0 Kudos
vinay_m_
Beginner
1,720 Views

Hi Anusha,

 

As per your suggestion, I looked into inAppBrowser Sample template in intel XDk . for ios in configuration i found <access origin> with property "launch-external=yes". How to set this property for my URL in build settings I'm able to set it in whitelisting but it is not as "Launch-external" so i'm unable to launch in browser.

0 Kudos
Anusha_M_Intel1
Employee
1,720 Views

@vinay

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

The above should work to launch the page on system browser. Did you test on device? List the website under Intent (External Whitelist). That is what creates the launch-external entry in the config files. 

0 Kudos
vinay_m_
Beginner
1,720 Views
@anusha, I did the same it was added into my config. Problem is I have window.open call in my remote site with _system which should open in system browser but it is opening as _blank. Can I access app function from my remote site.? Lets say I've pdfopen function in app & I launched my site in webview now can I able to access pdfopen function from webview? Thanks for ur suggestions
0 Kudos
PaulF_IntelCorp
Employee
1,720 Views

You can only access your app functions from within the webview that contains your app. When you open another view, using an iframe or inappbrowser, you are opening a new "view" and you wont have access to your app's functions and data.

0 Kudos
Anusha_M_Intel1
Employee
1,720 Views

Paul's right. Once you open from an inappbrowser window, it is treated as a new view and you no longer have access to your app. You can only close that webview and return. 

0 Kudos
vinay_m_
Beginner
1,720 Views

Hi Everyone,

I'm using latest version of intel xdk which includes cordova 5.1.1 I included splashscreen plugin and added images in build settings for iOS landscape but still I'm getting cordova image as splash screen. pls help on this. Thanks in advance.

0 Kudos
John_H_Intel2
Employee
1,720 Views

@vinay 

Please post a new topic with your issues. It gets cumbersome trying to follow multiple issues on the same thread.

Thanks!

0 Kudos
Reply