[flutter_tools][web] Add basic service worker generation support to web applications (#48344)

This commit is contained in:
Jonah Williams
2020-01-13 17:13:02 -08:00
committed by Flutter GitHub Bot
parent 0a600e1ddc
commit 9f145f6ced
6 changed files with 146 additions and 3 deletions

View File

@@ -18,6 +18,16 @@ found in the LICENSE file. -->
<link rel="manifest" href="/manifest.json">
</head>
<body>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/flutter_service_worker.js');
});
}
</script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>