SlideShare a Scribd company logo
1 of 60
Download to read offline






















if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js')
.then(function(registration) {
console.log('Service Worker 登録できた!');
});
}
if ('serviceWorker' in navigator) {
var options = {scope: 'sw/'};
navigator.serviceWorker.register('sw.js', options)
.then(function(registration) {
console.log('sw/ 配下の URL に登録できた!');
});
}
var CACHE_NAME = 'my-site-cache-v1';
var urlsToCache = [ '/', '/style.css', '/script.js'];
self.addEventListener('install', function(event) {
// Perform install steps
event.waitUntil(
caches.open(CACHE_NAME)
.then(function(cache) {
console.log('Opened cache');
return cache.addAll(urlsToCache);
})
);
});


var urlsToCache = [ '/', '/style.css', '/script.js'];

self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request)
.then(function(response) {
// Cache hit - return response
if (response) {
return response;
}
return fetch(event.request);
}
)
);
});














{
"short_name": "れっさーもふもふ",
"name": "レッサーパンダのもふもふ素敵アプリ!",
"icons": [
{
"src": "launcher-icon-3x.png",
"sizes": "144x144",
"type": "image/png"
}
],
"start_url": "index.html",
"display": "standalone"
}


async function registerForPush() {
// Service Worker を登録、
let registration = await navigator.serviceWorker.register('sw.js')
// プッシュ通知を購読済みか確認、
let subscription = await registration.pushManager.getSubscription()
// 未購読であれば購読リクエスト
if (!subscription) {
subscription = await registration.pushManager.subscribe()
}
// サーバ側にも記録
await fetch('/save-push-endpoint', {
method: 'post', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(subscription)
})
// あとは必要時に subscription.endpoint に POST でプッシュ通知!
}


HTML5
CSS3
WebGL
ECMA6
DOM4
HTTP/2
IndexedDB
Service

Workers
WAI-ARIA
WebRTC
Presentation
TCP
asm.js
SVG
Audio
Push
Manifest
WebVR
DNT
Progressive Mobile Web Apps
Progressive Mobile Web Apps

More Related Content

What's hot

Node.js and Web.js
Node.js and Web.jsNode.js and Web.js
Node.js and Web.jsWill Gunn
 
JavaScript Assíncrono
JavaScript AssíncronoJavaScript Assíncrono
JavaScript AssíncronoNatã Barbosa
 
Node.JS
Node.JSNode.JS
Node.JSeibaan
 
HTML5を使ったウェブアプリケーションの高速化
HTML5を使ったウェブアプリケーションの高速化HTML5を使ったウェブアプリケーションの高速化
HTML5を使ったウェブアプリケーションの高速化hagino 3000
 
Invoke y como poner en marcha un entorno de trabajo
Invoke y como poner en marcha un entorno de trabajoInvoke y como poner en marcha un entorno de trabajo
Invoke y como poner en marcha un entorno de trabajoNaN-tic
 
Where to start refactoring?
Where to start refactoring?Where to start refactoring?
Where to start refactoring?thiagoalessio
 
Angularjs 개인견해
Angularjs 개인견해Angularjs 개인견해
Angularjs 개인견해학섭 오
 
Фатальный недостаток Node.js
Фатальный недостаток Node.jsФатальный недостаток Node.js
Фатальный недостаток Node.jsOleksii Okhrymenko
 
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014SPECIA
 
Nodejs party-socket demo
Nodejs party-socket demoNodejs party-socket demo
Nodejs party-socket demoSky Wang
 
JS programowanie obiektowe
JS  programowanie obiektoweJS  programowanie obiektowe
JS programowanie obiektowePiotr Czajkowski
 
Java Script - Object-Oriented Programming
Java Script - Object-Oriented ProgrammingJava Script - Object-Oriented Programming
Java Script - Object-Oriented Programmingintive
 
Week 7 unit3 (chapter 10-11)
Week 7   unit3 (chapter 10-11)Week 7   unit3 (chapter 10-11)
Week 7 unit3 (chapter 10-11)aj.mapling
 
How to stop writing spaghetti code - JSConf.eu 2010
How to stop writing spaghetti code - JSConf.eu 2010How to stop writing spaghetti code - JSConf.eu 2010
How to stop writing spaghetti code - JSConf.eu 2010Tom Croucher
 
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tips
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tipsOpenResty/Lua 70+ Advanced Programming Skills and Optimization tips
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tipsHo Kim
 
Func
FuncFunc
FuncHvqr
 

What's hot (20)

Node.js and Web.js
Node.js and Web.jsNode.js and Web.js
Node.js and Web.js
 
Dart != JavaScript
Dart != JavaScriptDart != JavaScript
Dart != JavaScript
 
JavaScript Assíncrono
JavaScript AssíncronoJavaScript Assíncrono
JavaScript Assíncrono
 
Node.JS
Node.JSNode.JS
Node.JS
 
HTML5を使ったウェブアプリケーションの高速化
HTML5を使ったウェブアプリケーションの高速化HTML5を使ったウェブアプリケーションの高速化
HTML5を使ったウェブアプリケーションの高速化
 
Invoke y como poner en marcha un entorno de trabajo
Invoke y como poner en marcha un entorno de trabajoInvoke y como poner en marcha un entorno de trabajo
Invoke y como poner en marcha un entorno de trabajo
 
Where to start refactoring?
Where to start refactoring?Where to start refactoring?
Where to start refactoring?
 
Angularjs 개인견해
Angularjs 개인견해Angularjs 개인견해
Angularjs 개인견해
 
Фатальный недостаток Node.js
Фатальный недостаток Node.jsФатальный недостаток Node.js
Фатальный недостаток Node.js
 
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
 
Zamyakin
ZamyakinZamyakin
Zamyakin
 
F(1)
F(1)F(1)
F(1)
 
Nodejs party-socket demo
Nodejs party-socket demoNodejs party-socket demo
Nodejs party-socket demo
 
JS programowanie obiektowe
JS  programowanie obiektoweJS  programowanie obiektowe
JS programowanie obiektowe
 
Java Script - Object-Oriented Programming
Java Script - Object-Oriented ProgrammingJava Script - Object-Oriented Programming
Java Script - Object-Oriented Programming
 
Load2
Load2Load2
Load2
 
Week 7 unit3 (chapter 10-11)
Week 7   unit3 (chapter 10-11)Week 7   unit3 (chapter 10-11)
Week 7 unit3 (chapter 10-11)
 
How to stop writing spaghetti code - JSConf.eu 2010
How to stop writing spaghetti code - JSConf.eu 2010How to stop writing spaghetti code - JSConf.eu 2010
How to stop writing spaghetti code - JSConf.eu 2010
 
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tips
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tipsOpenResty/Lua 70+ Advanced Programming Skills and Optimization tips
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tips
 
Func
FuncFunc
Func
 

Viewers also liked

クリエイティブの視点から探るAngular 2の可能性
クリエイティブの視点から探るAngular 2の可能性クリエイティブの視点から探るAngular 2の可能性
クリエイティブの視点から探るAngular 2の可能性Yasunobu Ikeda
 
AngularJS2でつまづいたこと
AngularJS2でつまづいたことAngularJS2でつまづいたこと
AngularJS2でつまづいたことTakehiro Takahashi
 
angular1脳で見るangular2
angular1脳で見るangular2angular1脳で見るangular2
angular1脳で見るangular2Moriyuki Arakawa
 
One Time Binding & Digest Loop
One Time Binding & Digest LoopOne Time Binding & Digest Loop
One Time Binding & Digest LoopKon Yuichi
 
One-time Binding & $digest
One-time Binding & $digestOne-time Binding & $digest
One-time Binding & $digestHayashi Yuichi
 
ng-japan 2015 TypeScript+AngularJS 1.3
ng-japan 2015 TypeScript+AngularJS 1.3ng-japan 2015 TypeScript+AngularJS 1.3
ng-japan 2015 TypeScript+AngularJS 1.3Masahiro Wakame
 
AngularとOnsen UIで作る最高のHTML5ハイブリッドアプリ
AngularとOnsen UIで作る最高のHTML5ハイブリッドアプリAngularとOnsen UIで作る最高のHTML5ハイブリッドアプリ
AngularとOnsen UIで作る最高のHTML5ハイブリッドアプリアシアル株式会社
 
業務アプリケーションにおけるモダンWeb開発の現状ーHTML5開発って簡単なの?
業務アプリケーションにおけるモダンWeb開発の現状ーHTML5開発って簡単なの?業務アプリケーションにおけるモダンWeb開発の現状ーHTML5開発って簡単なの?
業務アプリケーションにおけるモダンWeb開発の現状ーHTML5開発って簡単なの?Fumio SAGAWA
 
TechFeedのつくりかた - Angular2/Webpack/Ionic2/Cordova実践入門
TechFeedのつくりかた - Angular2/Webpack/Ionic2/Cordova実践入門TechFeedのつくりかた - Angular2/Webpack/Ionic2/Cordova実践入門
TechFeedのつくりかた - Angular2/Webpack/Ionic2/Cordova実践入門Shumpei Shiraishi
 

Viewers also liked (14)

クリエイティブの視点から探るAngular 2の可能性
クリエイティブの視点から探るAngular 2の可能性クリエイティブの視点から探るAngular 2の可能性
クリエイティブの視点から探るAngular 2の可能性
 
Angular2実践入門
Angular2実践入門Angular2実践入門
Angular2実践入門
 
AngularJS2でつまづいたこと
AngularJS2でつまづいたことAngularJS2でつまづいたこと
AngularJS2でつまづいたこと
 
angular1脳で見るangular2
angular1脳で見るangular2angular1脳で見るangular2
angular1脳で見るangular2
 
SPAと覚悟
SPAと覚悟SPAと覚悟
SPAと覚悟
 
One Time Binding & Digest Loop
One Time Binding & Digest LoopOne Time Binding & Digest Loop
One Time Binding & Digest Loop
 
Dart on Raspberry Pi
Dart on Raspberry PiDart on Raspberry Pi
Dart on Raspberry Pi
 
20160927 reactmeetup
20160927 reactmeetup20160927 reactmeetup
20160927 reactmeetup
 
One-time Binding & $digest
One-time Binding & $digestOne-time Binding & $digest
One-time Binding & $digest
 
ng-japan 2015 TypeScript+AngularJS 1.3
ng-japan 2015 TypeScript+AngularJS 1.3ng-japan 2015 TypeScript+AngularJS 1.3
ng-japan 2015 TypeScript+AngularJS 1.3
 
AngularとOnsen UIで作る最高のHTML5ハイブリッドアプリ
AngularとOnsen UIで作る最高のHTML5ハイブリッドアプリAngularとOnsen UIで作る最高のHTML5ハイブリッドアプリ
AngularとOnsen UIで作る最高のHTML5ハイブリッドアプリ
 
業務アプリケーションにおけるモダンWeb開発の現状ーHTML5開発って簡単なの?
業務アプリケーションにおけるモダンWeb開発の現状ーHTML5開発って簡単なの?業務アプリケーションにおけるモダンWeb開発の現状ーHTML5開発って簡単なの?
業務アプリケーションにおけるモダンWeb開発の現状ーHTML5開発って簡単なの?
 
TechFeedのつくりかた - Angular2/Webpack/Ionic2/Cordova実践入門
TechFeedのつくりかた - Angular2/Webpack/Ionic2/Cordova実践入門TechFeedのつくりかた - Angular2/Webpack/Ionic2/Cordova実践入門
TechFeedのつくりかた - Angular2/Webpack/Ionic2/Cordova実践入門
 
Server Side Dart
Server Side DartServer Side Dart
Server Side Dart
 

More from dynamis

HTTP and 5G (fixed1)
HTTP and 5G (fixed1)HTTP and 5G (fixed1)
HTTP and 5G (fixed1)dynamis
 
HTTP and 5G
HTTP and 5GHTTP and 5G
HTTP and 5Gdynamis
 
HTTP and 5G partial draft
HTTP and 5G partial draftHTTP and 5G partial draft
HTTP and 5G partial draftdynamis
 
Web App Platform Strategy
Web App Platform StrategyWeb App Platform Strategy
Web App Platform Strategydynamis
 
HTML5 & Renesas RZ/G
HTML5 & Renesas RZ/GHTML5 & Renesas RZ/G
HTML5 & Renesas RZ/Gdynamis
 
Life of html5 (osaka)
Life of html5 (osaka)Life of html5 (osaka)
Life of html5 (osaka)dynamis
 
Web updates 2017
Web updates 2017Web updates 2017
Web updates 2017dynamis
 
Life of HTML5
Life of HTML5Life of HTML5
Life of HTML5dynamis
 
Browsers in IoT Era
Browsers in IoT EraBrowsers in IoT Era
Browsers in IoT Eradynamis
 
New Norm of HTML5
New Norm of HTML5New Norm of HTML5
New Norm of HTML5dynamis
 
Edge Web Technologies and Browser Vendors (Updated on 2016/09/06)
Edge Web Technologies and Browser Vendors (Updated on 2016/09/06)Edge Web Technologies and Browser Vendors (Updated on 2016/09/06)
Edge Web Technologies and Browser Vendors (Updated on 2016/09/06)dynamis
 
OSC2016.Enterprise Lightnig Talk
OSC2016.Enterprise Lightnig TalkOSC2016.Enterprise Lightnig Talk
OSC2016.Enterprise Lightnig Talkdynamis
 
Demo for Gecko Embedded
Demo for Gecko EmbeddedDemo for Gecko Embedded
Demo for Gecko Embeddeddynamis
 
Project Gecko Embedded
Project Gecko EmbeddedProject Gecko Embedded
Project Gecko Embeddeddynamis
 
The New Norm of The Web
The New Norm of The WebThe New Norm of The Web
The New Norm of The Webdynamis
 
Web Tech & Architecture
Web Tech & ArchitectureWeb Tech & Architecture
Web Tech & Architecturedynamis
 
Data Privacy meeting
Data Privacy meetingData Privacy meeting
Data Privacy meetingdynamis
 
Firefox OS TV
Firefox OS TVFirefox OS TV
Firefox OS TVdynamis
 
Inspect Hack Ignite!
Inspect Hack Ignite!Inspect Hack Ignite!
Inspect Hack Ignite!dynamis
 
Years with JavaScript.Next
Years with JavaScript.NextYears with JavaScript.Next
Years with JavaScript.Nextdynamis
 

More from dynamis (20)

HTTP and 5G (fixed1)
HTTP and 5G (fixed1)HTTP and 5G (fixed1)
HTTP and 5G (fixed1)
 
HTTP and 5G
HTTP and 5GHTTP and 5G
HTTP and 5G
 
HTTP and 5G partial draft
HTTP and 5G partial draftHTTP and 5G partial draft
HTTP and 5G partial draft
 
Web App Platform Strategy
Web App Platform StrategyWeb App Platform Strategy
Web App Platform Strategy
 
HTML5 & Renesas RZ/G
HTML5 & Renesas RZ/GHTML5 & Renesas RZ/G
HTML5 & Renesas RZ/G
 
Life of html5 (osaka)
Life of html5 (osaka)Life of html5 (osaka)
Life of html5 (osaka)
 
Web updates 2017
Web updates 2017Web updates 2017
Web updates 2017
 
Life of HTML5
Life of HTML5Life of HTML5
Life of HTML5
 
Browsers in IoT Era
Browsers in IoT EraBrowsers in IoT Era
Browsers in IoT Era
 
New Norm of HTML5
New Norm of HTML5New Norm of HTML5
New Norm of HTML5
 
Edge Web Technologies and Browser Vendors (Updated on 2016/09/06)
Edge Web Technologies and Browser Vendors (Updated on 2016/09/06)Edge Web Technologies and Browser Vendors (Updated on 2016/09/06)
Edge Web Technologies and Browser Vendors (Updated on 2016/09/06)
 
OSC2016.Enterprise Lightnig Talk
OSC2016.Enterprise Lightnig TalkOSC2016.Enterprise Lightnig Talk
OSC2016.Enterprise Lightnig Talk
 
Demo for Gecko Embedded
Demo for Gecko EmbeddedDemo for Gecko Embedded
Demo for Gecko Embedded
 
Project Gecko Embedded
Project Gecko EmbeddedProject Gecko Embedded
Project Gecko Embedded
 
The New Norm of The Web
The New Norm of The WebThe New Norm of The Web
The New Norm of The Web
 
Web Tech & Architecture
Web Tech & ArchitectureWeb Tech & Architecture
Web Tech & Architecture
 
Data Privacy meeting
Data Privacy meetingData Privacy meeting
Data Privacy meeting
 
Firefox OS TV
Firefox OS TVFirefox OS TV
Firefox OS TV
 
Inspect Hack Ignite!
Inspect Hack Ignite!Inspect Hack Ignite!
Inspect Hack Ignite!
 
Years with JavaScript.Next
Years with JavaScript.NextYears with JavaScript.Next
Years with JavaScript.Next
 

Progressive Mobile Web Apps

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 11.
  • 12.
  • 14.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37. if ('serviceWorker' in navigator) { navigator.serviceWorker.register('sw.js') .then(function(registration) { console.log('Service Worker 登録できた!'); }); } if ('serviceWorker' in navigator) { var options = {scope: 'sw/'}; navigator.serviceWorker.register('sw.js', options) .then(function(registration) { console.log('sw/ 配下の URL に登録できた!'); }); }
  • 38. var CACHE_NAME = 'my-site-cache-v1'; var urlsToCache = [ '/', '/style.css', '/script.js']; self.addEventListener('install', function(event) { // Perform install steps event.waitUntil( caches.open(CACHE_NAME) .then(function(cache) { console.log('Opened cache'); return cache.addAll(urlsToCache); }) ); });
  • 39.
  • 40.
  • 41.
  • 42. var urlsToCache = [ '/', '/style.css', '/script.js'];
 self.addEventListener('fetch', function(event) { event.respondWith( caches.match(event.request) .then(function(response) { // Cache hit - return response if (response) { return response; } return fetch(event.request); } ) ); });
  • 43.
  • 46.
  • 47.
  • 48. { "short_name": "れっさーもふもふ", "name": "レッサーパンダのもふもふ素敵アプリ!", "icons": [ { "src": "launcher-icon-3x.png", "sizes": "144x144", "type": "image/png" } ], "start_url": "index.html", "display": "standalone" }
  • 49.
  • 50.
  • 51.
  • 52. async function registerForPush() { // Service Worker を登録、 let registration = await navigator.serviceWorker.register('sw.js') // プッシュ通知を購読済みか確認、 let subscription = await registration.pushManager.getSubscription() // 未購読であれば購読リクエスト if (!subscription) { subscription = await registration.pushManager.subscribe() } // サーバ側にも記録 await fetch('/save-push-endpoint', { method: 'post', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(subscription) }) // あとは必要時に subscription.endpoint に POST でプッシュ通知! }
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.