[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2018-02-13 Thread Jan Piotrowski (Sujan) (JIRA)

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

Jan Piotrowski (Sujan) commented on CB-12193:
-

Has this functionality already be released with thea release of 
cordova-windows? 
(The second to last comment indicates so)
Then definitely a new issue, but link to this one and the PR that added the 
code so it is easy to follow where this is coming from.

> 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: cordova-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
(v7.6.3#76005)

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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2018-02-13 Thread Christian Campo (JIRA)

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

Christian Campo commented on CB-12193:
--

I recently tried to run Cordova embedded in a XAML-WebView on Windows 10. The 
check that was introduced by this Jira ticket CB-12193

"Windows.UI.ViewManagement.ApplicationView.getForCurrentView();"

does work and set the isCoreWindowAvailable to true; (I believe it is supposed 
to run in an Exception when run as Embedded WebView)

HOWEVER the next callĀ 

Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler, 
false);

is failing with missing permissions.

What is right procedure ? Reopen this ticket or open a new ticketĀ since this is 
a regression ?

> 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: cordova-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
(v7.6.3#76005)

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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-12 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CB-12193:
--

Commit 707bf962823b9585a22dfaa3ffa6f0185562df5a in cordova-windows's branch 
refs/heads/master from [~daserge]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-windows.git;h=707bf96 ]

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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-12 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-12193:
-

Github user asfgit closed the pull request at:

https://github.com/apache/cordova-windows/pull/215


> 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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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 @@
==
  Files16 16  
  Lines  2204   2204  
  Methods 413413  
  Messages  0  0  
  Branches430430  
==
  Hits   1678   1678  
  Misses  526526  
  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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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



### 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- 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 
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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-08 Thread venkata guddanti (JIRA)

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

venkata guddanti commented on CB-12193:
---

Thank you! Yes this fix works for us as well

> 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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-08 Thread Sergey Shakhnazarov (JIRA)

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

Sergey Shakhnazarov commented on CB-12193:
--

Thank you [~ven.guddanti] - this worked well!
Could you please test if [the 
fix|https://github.com/daserge/cordova-windows/tree/CB-12193] works for your 
use case?
I just don't have enough context on the scenario to see/test all the cases.

> 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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-07 Thread venkata guddanti (JIRA)

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

venkata guddanti commented on CB-12193:
---

Maybe something like this will work. I do not have window 10 phone emulators on 
my machine so I could not try Windows phone
try
  {
//If getForCurrentView fails, it is an indication that we are 
running in a WebView without
// a CoreWindow where some WinRT APIs are not available. 
Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
injectBackButtonHandler();

app.start();
  }
  catch (e)
  {
console.log('Cordova is running without a CoreView (maybe inside a 
WebView).');
  }

> 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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-07 Thread Sergey Shakhnazarov (JIRA)

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

Sergey Shakhnazarov commented on CB-12193:
--

[~ven.guddanti], thank you for the sample!
I've managed to reproduce the issue but don't see a way to check that 
CoreWindow is unavailable for Windows 10 Mobile - it does not fail the 
{{Windows.UI.ViewManagement.InputPane.getForCurrentView()}} but crashes on 
{{Windows.UI.Core.SystemNavigationManager.getForCurrentView}} which corresponds 
to your findings.
So to improve this scenario we'll need to determine somehow that we are in a 
webview - do you happen to know a way to check this?

> 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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-06 Thread Sergey Shakhnazarov (JIRA)

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

Sergey Shakhnazarov commented on CB-12193:
--

[~ven.guddanti], yes it would be great if you could upload a sample.
I tried to reproduce this with a blank WinJS app - issue did not occur for me 
neither on adding cordova.js after base.js nor on commenting out base.js 
reference and copying it to the {{www/WinJS/js/base.js}} location.

> 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
>
> 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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-05 Thread venkata guddanti (JIRA)

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

venkata guddanti commented on CB-12193:
---

We have our own framework. To create a test case, create a HTML Windows 10 
application and include cordova.js in a webview after WinJS file. Or the WinJS 
location should match /www/WinJS/js/base.js that cordova is trying to load. 

I can create a test case if necesary

> 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
>
> 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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-12-05 Thread Sergey Shakhnazarov (JIRA)

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

Sergey Shakhnazarov commented on CB-12193:
--

[~ven.guddanti], which framework are you using?
Is there any reproduce steps/test setup for the issue?

> 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
>
> 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



[jira] [Commented] (CB-12193) cordova.js crashes windows app if there is no CoreWindow

2016-11-29 Thread venkata guddanti (JIRA)

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

venkata guddanti commented on CB-12193:
---

Please note that cordova runs fine without WinJS. For e.g it has the following 
code:

if (!window.WinJS) {
 .. 
if (navigator.appVersion.indexOf('MSAppHost/3.0') !== -1) {
// Windows 10 UWP
scriptElem.src = '/www/WinJS/js/base.js';
}
}
else {
onWinJSReady();
}

The location of WinJS was changed from /WinJS/js/base to /www/WinJS/js/base.js 
after Cordova 4.0.0. So if Cordova fails to load WinJS it still functions 
without a glitch.  

Another thing to consider is if a framework already includes WinJS before 
cordova.js, there is no need to call onWinJSReady. Such a framework would have 
done its own app lifecycle management (activation, checkpoint etc). So you can 
eliminate onWinJSReady

> 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
>
> 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