Progressive web application

Progressive web application ou PWA est une application web avec sa propre fenêtre.

Généralité

Organisation

Les fichiers suivants constituent l'application :

  • index.htm : fichier principal
  • manifest.json : contient les informations pour l'installation en tant qu'application
  • screen.css : feuille de style
  • script.js : script en JavaScript pour la partie dynamique de l'application
  • sw.js : service-worker

manifest.json

Exemple de fichier manifest.json

{
  "lang": "fr-fr",
  "name": "SW",
  "short_name": "SWsn",
  "description": "Test de Service-Worker",
  "start_url": "./",
  "background_color": "#aaaaaa",
  "theme_color": "#f3d58",
  "orientation": "any",
  "display": "browser",
  "icons": [
		{
			"src": "./icon512.png",
			"sizes": "512x512"
		}
	]
}
Option Valeur Résultat Commentaire
display: browser Comportement classique (barre d'adresse, onglets...)
minimal-ui Barre d'adresse minimale, pas d'onglets
standalone Fenêtre propre, sans chrome navigateur
fullscreen Plein écran, sans aucune interface système

Voir aussi