[PWA] Check Online Status by using the NavigatorOnLine API
2021-03-31 17:25
标签:could status https ble orm nali use mes color Even if you have your application fully cached, you couldn’t perform any external request without internet connection. That’s why in order to build an offline-capable application, you must know when it’s actually offline. This lesson shows you how to use the NavigatorOnLine API and online/offline events in order to disable the functionality to send messages of the application. [PWA] Check Online Status by using the NavigatorOnLine API 标签:could status https ble orm nali use mes color 原文地址:https://www.cnblogs.com/Answer1215/p/9255725.html this.online = navigator.onLine
window.addEventListener(‘online‘, () => (this.online = true))
window.addEventListener(‘offline‘, () => {
this.online = false
})
文章标题:[PWA] Check Online Status by using the NavigatorOnLine API
文章链接:http://soscw.com/index.php/essay/70545.html