refactor: audit fixes — clean up bugs, dead code, and type mismatches
CI / test (pull_request) Successful in 23s

- viewer.js: remove undefined state.segmentsBuffered assignment in BUFFER_RESET
- viewer.js: add missing 'switching' and 'ended' phases to PHASE_ICONS
- index.js: remove redundant Strategy B3 (duplicated B1 video-element walk)
- index.js: filter standard <video> DOM attributes from custom-property scans
  (m3u8DeepProbeFn B1 and scrapeFn Priority 3) to avoid iterating built-in
  properties that can never contain HLS data
- background.js: remove unconditional return true (handlers are synchronous)
  and remove dead error-response for unknown message types
- types.ts: align MediaType union ('direct' | 'hls') with actual runtime
  value used in code ('video' | 'hls')
- package.json: remove hls.js from dependencies (loaded from CDN at runtime,
  never imported as an npm module)
This commit is contained in:
robot committed 2026-08-13 04:59:59 +00:00
1 parent ae8608148d
commit 8e9f7f96f1
5 files changed
+36 -31

No files matched your search

+2 -1
View File
@@ -170,7 +170,9 @@ const PHASE_ICONS = {
loading: '\u2B07', // down arrow
buffering: '\u27F7', // spinning
playing: '\u25B6', // play
switching: '\u21BB', // right arrow corner
error: '\u2717', // X
ended: '\u23F9', // stop
};
/**
@@ -413,7 +415,6 @@ function wireHlsEvents(hls, video, panel) {
state.lastActivity = Date.now();
state.bufferedAhead = 0;
state.segmentsLoaded = 0;
state.segmentsBuffered = 0;
renderPanelState(video, panel);
});