Firefox OS Manifest .htaccess Handler

By  on  

Want to know one of the secrets why Firefox OS is so incredibly awesome?  If you've created your website correctly, i.e. using CSS media queries (responsive design) and JavaScript feature detection, you can simply add an app.manifest file at the root of your domain and you've instantly created a Firefox OS app!  Of course you'll then want to list your app in the Firefox Marketplace.  The most frequent problem developers run into is with their app.manifest file not being served correctly.  With an update to the .htaccess file of the hosted app, that problem can go away!

The .htacess Code

The problem is that the manifest.webapp file isn't being served properly, so an AddType is the key:

AddType application/x-web-app-manifest+json .webapp

The .htaccess snippet above ensures that the manifest is served correctly, thus eliminating the annoying manifest error and letting you get your app listed on the Marketplace!

Recent Features

  • By
    CSS Animations Between Media Queries

    CSS animations are right up there with sliced bread. CSS animations are efficient because they can be hardware accelerated, they require no JavaScript overhead, and they are composed of very little CSS code. Quite often we add CSS transforms to elements via CSS during...

  • By
    Regular Expressions for the Rest of Us

    Sooner or later you'll run across a regular expression. With their cryptic syntax, confusing documentation and massive learning curve, most developers settle for copying and pasting them from StackOverflow and hoping they work. But what if you could decode regular expressions and harness their power? In...

Incredible Demos

  • By
    iPhone Click Effect Using MooTools or jQuery

    One thing I love about love about Safari on the iPhone is that Safari provides a darkened background effect when you click a link. It's the most subtle of details but just enforces than an action is taking place. So why not implement that...

  • By
    MooTools Zebra Table Plugin

    I released my first MooTools class over a year ago. It was a really minimalistic approach to zebra tables and a great first class to write. I took some time to update and improve the class. The XHTML You may have as many tables as...

Discussion

  1. In my nginx config manifest listed as(taken from mime.types file):
    text/cache-manifest manifest;
    If based on your example it would be:
    application/x-web-app-manifest+json manifest

  2. Stanton Moreland

    This is a really helpful post as I was looking to add my app on the Firefox marketplace for some time now. I am going to check it out soon! Since I am huge fan of Firefox Add-on Builder and SDK, I want you to check this blog post regarding developing Firefox add-ons.

    http://groupdocs.com/blog/tech-blog/archive/2013/02/01/developing-firefox-add-ons-with-the-add-on-builder-and-sdk.html

    I use GroupDocs viewer plugin for Firefox and it has good performance for a browser-based app but this add-on post has me confused. Hoping to hear from you on this!

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!