際際滷

際際滷Share a Scribd company logo
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
?
?
?
?
?
?
?
Progressive Mobile Web Apps
?
?
?
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
?
Progressive Mobile Web Apps
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js')
.then(function(registration) {
console.log('Service Worker 鞠hできた');
});
}
if ('serviceWorker' in navigator) {
var options = {scope: 'sw/'};
navigator.serviceWorker.register('sw.js', options)
.then(function(registration) {
console.log('sw/ 塘和の URL に鞠hできた');
});
}
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);
})
);
});
Progressive Mobile Web Apps
Progressive Mobile Web Apps
?
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);
}
)
);
});
Progressive Mobile Web Apps
?
?
?
?
?
?
?
Progressive Mobile Web Apps
Progressive Mobile Web Apps
{
"short_name": "れっさ`もふもふ",
"name": "レッサ`パンダのもふもふ殆灰▲廛蝪",
"icons": [
{
"src": "launcher-icon-3x.png",
"sizes": "144x144",
"type": "image/png"
}
],
"start_url": "index.html",
"display": "standalone"
}
?
Progressive Mobile Web Apps
Progressive Mobile Web Apps
async function registerForPush() {
// Service Worker を鞠h、
let registration = await navigator.serviceWorker.register('sw.js')
// プッシュ宥岑をigみか_J、
let subscription = await registration.pushManager.getSubscription()
// 隆iであればiリクエスト
if (!subscription) {
subscription = await registration.pushManager.subscribe()
}
// サ`バ箸砲瞋h
await fetch('/save-push-endpoint', {
method: 'post', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(subscription)
})
// あとは駅勣rに subscription.endpoint に POST でプッシュ宥岑
}
Progressive Mobile Web Apps
Progressive Mobile Web Apps
Progressive Mobile Web Apps
?
Progressive Mobile Web Apps
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

Progressive Mobile Web Apps

  • 10. ? ?
  • 11. ?
  • 12. ?
  • 13. ? ? ?
  • 15. ? ? ?
  • 35. ?
  • 37. if ('serviceWorker' in navigator) { navigator.serviceWorker.register('sw.js') .then(function(registration) { console.log('Service Worker 鞠hできた'); }); } if ('serviceWorker' in navigator) { var options = {scope: 'sw/'}; navigator.serviceWorker.register('sw.js', options) .then(function(registration) { console.log('sw/ 塘和の URL に鞠hできた'); }); }
  • 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); }) ); });
  • 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); } ) ); });
  • 45. ? ? ?
  • 48. { "short_name": "れっさ`もふもふ", "name": "レッサ`パンダのもふもふ殆灰▲廛蝪", "icons": [ { "src": "launcher-icon-3x.png", "sizes": "144x144", "type": "image/png" } ], "start_url": "index.html", "display": "standalone" }
  • 49. ?
  • 52. async function registerForPush() { // Service Worker を鞠h、 let registration = await navigator.serviceWorker.register('sw.js') // プッシュ宥岑をigみか_J、 let subscription = await registration.pushManager.getSubscription() // 隆iであればiリクエスト if (!subscription) { subscription = await registration.pushManager.subscribe() } // サ`バ箸砲瞋h await fetch('/save-push-endpoint', { method: 'post', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(subscription) }) // あとは駅勣rに subscription.endpoint に POST でプッシュ宥岑 }
  • 56. ?