[ 
https://issues.apache.org/jira/browse/CB-10467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15424447#comment-15424447
 ] 

ASF GitHub Bot commented on CB-10467:
-------------------------------------

Github user vladimir-kotikov commented on a diff in the pull request:

    
https://github.com/apache/cordova-plugin-inappbrowser/pull/178#discussion_r75115204
  
    --- Diff: src/windows/InAppBrowserProxy.js ---
    @@ -176,6 +179,38 @@ var IAB = {
     
                     browserWrap.appendChild(popup);
     
    +                var closeHandler = function (e) {
    +                    setTimeout(function () {
    +                        IAB.close(navigationEventsCallback);
    +                    }, 0);
    +                };
    +
    +                if (features.indexOf("hardwareback=yes") > -1 || 
features.indexOf("hardwareback") === -1) {
    +                    hardwareBackCallback = function () {
    +                        if (browserWrap.style.display === 'none') {
    +                            // NOTE: On Windows Phone 8.1 backbutton 
handlers have to throw an exception in order to exit the app
    +                            throw 'Exit the app';
    +                        }
    +
    +                        if (popup.canGoBack) {
    +                            popup.goBack();
    +                        } else {
    +                            closeHandler();
    +                        }
    +                    };
    +                } else if (features.indexOf("hardwareback=no") > -1) {
    +                    hardwareBackCallback = function () {
    +                        if (browserWrap.style.display === 'none') {
    +                            // NOTE: On Windows Phone 8.1 backbutton 
handlers have to throw an exception in order to exit the app
    +                            throw 'Exit the app';
    --- End diff --
    
    Same as above


> Hardware back button, while InAppBrowser is opened, closes the app too in 
> addition to closing InAppBrowser
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CB-10467
>                 URL: https://issues.apache.org/jira/browse/CB-10467
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin InAppBrowser
>    Affects Versions: 1.2.0
>         Environment: Windows phone 8.1
>            Reporter: Sam Deepak
>            Assignee: Sergey Shakhnazarov
>              Labels: cordova, inappbrowser, reproduced, triaged, wfc, 
> windows, wp8
>
> The hardware back button when tapped closes the app (puts in background mode) 
> in addition to closing the InAppBrowser.
> This behavior exists in windows phone only whereas it works fine in Android 
> (it closes only the InAppBrowser).
> Please help me fix this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to