Mozilla-Style Web Apps With Mortar
Mozilla-Style Web Apps With Mortar
Written by Ian Elliot   
Tuesday, 08 January 2013

Mozilla has a lot riding on its particular view of a web app being accepted by as many programmers as possible. To help with the task of building web apps Mozilla-style, we now have Mortar - a set of templates and tools.

Mozilla has a number of platforms in mind for its particular style of web app. You can run a Mozilla web app on the desktop using Firefox, on Android using Firefox for Android and on Firefox OS. Of course the big problem is that Firefox OS, which promises to be the biggest market, doesn't really have any hardware support at the moment. Both the desktop and the Android options also lag behind Firefox OS in the sense that many of the APIs are not implemented.

Even so the idea of creating web apps using Mozilla's APIs is an attractive one on the assumption that these have a reasonable chance of being implemented in the future and even becoming standard.

Mortar is a set of app templates and tools that are intended to make getting started easier and to introduce some best practices.  Each template consids of a set of HTML, CSS and JavaScript files to implement a particular type of app. The Mortar templates all include:


  • A project structure (folders for css, js, etc)
  • Some initial well-formed HTML, JavaScript, and files like manifest.webapp
  • require.js to manage javascript
  • volo for a development server, css/js optimizations, deployment, and other tasks
  • Some initial js libs: zepto, mozilla’s receipt verifier library, and a cross-platform library to install web apps


The manifest can be used to install the app so that you can test it in this mode. The choice of require.js to implement a module system is a good one but volo is far less well known. This is build on top of Node.js and it acts as a sort of management and control tool. You can use it to introduce new modules to the project and even to start a development server so that you can see your project run.

Currently there are four major app types supported:


  • mortar-app-stub: a minimal template that only has a little pre-built HTML (a blank canvas for any type of app)
  • mortar-game-stub: a minimal template that comes with some basic game components
  • mortar-list-detail: a template like app-stub but also includes a layouts library and a basic list-detail type interface
  • mortar-tab-view: a template like list-detail but the default interface is a tabbed view


If you would like to see Mortar in action then take a look at the video demo:






Firefox OS 2.5 Now Easy To Try On Android

Lots of programmers, including me, had high hopes of Firefox OS. It promised to be the only truly free mobile OS and it is web based. Mozilla has just released version 2.5 and an easy way for users to [ ... ]

Fear And Loathing In the App Store 13 - Apple Rejects F.lux And It Isn't Even In The App Store!

I thought we had seen all the possibilities for troubles in the App Store, but this one reaches a new level of silliness. The app concerned wasn't even in the App Store, but Apple still managed to get [ ... ]

More News








Last Updated ( Tuesday, 08 January 2013 )

RSS feed of news items only
I Programmer News
Copyright © 2015 All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.