Search code examples
angularjscordovaionic-frameworkcordova-pluginsinappbrowser

don't show backbutton when i use inappbrowser plugin


After the onDeviceReady event is fired, my app opens an url in the cordova InAppBrowser. Now I want to show a backbutton in the browser.

How can i do this?

This is my code so far:

    <script>
        document.addEventListener("deviceready", onDeviceReady, false);
        function onDeviceReady() {
            var ref = cordova.InAppBrowser.open('http://example.com/','_self', 'hardwareback=yes,directories=no,titlebar=no,toolbar=no,hardwareback=yes,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
            var myCallback = function(event) { 
                cordova.InAppBrowser.open('http://example.com/','_self', 'hardwareback=yes,directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no'); }
            ref.addEventListener('exit', myCallback);
        }
    </script>

Solution

  • You are using _self instead of _blank

    This will open the passed URL in the inappbrowser. cordova.InAppBrowser.open(myURL, '_blank');

    And

    cordova.InAppBrowser.open(myURL, '_self'); it will open the passed URL in the Webview.

    Note :: with what Have read,i don't think webview work with back button try using blank