Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A lap around Chrome apps & extensions

A lap around Chrome apps & extensions

Google Chrome is built with extensibility in mind, allowing us to create fantastic apps and extensions for the platform in HTML5, JavaScript and CSS. Although modern web technologies are used, Chrome apps look and behave just like native apps with native capabilities. Fanie Reynders unveils how easy it is to create these apps and extensions for this powerful browser.

Watch the recording of the talk here: https://www.youtube.com/watch/-MUv4hYnEWI

Fanie Reynders

April 23, 2015
Tweet

More Decks by Fanie Reynders

Other Decks in Programming

Transcript

  1. Agenda  Packaged apps  Browser extensions  Deployment to

    Chrome Webstore  Port to mobile  ARC Welder
  2. App container model Your app in the cloud App code

    stored locally Main page opens in container User installs app User launches app
  3. What are Chrome apps?  Runs on Chrome (outside the

    browser)  Built with HTML5, CSS & JavaScript  Experience similar to a native app  Offline by default  Access to rich set of native APIs
  4. Why Chrome apps?  Instant multi-platform support  Expand your

    audience (Chromebook)  Integrate seamlessly into the desktop  Richer experience than traditional web apps  Easily find & start apps with Chrome App launcher  Integrated in OS  Search in Windows 8.x  Spotlight in OS X
  5. Chrome app components  Manifest  Background script  App

    files – HTML, CSS, JavaScript  Icons
  6. Manifest.json  JSON  Manifest version – must be 2

     App name & version  Icons  Background script  Required API permissions { "manifest_version": 2, "name": "Hello Fixxup", "version": "0.1", "icons": { "16": "icon_16.png", "128": "icon_128.png" }, "app": { "background": { "scripts": ["main.js"] } }, "permissions": [ "storage", "videoCapture" ], }
  7. Background script  Installation  Launch  Suspended chrome.runtime.onInstalled.addListener(function(){ //

    set up database }); chrome.app.runtime.onLaunched.addListener(function(){ chrome.app.window.create('views/index.html'); }); chrome.runtime.onSuspend.addListener(function(){ // clean up });
  8. Packaged apps security model  Process & storage isolation 

    Content Security Policy (CSP) { "manifest_version": 2, "name": "Hello Fixxup", "version": "0.1", "icons": { "16": "icon_16.png", "128": "icon_128.png" }, "app": { "background": { "scripts": ["main.js"] } }, } "sandbox": { "pages “: ["special.html"] }
  9. Packaged apps security model  Process & storage isolation 

    Content Security Policy (CSP)  Permissions { "manifest_version": 2, "name": "Hello Fixxup", "version": "0.1", "icons": { "16": "icon_16.png", "128": "icon_128.png" }, "app": { "background": { "scripts": ["main.js"] } }, } "permissions": [ "storage", "videoCapture" ],
  10. Packaged apps security model  Process & storage isolation 

    Content Security Policy (CSP)  Permissions  Webview Tag <webview id="foo" src="http://www.google.com/" style="width:640px; height:480px"></webview>
  11. Chrome extensions  Adds additional features to the browser 

    Built with HTML5, CSS & JavaScript  Installs like conventional apps  Has access to APIs provided by the browser
  12. Manifest.json  JSON  Manifest version – must be 2

     Name, version & description  Icons  Background script  Required API permissions