Divyesh Savaliya
Divyesh Savaliya

Reputation: 2740

Cordova window.open _self not working but _blank working

I am using inAppBrowser plugin in my cordova app.

I want to load external url in webview.

Here is my code of www/index.html file

<!DOCTYPE html>
<html>
<head>
<title>InAppBrowser.addEventListener Example</title>

<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
   var ref = window.open('https://www.google.com', '_blank', 'location=no,toolbar=no'); //This is working

   var ref = window.open('https://www.google.com', '_self'); //This is not working
}

</script>

I don't know why this is happening.

I added inappbrowser plugin.

Upvotes: 2

Views: 3398

Answers (1)

johnborges
johnborges

Reputation: 2533

You might want to try cordova.InAppBrowser.open() intead of window.open().

Upvotes: 3

Related Questions