PWA Cheat Sheet 2023
2
3
web.dev/learn/pwa
PWA Cheat Sheet 2023
5
PWA Cheat Sheet 2023
PWA Cheat Sheet 2023
App built with web technologies
It works fast while online or offline
It can be installed on different platforms
Idealforallthoseappsthat
consumewebcontentorweb
services
10
11
Web App
Web App
Web App
Service Worker
Web App
Web App
Web App
Service Worker
Distribution
Web App
Web App
Web App
No Service Worker
Distribution
3
Responsive Web Design
Progressive Enhancement Everything First
Web Performance
Web App Foundations
State of the Platform
PWA Support - Mobile
PWA Support - VR
PWA Support - Desktop
Win 7 / 8.x
Linux
PWA Support
Offline Support within a browser: 96%
App Experience with Icon installation: 92%
webview
webview
No Installation Support
Basic PWA support
Service Worker (Optional)
Web App Manifest
Web Performance
App Experience
Platform Integration
Installation Experience
Installation Experience
1.1 Custom Install UI
Render infobar or
banner (cancellable)
Add a badge Create a desktop
menu item and
Android with
WebAPK
my.app
Add this App to Home screen
my.app + Install
Allow developer to
provide a custom
install button
my.app
Install App
my.app
Install this App
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Installation Availability Will...
my.app
Install App
Create a Custom Install Promotion
my.app
Install
lorem ipsum
lorem ipsum
lorem ipsum
my.app
Install this App in your device
beforeinstallprompt
Event
It was part of Web App Manifest spec
Now implemented by Chromium only
Event is fired when:
- - Current URL passes the PWA criteria
- - The PWA is not already installed
Promote Install through a Custom UI
window.addEventListener('beforeinstallprompt', event => {
});
script.js
Available only on Chromium-based browser
Promote Install through a Custom UI
window.addEventListener('beforeinstallprompt', event => {
// we prevent a banner or infobar to appear
event.preventDefault();
});
script.js
Available only on Chromium-based browser
Promote Install through a Custom UI
// we save the prompt event in a global variable
let installPromptEvent;
window.addEventListener('beforeinstallprompt', event => {
// we prevent a banner or infobar to appear
event.preventDefault();
});
script.js
Available only on Chromium-based browser
Promote Install through a Custom UI
// we save the prompt event in a global variable
let installPromptEvent;
window.addEventListener('beforeinstallprompt', event => {
// we prevent a banner or infobar to appear
event.preventDefault();
// we save the event for later usage
installPromptEvent = event
});
script.js
Available only on Chromium-based browser
Promote Install through a Custom UI
// we save the prompt event in a global variable
let installPromptEvent;
installButton.addEventListener('click', event => {
});
script.js
Available only on Chromium-based browser
Promote Install through a Custom UI
// we save the prompt event in a global variable
let installPromptEvent;
installButton.addEventListener('click', event => {
if (installPromptEvent) {
installPromptEvent.prompt();
} else {
// Prompt not available: Display fallback instructions
}
});
script.js
Available only on Chromium-based browser
Installation Experience
1.2 Enhanced Dialog
Installation Installation Banner
Improved
Installation
Banner
Available on Android
Coming soon to desktop
"Add to Homescreen" to "Install"
It includes: app's icon, name, description
and screenshots
You need to provide in your manifest:
- Description
- Screenshots (array of images)
Installation Experience
1.3 Identi
fi
cation
PWA Identification
Originally, we didn't have any way to identify
a PWA
Is it the origin?
Is it the start_url?
Is it the manifest url?
On every OS is different
Why is it important?
New id member
{
"id": "pwa-id"
"start_url" :/"
}
app.webmanifest
Used only on Chromium on desktop as of today
id member
If you deployed your app before 2021, use
Chrome DevTools and use
Computed App Id defined in Manifest section
If you are deploying the PWA now, define the
id property of your own
Any string that will be unique within your
origin
PWA Cheat Sheet 2023
Basic PWA support
Service Worker (Optional)
Web App Manifest
Web Performance
Installation Experience
Custom Install UI
Enhanced Android Dialog
App Identi
fi
cation
App Experience
2.1 App Icons & Splash Screens
PWA Icons on Android
A maskable icon will solve
the problem; it's still a square
icon but with enough
discardable padding content
out of a safe area
Safe Area on Maskable Icons
Safe Area on Maskable Icons
Radius 40%
Safe Area on Maskable Icons
Safe Area on Maskable Icons
Safe Area on Maskable Icons
Safe Area on Maskable Icons
Safe Area on Maskable Icons
Safe Area on Maskable Icons
Safe Area on Maskable Icons
Safe Area on Maskable Icons
"icons": [
{
"src": "icon.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "maskable.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
• Maskable Icon
• Recommended size: 512x512
• purpose: "maskable"
Web app manifest
Online Tool for Maskable Icons
Safari ignores icons with
maskable in App Manifest
App Manifest Icons on iOS and iPadOS
<link rel="apple-touch-icon" href="ios_icon.png">
PWA Icons for iOS and iPadOS
We need to define one or more icons in the HTML file as a link element
If not present, it will use a non-maskable icon from the manifest
If one icon for all will be
provided, it should be a
180x180 PNG
SVG Icons
Chromium on desktop
Chrome on Android coming!
Icon
Recommendation
One 512x512 non-maskable icon
One 512x512 maskable icon
One 180x180 iOS/iPadOS icon
One SVG icon
Splash Screens on Android
Automatically generated
by the browser
You can't create your own
images
My Great PWA
Splash Screens on Android
theme_color
background_color
icon (512x512 preferred)
name
<link rel="apple-touch-startup-image" href="splash.png">
Startup Image for iOS and iPadOS
We define it through a link element
The problem on Safari is that
it needs the image with the
exact size of the device's
screen
Split-view
Differences over Android Solution
Full Customization Dark mode Needs lot of work
Providing Startup Images for iOS and iPadOS
Manually Static generator Client-side library Server-side
library
Static Generator: pwa-asset-generator
Static Generator: pwa-asset-generator
<meta name="apple-mobile-web-app-capable" content="yes">
Meta tag is mandatory for Startup Images!
We define it through a meta element
App Experience
2.2 Theming
PWA Cheat Sheet 2023
PWA Cheat Sheet 2023
PWA Cheat Sheet 2023
Theme Color Web App Manifest
{
"theme_color": "pink"
}
app.webmanifest
Theme Color Meta Tag
<meta name="theme-color" content="pink">
index.html
Dynamic Theme Color Meta Tag
document.querySelector("meta[name=theme-color]")
.content = "pink"
index.html
CSS Accent Color (new)
input {
accent-color: pink
}
styles.css
☯
Theme Color Meta Tag
<meta name="theme-color"
media="(prefers-color-scheme: light)"
content="pink">
<meta name="theme-color"
media="(prefers-color-scheme: dark)"
content="salmon">
index.html
CSS Accent Color (new)
:root {
color-scheme: light dark;
}
input {
accent-color: pink
}
@media (prefers-color-scheme: dark) {
input {
accent-color: salmon
}
}
styles.css
App Experience
2.3 Desktop Enhancements
86
(A) <title>
(B) Controlling Windows
(C) New APIs
Desktop Enhancements
The new life of
<title>
Not for SEO anymore
OS window's title
Use your exact app's name in the string
88
89
90
Controlling Desktop Windows
window.moveTo(16, 16);
window.resizeTo(800, 600);
window.open("", "_blank", "");
Script
Nostalgia time
92
Multi-Screen Windows Placement API
const screenDetails = await window.getScreenDetails();
screenDetails.addEventListener('screenschange', e() => {
}
Script
Advanced Screen Management
Windows Controls Overlay
{
"display": "standalone",
"display_override": ["window-controls-overlay"]
}
app.webmanifest
Let us render content in the title bar
95
Basic PWA support
Service Worker (Optional)
Web App Manifest
Web Performance
App Experience
App
Th
eming
App Icons and Splash Screens
Desktop Enhancements
Installation Experience
Custom Install UI
Enhanced Android Dialog
App Identi
fi
cation
Platform Integration
3.1 Modern Authentication
98
(A) Web Authn
(B) Passkeys
(C) Bye Captcha!
Modern Authentication
Web Authentication
FIDO
Authentication agnostic
Biometrics
Security Keys
New ideas
Password+WebAuthn
Passwordless
•Windows Hello
•Chrome desktop
•Android biometrics
•FaceID and TouchID on macOS, iOS and iPadOS
•PassKey
•Private Access Tokens
Platform Integration
3.2 Background execution
107
(A) Background Sync
(B) Periodic Sync
(C) Web Push
Background Execution
Background
Sync
PWA defers a sync action until the device has
a stable connection to the server
A 'sync' event will be fired in the Service
Worker to handle a pending sync:
•Immediately if network is stable
•Later, when network go back to stable
•If battery is in good level
We access the network and fulfill
the sync or leave it pending
Execution happens in the background
Step 1: Register a Background Sync Action
script.js
Available from the window or service worker's contexts
Step 1: Register a Background Sync Action
if ('SyncManager' in window) {
const registration = await navigator.serviceWorker.ready;
registration.sync.register("tag-name");
}
script.js
Available from the window or service worker's contexts
Step 2: Handle the Sync Action
serviceworker.js
This happens in the service worker's context at any moment
Step 2: Handle the Sync Action
self.addEventListener('sync', event => {
if (event.tag == 'tag-name') {
event.waitUntil(syncOperation());
}
});
serviceworker.js
This happens in the service worker's context at any moment
Periodic
Background
Sync
PWA asks user for permission to periodically
execute code in the background
A 'periodicsync' event will be fired in
the Service Worker:
•On a synchronization time interval
•If battery and network conditions are met
We typically access the network on each
execution, but it's not mandatory
Execution happens in the background
Execution frequency will be
honored based on a Site
Engagement Score defined
by the browser
Step 1: Ask for Periodic Sync Permission
script.js
Permission will be granted based on Site Engagement Score
Step 1: Ask for Periodic Sync Permission
const permissionStatus = await navigator.permissions.query({
name: 'periodic-background-sync',
});
script.js
Permission will be granted based on Site Engagement Score
Step 2: Register a Background Sync Operation
script.js
It requires a tag and a synchronization interval in milliseconds
Step 2: Register a Background Sync Operation
const registration = await navigator.serviceWorker.ready;
await registration.periodicSync.register('sync-tag', {
minInterval: 24 * 60 * 60 * 1000 // One day
});
}
script.js
It requires a tag and a synchronization interval in milliseconds
Step 2: Register a Background Sync Operation
const registration = await navigator.serviceWorker.ready;
if ('periodicSync' in registration) {
try {
await registration.periodicSync.register('sync-tag', {
minInterval: 24 * 60 * 60 * 1000 // One day
});
} catch (error) { }
}
script.js
It requires a tag and a synchronization interval in milliseconds
Step 3: Handle the Periodic Sync Operation
serviceworker.js
It will be executed in the Service Worker
Step 3: Handle the Periodic Sync Operation
self.addEventListener('periodicsync', (event) => {
if (event.tag === 'sync-tag') {
event.waitUntil(doPeriodicSyncOperation());
}
});
serviceworker.js
It will be executed in the Service Worker
Web Push
Notifications
PWA asks permission to send notifications
to the user
If granted, now the service worker can create
a notification from the background
Also, the PWA can subscribe the user to Push
A 'push' event will be fired in the Service
Worker to handle a push
Firefox, Chrome, Edge, Samsung Internet
Safari?
Safari will support Web Push
on macOS Ventura
iOS and iPadOS
coming in 2023 👏
Platform Integration
3.3 OS Integration
125
(A) File and Protocol
Handling
(B) Web Share Target
(C) Media Session
OS Integration
File Handling
{
"file_handlers": [
{
"action": "/readcsv",
"accept": {
"text/csv": [".csv"]
},
"icons": [
// ...
],
"launch_type": "single-client"
},
}
app.webmanifest
Protocol Handling
{
"protocol_handlers": [
{
"protocol": "web+devfest",
"url": "/conference?argument=%s"
},
}
app.webmanifest
Reading web+developerweek:// protocol
Web Share Target
{
"share_target": {
"action": "/receiving-share/",
"method": "GET",
"params": {
"id": "id",
"text": "contents",
}
}
}
app.webmanifest
Receive Share Actions
129
130
131
Media Session
navigator.mediaSession.metadata = new MediaMetadata({
title: 'Best Song',
artist: 'Max Firtman',
album: 'Progressive Web Apps',
artwork: [ /* ... */ ]
});
// actions: play, pause, stop, previous track, nexttrack, ...
navigator.mediaSession.setActionHandler(action, e => {});
script.js
Receive Share Actions
Basic PWA support
Service Worker (Optional)
Web App Manifest
Web Performance
App Experience
App
Th
eming
App Icons and Splash Screens
Desktop Enhancements
Platform Integration
Modern Authentication
Background Execution
OS Integration
Installation Experience
Custom Install UI
Enhanced Android Dialog
App Identi
fi
cation
134
The Web evolves frequently
Stay on top of new capabilities
Progressive Enhancement!
135
web.dev/learn/pwa
PWA Cheat Sheet 2023

More Related Content

PDF
Building a Progressive Web App
PPTX
Introduction of Progressive Web App
PDF
Mobile application development React Native - Tidepool Labs
PPTX
Pwa demystified
PPTX
PDF
Introduction to Progressive web app (PWA)
PPTX
Progressive web app
PPTX
PWA - Progressive Web App
Building a Progressive Web App
Introduction of Progressive Web App
Mobile application development React Native - Tidepool Labs
Pwa demystified
Introduction to Progressive web app (PWA)
Progressive web app
PWA - Progressive Web App

What's hot (20)

PPTX
Introduction to mobile application development
PDF
App Store Optimization - 2020 Ultimate Guide for Google Play Store ASO
PPTX
Introduction to Flutter
PPTX
Microsoft power apps
PPTX
Hybrid mobile app
PPTX
Mobile Application Development Services-MobileApptelligence
PPTX
What and Why Flutter? What is a Widget in Flutter?
PPTX
Progressive Web Apps and React
PDF
Progressive Web Apps / GDG DevFest - Season 2016
PPTX
Introduction to App Store Optimization
PPTX
Flutter introduction
PPTX
Firefox operating system
PDF
Progressive Web Applications
PDF
Native vs. Hybrid Apps
PDF
Progressive web apps
PPTX
Flutter
PDF
ExpressJS-Introduction.pdf
PPTX
Android ppt
Introduction to mobile application development
App Store Optimization - 2020 Ultimate Guide for Google Play Store ASO
Introduction to Flutter
Microsoft power apps
Hybrid mobile app
Mobile Application Development Services-MobileApptelligence
What and Why Flutter? What is a Widget in Flutter?
Progressive Web Apps and React
Progressive Web Apps / GDG DevFest - Season 2016
Introduction to App Store Optimization
Flutter introduction
Firefox operating system
Progressive Web Applications
Native vs. Hybrid Apps
Progressive web apps
Flutter
ExpressJS-Introduction.pdf
Android ppt
Ad

Similar to PWA Cheat Sheet 2023 (20)

PPTX
XboxAppDev 4. Web Apps on Xbox
PDF
Make your PWA feel more like an app
PPTX
Android CI and Appium
PPT
PPTX
20141216 멜팅팟 부산 세션 ii - cross platform 개발
KEY
Flash Builder and Flex Future - Multiscreen Development
PPTX
Xamarin Test Cloud - from zero to hero in automated ui testing
PPTX
Progressive Web Apps 101
PDF
Building cross platform web apps
PDF
WebAPIs & Apps - Mozilla London
PPTX
Kony - End-to-End Proof of Technology
PDF
Web APIs & Apps - Mozilla
PDF
Service Worker 201 (en)
PPTX
[Devoxx Morocco 2015] Apache Cordova In Action
PPTX
Telerik AppBuilder Presentation for TelerikNEXT Conference
PPTX
How to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptx
KEY
Introduction to Flex Hero for Mobile Devices
PPT
Android & iOS Automation Using Appium
PPTX
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
PDF
Introduction To Mobile-Automation
XboxAppDev 4. Web Apps on Xbox
Make your PWA feel more like an app
Android CI and Appium
20141216 멜팅팟 부산 세션 ii - cross platform 개발
Flash Builder and Flex Future - Multiscreen Development
Xamarin Test Cloud - from zero to hero in automated ui testing
Progressive Web Apps 101
Building cross platform web apps
WebAPIs & Apps - Mozilla London
Kony - End-to-End Proof of Technology
Web APIs & Apps - Mozilla
Service Worker 201 (en)
[Devoxx Morocco 2015] Apache Cordova In Action
Telerik AppBuilder Presentation for TelerikNEXT Conference
How to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptx
Introduction to Flex Hero for Mobile Devices
Android & iOS Automation Using Appium
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
Introduction To Mobile-Automation
Ad

More from Maximiliano Firtman (20)

PDF
Unlocking Generative AI in your Web Apps
PDF
ChatGPT and AI for Web Developers
PDF
Hacking Web Performance en Español - JSConf México 2020
PDF
The modern PWA Cheat Sheet
PDF
Hacking Web Performance 2019
PDF
Progressive Web Apps Keynote
PDF
Hacking Web Performance
PDF
Uncovering Secrets of Progressive Web Apps
PDF
Hacking Web Performance
PDF
Hacking Web Performance @ ForwardJS 2017
PDF
La Web Salta al Mundo Físico - Web meets Physical World (spanish)
PDF
Progressive Web Apps (español - spanish)
PDF
High Performance Web - Full Stack Toronto
PDF
Responsive Images and Performance
PDF
The Physical World meets the Web
PDF
Extreme Web Performance for Mobile Devices
PDF
Extreme Web Performance for Mobile Device Fluent 2015
PDF
Extreme Web Performance for Mobile Devices - Velocity Barcelona 2014
PDF
Extreme Web Performance for Mobile Devices - Velocity NY
PDF
Extreme Web Performance for Mobile Devices
Unlocking Generative AI in your Web Apps
ChatGPT and AI for Web Developers
Hacking Web Performance en Español - JSConf México 2020
The modern PWA Cheat Sheet
Hacking Web Performance 2019
Progressive Web Apps Keynote
Hacking Web Performance
Uncovering Secrets of Progressive Web Apps
Hacking Web Performance
Hacking Web Performance @ ForwardJS 2017
La Web Salta al Mundo Físico - Web meets Physical World (spanish)
Progressive Web Apps (español - spanish)
High Performance Web - Full Stack Toronto
Responsive Images and Performance
The Physical World meets the Web
Extreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile Device Fluent 2015
Extreme Web Performance for Mobile Devices - Velocity Barcelona 2014
Extreme Web Performance for Mobile Devices - Velocity NY
Extreme Web Performance for Mobile Devices

Recently uploaded (20)

PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PPTX
Trending Python Topics for Data Visualization in 2025
PPTX
Computer Software - Technology and Livelihood Education
PPTX
Patient Appointment Booking in Odoo with online payment
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
Microsoft Office 365 Crack Download Free
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PDF
Visual explanation of Dijkstra's Algorithm using Python
PPTX
Introduction to Windows Operating System
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
Tech Workshop Escape Room Tech Workshop
PPTX
CNN LeNet5 Architecture: Neural Networks
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PDF
AI Guide for Business Growth - Arna Softech
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
DNT Brochure 2025 – ISV Solutions @ D365
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
Trending Python Topics for Data Visualization in 2025
Computer Software - Technology and Livelihood Education
Patient Appointment Booking in Odoo with online payment
"Secure File Sharing Solutions on AWS".pptx
Microsoft Office 365 Crack Download Free
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
Visual explanation of Dijkstra's Algorithm using Python
Introduction to Windows Operating System
How Tridens DevSecOps Ensures Compliance, Security, and Agility
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Tech Workshop Escape Room Tech Workshop
CNN LeNet5 Architecture: Neural Networks
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
AI Guide for Business Growth - Arna Softech
Topaz Photo AI Crack New Download (Latest 2025)
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx

PWA Cheat Sheet 2023