Phonegap inAppBrowser, _self target does not work

As the title says, I'm trying to make _self target for the inAppBrowser plugin to open an external link inside the phonegap webcam. But currently it is opening instead of inAppBrowser.

I am using this configuration:

<preference name="stay-in-webview" value="true"/> <gap:plugin name="org.apache.cordova.inappbrowser" /> <feature name="InAppBrowser"> <param name="android-package" value="CDVInAppBrowser" /> </feature> <access origin="*" /> 

The function I use is as follows:

 function ready() { $.ajax({url: "http://mydomain", type: "HEAD", timeout: 1000, statusCode: { 200: function (response) { cordova.InAppBrowser.open('http://mydomain','_self'); }, 400: function (response) { $("#loading").html("No Connection"); }, 0: function (response) { $("#loading").html("No Connection"); } } }); } document.addEventListener("deviceready", ready, false); 

and currently this is my behavior:

_self -> inAppBrowser (should open in webview)

_blank → inAppBrowser

_system -> default browser for android by default

My goal is to create static content (index.html stored in apk), which is a backup page in case there is no connection to the site (for example, there is no network of devices), so I can not use it if someone offers this.

+5
source share
1 answer

In JavaScript, you can use window.open (" http://google.com ", "_ self");

-2
source

Source: https://habr.com/ru/post/1239881/


All Articles