SlideShare a Scribd company logo
Mozilla Web Apps
   Building apps with
    web technology
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
Mozilla is a
global non-
profit dedicated
to putting you
in control of
your online
experience and
shaping the
future of the
Web for the
public good
@robertnyman
@mozhacks
Mozilla Web Apps - Super-VanJS
"Very emotional. But I don't like it."
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
On which platforms will Web Apps run?
Introducing Web Runtime - WebRT
Currently:

Windows
Mac
Android
Future:

As many as
possible
Mozilla Web Apps - Super-VanJS
What's needed to run/install a Web App?
The Mozilla Labs App
Runtime extension

https://
addons.mozilla.org/
en-US/firefox/addon/
app-runtime/
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
HTML5-based WebRT:
include.js

Available at:
http://myapps.mozillalabs.com/
jsapi/include.js
Mozilla Web Apps - Super-VanJS
https://myapps.mozillalabs.com/
Android App:
Mozilla Labs App Runtime
for Android

Available at:
https://
developer.mozilla.org/en/
Apps#Web_runtime
Mozilla Web Apps - Super-VanJS
Developing a Web App
Open Web technologies:

HTML5, CSS, JavaScript

A manifest file
Manifest file
{
    "version": "1.0",
    "name": "ABBAInfo",
    "description": "Getting some ABBA info",
    "icons": {
        "16": "/abbainfo/images/icon-16.png",
        "48": "/abbainfo/images/icon-48.png",
        "128": "/abbainfo/images/icon-128.png"
    },
    "developer": {
        "name": "Robert Nyman",
        "url": "http://robertnyman.com"
    },
    "installs_allowed_from": [
        "*"
    ],
    "launch_path": "/abbainfo/",
    "locales": {
    },
    "default_locale": "en"
}
MIME type:

application/x-web-app-manifest+json
Apache - in mime.types:

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



Apache - in .htaccess:

AddType application/x-web-app-manifest+json webapp
NGinx - in mime.types:

application/x-web-app-manifest+json webapp;
IIS:

In IIS Manager, right-click the local computer, and click
Properties.

Click the MIME Types button.

Click New.

In the Extension box, type the file name extension.

In the MIME type box, type a description that exactly
matches the file type defined on the computer.

Click OK.
curl -I http://localhost/abbainfo/manifest.webapp
Installing a Web App
navigator.mozApps.install(
    URLToManifestFile,
    installData,
    sucessCallback,
    errorCallback
);
var mozApps = navigator.mozApps;
if (mozApps) {
    navigator.mozApps.install(
        "http://localhost/abbainfo/manifest.webapp",
        {
            "userID": "Robocop"
        },
        function () {
            console.log("Worked!");
            console.log(result);
        },
        function (result) {
            console.log("Failed :-(");
            console.log(result);
        }
    );
}
Errors

denied:               User refuses to install the app
permissionDenied:     Site is not allowed to trigger the installation
manifestURLError:     URL to the manifest is malformed
networkError:         app host is unreachable
manifestParseError:   manifest contains syntax errors
invalidManifest:      manifest contains semantic errors
Content
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>ABBAInfo</title>
        <link rel="stylesheet" href="css/base.css" type="text/css" media="screen">
    </head>

    <body>

        <div id="container">
            ABBA
        </div>



        <script type="text/javascript">
            (function () {
                // Press the R key to reload the page
                window.addEventListener("keydown", function (evt) {
                    if (evt.keyCode === 82) {
                        location.reload();
                    }
                }, false);
            })();
        </script>



    </body>
</html>
offline & localStorage
sessionStorage.setItem("Swedes", "Sedins");
console.log(sessionStorage.getItem("Swedes"));
localStorage.setItem("Bryan Adams", "Musician");
var ryanReynolds = {
    "startedIn" : "Hillside",
    "movie" : "Green Lantern"
};

localStorage.setItem("ryanReynolds", JSON.stringify(anthonyWeiner));

console.log(typeof JSON.parse(localStorage.getItem("ryanReynolds")));
<!DOCTYPE html>
<html manifest="offline.appcache">
<head>
...
CACHE MANIFEST

# VERSION 10

CACHE:
offline.html
base.css

FALLBACK:
online.css offline.css

NETWORK:
/live-updates
IndexedDB
var indexedDB = window.indexedDB || window.webkitIndexedDB
|| window.mozIndexedDB || window.msIndexedDB;

var request = indexedDB.open("ABBADatabase");
var request = indexedDB.open("ABBADatabase", 2),
    customerData = [
        {ssn: "444-44-4444", name: "Bill", age: 35, email: "bill@company.com"},
        {ssn: "555-55-5555", name: "Donna", age: 32, email: "donna@home.org"}
    ];

request.onerror = function(event) {
    // Handle errors.
};

request.onupgradeneeded = function(event)
    var objectStore = db.createObjectStore("customers", {
        keyPath: "ssn"}
    );

     objectStore.createIndex("name", "name", {
         unique: false
     });

     objectStore.createIndex("email", "email", {
         unique: true }
     );

     for (var i in customerData) {
         objectStore.add(customerData[i]);
     }
};
Fullscreen
<button id="view-fullscreen">Fullscreen</button>

<script type="text/javascript">
(function () {
    var viewFullScreen = document.getElementById("view-fullscreen");
    if (viewFullScreen) {
        viewFullScreen.addEventListener("click", function () {
            var docElm = document.documentElement;
            if (docElm.mozRequestFullScreen) {
                docElm.mozRequestFullScreen();
            }
            else if (docElm.webkitRequestFullScreen) {
                docElm.webkitRequestFullScreen();
            }
        }, false);
    }
})();
 </script>
mozRequestFullScreenWithKeys?
html:-moz-full-screen {
    background: red;
}

html:-webkit-full-screen {
    background: red;
}
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
Marketplace
https://apps-preview.mozilla.org/
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
Dev tools
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
http://groups.google.com/group/mozilla-apps
irc.mozilla.org

#openwebapps
Try new things
Robert Nyman
robertnyman.com/speaking/ robnyman@mozilla.com
robertnyman.com/html5/    Twitter: @robertnyman
robertnyman.com/css3/

More Related Content

PDF
Django の認証処理実装パターン / Django Authentication Patterns
PDF
Djangoアプリのデプロイに関するプラクティス / Deploy django application
PDF
What's new in Rails 4
PDF
Secure WordPress Development Practices
PDF
WordPress Admin UI - Future Proofing Your Admin Pages
PPTX
JavaScript Performance (at SFJS)
PDF
Primefaces Confess 2012
PDF
Jquery Cheatsheet
Django の認証処理実装パターン / Django Authentication Patterns
Djangoアプリのデプロイに関するプラクティス / Deploy django application
What's new in Rails 4
Secure WordPress Development Practices
WordPress Admin UI - Future Proofing Your Admin Pages
JavaScript Performance (at SFJS)
Primefaces Confess 2012
Jquery Cheatsheet

What's hot (20)

PDF
Vue.js for beginners
PDF
2012.sandiego.wordcamp
KEY
Taking your Web App for a walk
PDF
Desmistificando o Phonegap (Cordova)
PDF
Progressive Web Apps: o melhor da Web appficada
PPT
AIR 開發應用程式實務
PDF
Clearance: Simple, complete Ruby web app authentication.
PPTX
Hybrid app
PPTX
Don't Over-React - just use Vue!
PPTX
High Performance Web Components
PPT
Oscon 20080724
KEY
Eu odeio OpenSocial
PDF
jQtouch, Building Awesome Webapps
PPT
Desenvolvimento web com jQuery Mobile
PDF
All you need to know about JavaScript loading and execution in the browser - ...
PPT
How do speed up web pages? CSS & HTML Tricks
PDF
Desenvolvimento web com Ruby on Rails (parte 6)
ODP
Passo a Passo para criar uma aplicação Móvel Híbrida
ODP
Desenvolvendo uma aplicação híbrida para Android e IOs utilizando Ionic, aces...
PDF
Angular vs React for Web Application Development
Vue.js for beginners
2012.sandiego.wordcamp
Taking your Web App for a walk
Desmistificando o Phonegap (Cordova)
Progressive Web Apps: o melhor da Web appficada
AIR 開發應用程式實務
Clearance: Simple, complete Ruby web app authentication.
Hybrid app
Don't Over-React - just use Vue!
High Performance Web Components
Oscon 20080724
Eu odeio OpenSocial
jQtouch, Building Awesome Webapps
Desenvolvimento web com jQuery Mobile
All you need to know about JavaScript loading and execution in the browser - ...
How do speed up web pages? CSS & HTML Tricks
Desenvolvimento web com Ruby on Rails (parte 6)
Passo a Passo para criar uma aplicação Móvel Híbrida
Desenvolvendo uma aplicação híbrida para Android e IOs utilizando Ionic, aces...
Angular vs React for Web Application Development
Ad

Similar to Mozilla Web Apps - Super-VanJS (20)

PDF
Web APIs & Apps - Mozilla
PDF
WebAPIs & Apps - Mozilla London
PDF
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
PDF
JavaScript APIs - The Web is the Platform
PDF
HTML5: huh, what is it good for?
KEY
Html5 For Jjugccc2009fall
PDF
20150812 4시간만에 따라해보는 windows 10 앱 개발
PDF
A mobile web app for Android in 75 minutes
PDF
Firefox OS workshop, JSFoo, India
PDF
WebAPIs & WebRTC - Spotify/sthlm.js
PPTX
HTML5 on Mobile
PDF
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
PDF
Summit2014 topic 0066 - 10 enhancements that require 10 lines of code
KEY
Paris js extensions
PDF
Vaadin 7 CN
PPT
Sanjeev ghai 12
PDF
Create a mobile web app with Sencha Touch
PDF
Google Web Toolkit
PDF
The Open Web and what it means
PDF
After max+phonegap
Web APIs & Apps - Mozilla
WebAPIs & Apps - Mozilla London
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
JavaScript APIs - The Web is the Platform
HTML5: huh, what is it good for?
Html5 For Jjugccc2009fall
20150812 4시간만에 따라해보는 windows 10 앱 개발
A mobile web app for Android in 75 minutes
Firefox OS workshop, JSFoo, India
WebAPIs & WebRTC - Spotify/sthlm.js
HTML5 on Mobile
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Summit2014 topic 0066 - 10 enhancements that require 10 lines of code
Paris js extensions
Vaadin 7 CN
Sanjeev ghai 12
Create a mobile web app with Sencha Touch
Google Web Toolkit
The Open Web and what it means
After max+phonegap
Ad

More from Robert Nyman (20)

PDF
Have you tried listening?
PDF
Building for Your Next Billion - Google I/O 2017
PDF
Introduction to Google Daydream
PDF
Predictability for the Web
PDF
The Future of Progressive Web Apps - View Source conference, Berlin 2016
PDF
The Future of the Web - Cold Front conference 2016
PDF
The Future of Progressive Web Apps - Google for Indonesia
PDF
Google tech & products
PDF
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
PDF
Progressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
PDF
The web - What it has, what it lacks and where it must go - keynote at Riga D...
PDF
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
PDF
The web - What it has, what it lacks and where it must go - Istanbul
PDF
The web - What it has, what it lacks and where it must go
PDF
Google, the future and possibilities
PDF
Developer Relations in the Nordics
PDF
What is Developer Relations?
PDF
Android TV Introduction - Stockholm Android TV meetup
PDF
New improvements for web developers - frontend.fi, Helsinki
PDF
Mobile phone trends, user data & developer climate - frontend.fi, Helsinki
Have you tried listening?
Building for Your Next Billion - Google I/O 2017
Introduction to Google Daydream
Predictability for the Web
The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of the Web - Cold Front conference 2016
The Future of Progressive Web Apps - Google for Indonesia
Google tech & products
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Progressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go
Google, the future and possibilities
Developer Relations in the Nordics
What is Developer Relations?
Android TV Introduction - Stockholm Android TV meetup
New improvements for web developers - frontend.fi, Helsinki
Mobile phone trends, user data & developer climate - frontend.fi, Helsinki

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
Teaching material agriculture food technology
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
A Presentation on Artificial Intelligence
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation theory and applications.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Electronic commerce courselecture one. Pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Teaching material agriculture food technology
CIFDAQ's Market Insight: SEC Turns Pro Crypto
A Presentation on Artificial Intelligence
Cloud computing and distributed systems.
Encapsulation theory and applications.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
“AI and Expert System Decision Support & Business Intelligence Systems”
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Dropbox Q2 2025 Financial Results & Investor Presentation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Big Data Technologies - Introduction.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Electronic commerce courselecture one. Pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?

Mozilla Web Apps - Super-VanJS