rename log prefixes: '[goon' -> '[vidplex' in runtime logs
CI / test (pull_request) Successful in 5m34s

This commit is contained in:
robot committed 2026-08-31 01:55:27 +00:00
1 parent 64d792632d
commit c826669c7d
4 files changed
+56 -56

No files matched your search

+23 -23
View File
@@ -149,7 +149,7 @@ const panelsEl = document.getElementById('panels');
// caused "Cannot create property 'levelDetails' on number".
const fireSuccess = (data) => {
if (!onSuccess) {
console.warn('[goon-viewer] no onSuccess callback for', (url || '').substring(0, 100));
console.warn('[vidplex-viewer] no onSuccess callback for', (url || '').substring(0, 100));
return;
}
const tLoad = Date.now();
@@ -161,11 +161,11 @@ const panelsEl = document.getElementById('panels');
const fireError = (code, text) => {
if (!onError) {
console.error('[goon-viewer] no onError callback; error:', text || code, (url || '').substring(0, 100));
console.error('[vidplex-viewer] no onError callback; error:', text || code, (url || '').substring(0, 100));
return;
}
stats.loading.end = Date.now();
console.warn('[goon-viewer] HlsLoader error:', code, text, (url || '').substring(0, 100));
console.warn('[vidplex-viewer] HlsLoader error:', code, text, (url || '').substring(0, 100));
onError({ code: code || 0, text: text || '', url, headers: {}, data: null }, stats, context, null);
};
@@ -177,7 +177,7 @@ const panelsEl = document.getElementById('panels');
if (needProxy) {
// Route through the service worker to bypass the CDN's CORS/Referer
// restrictions. The SW adds the required Referer and returns base64.
console.log('[goon-viewer] Proxying via SW:', (url || '').substring(0, 120));
console.log('[vidplex-viewer] Proxying via SW:', (url || '').substring(0, 120));
chrome.runtime.sendMessage({ type: 'GOON_PROXY_FETCH', url, referer: refererForUrl(url) }, (resp) => {
if (self._aborted) return;
const lastErr = chrome.runtime.lastError;
@@ -253,7 +253,7 @@ HlsLoader.canSupportLoader = function () { return true; };
}
return null;
} catch(e) {
console.warn('[goon-viewer] proxyFetch failed for:', url.substring(0, 120), e && e.message ? e.message : e);
console.warn('[vidplex-viewer] proxyFetch failed for:', url.substring(0, 120), e && e.message ? e.message : e);
return null;
}
}
@@ -744,14 +744,14 @@ function wireHlsEvents(hls, video, panel) {
state.fpsDropCount++;
state.lastEvent = 'FPS_DROP';
state.lastActivity = Date.now();
console.warn(`[goon-viewer] FPS drop: current=${data.currentFPS}, threshold=${data.thresholdFPS}`);
console.warn(`[vidplex-viewer] FPS drop: current=${data.currentFPS}, threshold=${data.thresholdFPS}`);
renderPanelState(video, panel);
});
hls.on(HlsEvents.FPS_MAX_LEVEL_DROP, (_ev, data) => {
state.lastEvent = 'FPS_MAX_LEVEL_DROP';
state.lastActivity = Date.now();
console.warn(`[goon-viewer] Max level dropped due to FPS: ${data.currentLevel}`);
console.warn(`[vidplex-viewer] Max level dropped due to FPS: ${data.currentLevel}`);
renderPanelState(video, panel);
});
@@ -798,7 +798,7 @@ function wireHlsEvents(hls, video, panel) {
// tab with no live source doesn't loop forever.
if ((video.dataset.hlsRescans || '0') | 0 < 3) {
video.dataset.hlsRescans = ((video.dataset.hlsRescans || '0') | 0) + 1;
console.log('[goon-viewer] fatal NETWORK_ERROR → auto-rescan attempt #' + video.dataset.hlsRescans);
console.log('[vidplex-viewer] fatal NETWORK_ERROR → auto-rescan attempt #' + video.dataset.hlsRescans);
showError(panel, 'Refreshing stream…');
rescanAndRetry(video, panel, video.dataset.hlsManifest || '');
} else {
@@ -976,7 +976,7 @@ function playHls(video, manifestUrl, panel) {
// without CORS headers blocks extension-origin requests from the viewer page).
const needProxy = needsProxy(manifestUrl);
if (needProxy) {
console.log('[goon-viewer] Manifest needs proxying via service worker');
console.log('[vidplex-viewer] Manifest needs proxying via service worker');
}
destroyHls(video);
@@ -1017,7 +1017,7 @@ function playHls(video, manifestUrl, panel) {
};
// Log the manifest URL being loaded for debugging (helps diagnose playback failures).
console.log(`[goon-viewer] Loading HLS manifest:`, manifestUrl.substring(0, 200));
console.log(`[vidplex-viewer] Loading HLS manifest:`, manifestUrl.substring(0, 200));
// Remember the manifest actually loaded so a later auto-rescan can retry from
// the freshest token on the same video (the service worker keys off the path).
@@ -1039,14 +1039,14 @@ function loadHlsJs() {
}
const hldsSrc = chrome.runtime.getURL('hlds.js');
console.log('[goon-viewer] Trying script src:', hldsSrc);
console.log('[vidplex-viewer] Trying script src:', hldsSrc);
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.src = hldsSrc;
script.onload = () => {
if (window.Hls && typeof window.Hls.isSupported === 'function') {
console.log('[goon-viewer] hlds.js via script src OK, Hls.isSupported:', window.Hls.isSupported());
console.log('[vidplex-viewer] hlds.js via script src OK, Hls.isSupported:', window.Hls.isSupported());
resolve();
} else {
reject(new Error('hlds.js loaded but did not register global Hls'));
@@ -1076,12 +1076,12 @@ function loadHlsJs() {
try {
const resp = await chrome.runtime.sendMessage({ type: 'GOON_RESOLVE_MANIFEST', url: storedUrl });
if (resp && resp.ok && resp.changed && resp.fresh) {
console.log('[goon-viewer] resolved fresh manifest for', (resp.groupKey || '?'),
console.log('[vidplex-viewer] resolved fresh manifest for', (resp.groupKey || '?'),
'→', (resp.fresh || '').substring(0, 100));
return resp.fresh;
}
} catch (e) {
console.warn('[goon-viewer] resolveFreshManifest failed:', e && e.message ? e.message : e);
console.warn('[vidplex-viewer] resolveFreshManifest failed:', e && e.message ? e.message : e);
}
return null;
}
@@ -1097,11 +1097,11 @@ function loadHlsJs() {
const fresh = await resolveFreshManifest(originalUrl);
if (!fresh) {
showError(panel, 'Stream expired & no live source — reload the source tab, then re-open viewer.');
console.warn('[goon-viewer] rescan gave up: no fresh manifest for', (originalUrl || '').substring(0, 100));
console.warn('[vidplex-viewer] rescan gave up: no fresh manifest for', (originalUrl || '').substring(0, 100));
return false;
}
if (panel) removeErrorOverlay(panel);
console.log('[goon-viewer] retrying with fresh manifest:', fresh.substring(0, 120));
console.log('[vidplex-viewer] retrying with fresh manifest:', fresh.substring(0, 120));
playHls(video, fresh, panel);
return true;
}
@@ -1147,7 +1147,7 @@ function createPanel(entry, tag) {
}
// mediaType says HLS but we have no manifest URL — fall through to native playback.
// On Safari this may still work for .m3u8; on Chrome it will fail.
console.warn('[goon-viewer] HLS entry missing manifest URL, src:', src);
console.warn('[vidplex-viewer] HLS entry missing manifest URL, src:', src);
}
video.src = src;
@@ -1182,13 +1182,13 @@ async function init() {
document.body.insertBefore(overlay, document.body.firstChild);
// === DIAGNOSTIC: Check storage + CORS ===
console.log('[goon-viewer] Viewer ID:', id, 'Grid:', gridN + 'x' + gridN);
console.log('[goon-viewer] Raw stored data:', JSON.stringify(videoUrls));
console.log('[vidplex-viewer] Viewer ID:', id, 'Grid:', gridN + 'x' + gridN);
console.log('[vidplex-viewer] Raw stored data:', JSON.stringify(videoUrls));
if (videoUrls.length > 0) {
for (const entry of videoUrls) {
const src = (entry.src || '').substring(0, 120);
console.log('[goon-viewer] Entry:', {
console.log('[vidplex-viewer] Entry:', {
src: src,
mediaType: entry.mediaType,
hlsManifest: (entry.hlsManifest || '').substring(0, 120),
@@ -1213,7 +1213,7 @@ async function init() {
for (const url of [...new Set(urlsToTest)]) {
const corsOk = await corsCheck(url);
if (!corsOk) blockedHosts.add(registrableDomainOf(hostOfUrl(url)));
console.log('[goon-viewer] CORS', corsOk ? 'OK' : 'BLOCKED:', url.substring(0, 120));
console.log('[vidplex-viewer] CORS', corsOk ? 'OK' : 'BLOCKED:', url.substring(0, 120));
}
if (blockedHosts.size > 0) {
for (const h of blockedHosts) if (h) proxyHosts.add(h);
@@ -1222,9 +1222,9 @@ async function init() {
// Report whether any URL needs proxying (referer-protected host).
const anyNeedsProxy = urlsNeedProxy(urlsToTest);
console.log('[goon-viewer] Proxy required:', anyNeedsProxy);
console.log('[vidplex-viewer] Proxy required:', anyNeedsProxy);
} else {
console.warn('[goon-viewer] No video entries in storage for ID:', id, '— data may have been cleared or never saved');
console.warn('[vidplex-viewer] No video entries in storage for ID:', id, '— data may have been cleared or never saved');
}
overlay.textContent = `Found ${videoUrls.length} video URL(s) in ${gridN}x${gridN} grid`;