Cordoba / Phone Screen Saver loads an external site into Cordoba's main webview

What I want

I have an external web resource that I want cordova web browsing to be simple and easy to navigate through internal navigation.

Description

InAppBrowser reports that

The InAppBrowser window behaves like a standard web browser and cannot access the Cordoba API. For this reason, it is recommended that you use InAppBrowser if you need to download third-party (untrustworthy) content, instead , loading it into the main web view of Cordoba

So, I have trusted external links (say http://www.google.com I want to upload to main webview and want to control its process, although click .location.href or user links).

What i tried

Hello world application created with the last corridor and inserted

window.location.href = 'http://www.google.com/'

to his onDeviceReady. This config already had one (and I tried changing it to a specific address)

<access origin="*" />

I also tried window.open and manual links to user links, but all I have is a dialog to open the link in an external browser, rather than showing it inside a single web view. I also tried the InAppBrowser extension, which works great when the navigation bar turns off, but it has communication problems and does not work with manual links and window.location.href changes.

+4
source share
1 answer

Solved the problem using the following rules for both ios and android:

<access origin="*" />
<allow-navigation href="*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="tel:*" />
<allow-navigation href="sms:*" />
<allow-navigation href="mailto:*" />
<allow-navigation href="geo:*" />

, :

+7

All Articles