0

I have added the pluggins cordova-plugin-inappbrowser 1.5.0 "InAppBrowser" cordova-plugin-whitelist 1.3.0 "Whitelist" to the project. The cordova.js is inside /platforms/android/platform_www/cordova.js. The code i use is the next line:

<a href="" onclick="window.open('https://www.google.com/', '_self', 'location=no');" >Google</a>

index.html is the next:

<!DOCTYPE html>
<html>
    <head>
        <script src="js/jquery-2.0.2.js"></script>
        <script src="js/jquery.mobile-1.4.5.min.js"></script>
        <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
        <meta name="format-detection" content="telephone=no">
        <meta name="msapplication-tap-highlight" content="no">
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
        <link rel="stylesheet" type="text/css" href="css/index.css">
        <title>KirolAPP</title>
    </head>
    <body>
        <div role="page" id="indexPage"></div>
        <div class="app">
        <div data-role="header" align="center">
        <img src="img/kirolLogo.png">   
        <br>
        </div>
        <div data-role="content" align="center">
            <form id="formInicio">

                <output style="color: #d17b12;">Nombre</output><br>
                <input type="text" id="idNombre" style="border:1;" placeholder="Usuario"><br>
                <output style="color: #d17b12;">Clave</output><br>
                <input type="password" id="idClave"  style="border:1; color: orange;" placeholder="Clave">
                <br><br>
                <div style="text-align:center;">
                    <a href="" id="botonAcceso" class="boton" onclick="" style="color: yellow;border: 1">Entrar</a>
                </div>
            </form>
        </div>
        <br>

        <div data-role="footer" align="center" >
            <div style="text-align:center;">
                    <a href="#" onclick="window.open('https://www.google.com/', '_self', 'location=no');" >Google</a>
                    <a href="registro.html" id="botonRegistro" class="botonPagina" data-transition="turn" onclick="" style="color: yellow;">Registrarse</a>
            </div>  
        </div>

    </div>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
</body>
</html>

I follow this another post phonegap open link in browser a lot.

Community
  • 1
  • 1
Asier
  • 461
  • 9
  • 19

1 Answers1

0

Try using '_system' attribute. It works.

<a href="#" onclick="window.open('https://www.google.com/', '_system', 'location=no');" >Google</a>
Tolulope Owolabi
  • 314
  • 3
  • 13