Working with common libraries and frameworks

Jump to:

This article provides a summary of the different JavaScript libraries and frameworks you might choose to work with when developing an open web app, along with tips, tricks, and gotchas to be aware of.


Whitelist "app:/" protocol with AngularJS

If you have developed a packaged app with AngularJS, you may run into this error message:

The address wasn't understood 
Firefox doesn't know how to open this address, because the protocol (unsafe) isn't associated with any program. 

When you use Angular data binding to generate a URL, Angular will match the URL against its whitelist. If the URL does not match, Angular prefixes the url with "unsafe:" (see the Angular documentation). To make you app work with AngularJS, you can add "app:/"--the protocol FirefoxOS packaged apps use--to Angular's whitelist. In your app's configuration, this is how to whitelist "app:/":

var app = angular.module( 'myApp', [] ).config(['$compileProvider', function($compileProvider) {

Or in AngularJS 1.1+

var app = angular.module( 'myApp', [] ).config(['$compileProvider', function($compileProvider) {

Document Tags and Contributors

Contributors to this page: wbamberg, chrisdavidmills
Last updated by: wbamberg,