test(hls): [PKG-HLS-SDK-01] checkpoint unresolved Firefox diagnostics

This commit is contained in:
Harvey Zhao committed 2026-09-12 01:42:47 +08:00
1 parent 2f9bee4ee0
commit 26b2983daf
18 files changed
+17776 -8

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
// Browser-only diagnostic observer; messages and termination still use native workers.
export function observeWorkers() {
const NativeWorker = window.Worker
window.workerEvidence = []
window.Worker = class extends NativeWorker {
constructor(url, options) {
super(url, options)
const record = { url: String(url), messages: [], errors: [], terminated: 0 }
window.workerEvidence.push(record)
this.addEventListener('message', event => record.messages.push(event.data?.event))
this.addEventListener('error', event => record.errors.push(event.message))
const terminate = this.terminate.bind(this)
this.terminate = () => {
record.terminated++
return terminate()
}
}
}
}