Wednesday, 23 January 2013

WindowsPhone8 expects HTML5 apps without Javascript??!?

I am not a huge fan of WindowsPhone8 and Microsoft. In search for a HTML5 mobile framework which works on Windows Mobile, I installed Windows 8 and VisualStudio. Before diving into VisualStudio, I tried few HTML5 frameworks on the mobile ie to see which one(s) seem to be working which I already mentioned in previous post.

Since jQueryMobile was the only working framework on WindowsPhone, I wanted to give a try and dive in to VisualStudio. Unlike android and ios IDEs, Visual Studio had a HTML5 app template which seemed to be a good idea.


I already had a nice app template from adobe which have few pages and a custom style so was perfect for testing.

However, the result was far from being perfect...

Again, I went back to ie10 which seemed to be working fine. So I started with playing the developer tools to see if I could make the webapp fail in similar way. After playing a little with css, I realized turning off the scripts make the page fail in a similar way.



I decided to check the template app in C#. I was thinking this was a desperate effort since this was the HTML5 app template for the WindowsPhone from Microsoft itself. The code block was pretty simple:


<phone:WebBrowser x:Name="Browser"                          HorizontalAlignment="Stretch"                          VerticalAlignment="Stretch"                          Loaded="Browser_Loaded"                          NavigationFailed="Browser_NavigationFailed" />

After playing a while with WebBrowser's properties, I realized there is a property called "IsScriptEnabled". Well that should be nonsense to have this turned off by default, even if it was since this an HTML5 app template from the official IDE it would already been set to true.

It turned out that it wasn't setting this property to true, let the app run as expected.

<phone:WebBrowser x:Name="Browser" IsScriptEnabled="True"                          HorizontalAlignment="Stretch"                          VerticalAlignment="Stretch"                          Loaded="Browser_Loaded"                          NavigationFailed="Browser_NavigationFailed" />



Seriously Microsoft, do you really think an HTML5 app is something without Javascript? I can understand this to be turned out by default for the webbrowser component but I really can not understand how would you not set it on automatically for an HTML5 app template!