[ https://issues.apache.org/jira/browse/CB-12193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15735717#comment-15735717 ]
ASF GitHub Bot commented on CB-12193: ------------------------------------- Github user codecov-io commented on the issue: https://github.com/apache/cordova-windows/pull/215 ## [Current coverage](https://codecov.io/gh/apache/cordova-windows/pull/215?src=pr) is 76.13% (diff: 100%) > Merging [#215](https://codecov.io/gh/apache/cordova-windows/pull/215?src=pr) into [master](https://codecov.io/gh/apache/cordova-windows/branch/master?src=pr) will not change coverage ```diff @@ master #215 diff @@ ========================================== Files 16 16 Lines 2204 2204 Methods 413 413 Messages 0 0 Branches 430 430 ========================================== Hits 1678 1678 Misses 526 526 Partials 0 0 ``` > Powered by [Codecov](https://codecov.io?src=pr). Last update [623ff18...707bf96](https://codecov.io/gh/apache/cordova-windows/compare/623ff181dbb780537c9a9b646db6f72bd59722e9...707bf962823b9585a22dfaa3ffa6f0185562df5a?src=pr) > cordova.js crashes windows app if there is no CoreWindow > -------------------------------------------------------- > > Key: CB-12193 > URL: https://issues.apache.org/jira/browse/CB-12193 > Project: Apache Cordova > Issue Type: Bug > Components: Windows > Environment: Windows 10 > Reporter: venkata guddanti > Priority: Critical > Labels: reproduced, triaged, windows > Attachments: CordovaTest.zip > > > The back button support in cordova.js crashes windows app. In particular the > following line crashes: > var navigationManager = > Windows.UI.Core.SystemNavigationManager.getForCurrentView(); > Putting try catch around it does not help. It crashes deep in the bowels of > native code. So I believe there should a fix similar to the following code in > WinJS base.js: > // If getForCurrentView fails, it is an indication that we are running in > a WebView without > // a CoreWindow where some WinRT APIs are not available. In this case, we > just treat it as > // if no WinRT APIs are available. > var isCoreWindowAvailable = false; > try{ > _Global.Windows.UI.ViewManagement.InputPane.getForCurrentView(); > isCoreWindowAvailable = true; > } > catch (e){ > } > You can then skip setting up the back button handler if there is no > CoreWindow: > if (isCoreWindowAvailable) > { > var navigationManager = > Windows.UI.Core.SystemNavigationManager.getForCurrentView(); > ... > } > I am aware that Cordova Windows 10 is not supported in a WebView (i.e. there > is no CoreWindow). But WinJS and majority of Windows APIs work. Cordova 4.0.0 > used to work as well, since there was no back button support in it. Plugins > that need CoreWindow (i.e. plugins that show native UI) like Camera etc have > issues without it. We have a framework where we proxy these plugins through > the main application Window (similar to iOS and Android). > Please do consider this and incorporate a fix in cordova for Windows 10 -- 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