mubaidr / vite-vue3-browser-extension-v3

Another vite powered web extension (chrome, firefox, etc.) starter template.
481 stars 63 forks source link

Global error handling to avoid extension context issues #54

Closed mubaidr closed 9 months ago

mubaidr commented 9 months ago

This ensures errors are logged, but extension context is not disconnected.

self.onerror = function (message, source, lineno, colno, error) {
  console.info(
    `Error: ${message}\nSource: ${source}\nLine: ${lineno}\nColumn: ${colno}\nError object: ${error}`
  )
}
mubaidr commented 9 months ago

https://github.com/mubaidr/vite-vue3-chrome-extension-v3/commit/b82606ec877eed8cbd9a601d9cc262f85ad3f335