Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
Windows 10
Description
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
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
Attachments
Attachments
Issue Links
- links to