Add to progressive enhancement section (#23741)
* Update index.md Added additional information on progressive enhancement as it relates to Service Workers * Update index.mdpull/34940/head
parent
430408aad9
commit
a1349084ba
|
@ -44,6 +44,16 @@ A great analogy from [Aaron Gustafson](http://alistapart.com/article/understandi
|
|||
|
||||
This implies that depending on the browser, the experience can change.
|
||||
|
||||
Service Workers are progressive enhancement friendly, meaning that if a user's browser does not support Service
|
||||
Workers, they will still be able to utilize the site, they just will not benefit from the additional functionality that PWAs offer. This can be acheived by wrapping the Service Worker code in a simple conditional statement that checks for Service Worker support within the browser.
|
||||
|
||||
[Example](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/serviceWorker)
|
||||
```
|
||||
if ('serviceWorker' in navigator) {
|
||||
// Supported!
|
||||
}
|
||||
```
|
||||
|
||||
### Demo
|
||||
|
||||
[![Demo on Progressive Web App](http://img.youtube.com/vi/esfi7ZLibmk/0.jpg)](https://www.youtube.com/watch?v=esfi7ZLibmk "Demo on Progressive Web App")
|
||||
|
|
Loading…
Reference in New Issue