Cross-platform apps are wonderful. Having the ability to create an app and have it run on multiple operating systems is ideal for developers. After all, it increases the audience for their work. And could even earn them money its quite amazing how the web can be customized to reach millions no matter their nation, handset and operating system. Finally there is a way to create cross platform apps for windows and Firefox os.

However, it is not typical for the owner of the operating system to help developers move apps to other platforms. Exclusivity of an app can drive sales of the platform. In other words, if all apps ran on all platforms, the platform really would not matter to consumers. With that said, Microsoft does something shocking, as it shows off how easy it is to create one app using WinJS that runs on Windows 8.1, Windows Phone 8.1 and FireFox OS. This is super.

“Starting with Windows Phone 8.1, it is now possible to use the Windows Runtime to build apps that can target each form factor in the family of Windows devices. Using the universal Windows app project templates, you can now create one app where your business logic can be surfaced up through a user experience relevant to the device. This unified approach to app development means that your app has the potential to reach not just Windows phones and tablets, but Windows laptops and workstations as well”, says Doris Chen.

Behind all this is Winjs which it javascript tool that allows this to happen.

What is WinJS? WinJS is an open-source JavaScript library that can assist you in building HTML, CSS, and JavaScript applications for the Windows Store with a consistent look and performance across all Windows devices. WinJS will work in any browser and can be used as a standalone solution or with other frameworks and libraries. What can WinJS do? WinJS makes it possible to add Windows UI controls in HTML, such as ListView, FlipView, and Semantic Zoom, features like virtualizing collections, and high-quality infrastructure like page controls, promises, data-binding, and a template engine. Where can I use WinJS? Use WinJS not only for your Universal Windows apps with HTML/JS, but also for your websites, and when using HTML-based app technologies like Apache Cordova. The library consists of modules that bring JavaScript coding conventions to Windows Runtime functionality. As you can see in the above video, the developer, Martin Beeby, creates a relatively rudimentary app for accessing Flickr on Windows and Windows Phone 8.1. However, it is extremely impressive to see that same app run on Firefox OS with almost no effort. While it is doubtful that Microsoft will become a full-fledged Firefox OS developer, this demo shows how awesome WinJS really is.

With the open sourcing of WinJS, it might be interesting to see if we can build an app that runs across phone, Windows and another platform such as Firefox OS.