随笔分类 - PWA
摘要:async function renderMovie(){ const res = await fetch('/api/getMovie') const json = await res.json() let data = json.data.house43 console.log(data); l
阅读全文
摘要:// install 主要就是缓存内容 const CACHE_NAME = 'cahe_v1' const URLS = [ '/', '/index.css', '/images/1.png', '/index.js', '/manifest.json', '/api/66462d0145d35
阅读全文
摘要:/** * 如果页面一进来, 发现用户没有联网,给用户发一个通知 * */ if(Notification.permission 'default'){ Notification.requestPermission() } if(!navigator.onLine){ new Notificatio
阅读全文
摘要:service worker 使用步骤 <script> // 1 在网页加载完成的时候 注册 service worker window.addEventListener('load', () => { // 2 能力检测 if ('serviceWorker' in navigator) { n
阅读全文
摘要:manifest 使用步骤 1 新建一个 manifest.json 文件 2 在 index.html 引入 manifest.json 文件 3 在 manifest.json 文件中提供常见的配置 4 需要在 https 协议或者 http://localhost 下访问项目 <link re
阅读全文

浙公网安备 33010602011771号