/page-crash-monitor

WIP

Primary LanguageJavaScriptMIT LicenseMIT

Page Crash Monitor

A tool to Monitor Page Crashes.

崩溃复现: chrome://crash

方案设计: WebWorker -> ServiceWorker

前置要求:https -> http

前端服务: vite

模拟后端服务: koa

数据结构设计

心跳数据:

{
  type: 'hearbeat',
  id: uuid,
  data: {
    url: 'xxx',
    openDate: '',
  },
}

sw pages:

{
  id: {
    lastReportDate: '',
    data: {
      url: 'http://localhost:5173/',
      openDate: '',
    },
  },
}

问题

  • 强制刷新丢失 controller 问题

  • 更新 Service Worker

参考

使用 Service Worker

Can you use a service worker with a self-signed certificate?

Options for testing service workers via HTTP

更新 Service Worker

强制刷新 controller 不存在

navigator.serviceWorker.controller is null until page refresh

Service Worker 是什么

强制刷新 navigator.serviceWorker.controller 消失

Beforeunload 打点丢失原因分析及解决方案

web worker