[ https://issues.apache.org/jira/browse/CB-12193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15735633#comment-15735633 ]
ASF GitHub Bot commented on CB-12193: ------------------------------------- GitHub user daserge opened a pull request: https://github.com/apache/cordova-windows/pull/215 CB-12193 cordova.js crashes windows app if there is no CoreWindow <!-- Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines: http://cordova.apache.org/contribute/contribute_guidelines.html Thanks! --> ### Platforms affected Windows ### What does this PR do? Don't subscribe to WinRT lifecycle events Cordova is running in webview. Also made confighelper to load after WinJS as it depends on it. [CB-12193](https://issues.apache.org/jira/browse/CB-12193) ### What testing has been done on this change? Manual tests. ### Checklist - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected. - [ ] Added automated test coverage as appropriate for this change. You can merge this pull request into a Git repository by running: $ git pull https://github.com/daserge/cordova-windows CB-12193 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-windows/pull/215.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #215 ---- commit 707bf962823b9585a22dfaa3ffa6f0185562df5a Author: daserge <v-ses...@microsoft.com> Date: 2016-12-08T14:53:11Z CB-12193 cordova.js crashes windows app if there is no CoreWindow Also made confighelper to load after WinJS as it depends on it ---- > 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