TEMPORARY DIAGNOSTICS: Implement Proposal 2 and 3 logs in Dev tools tab

This commit is contained in:
Timo
2026-07-02 13:35:08 +02:00
parent 32994aaaa5
commit 09d35f3e48
3 changed files with 78 additions and 2 deletions
+54 -2
View File
@@ -62,6 +62,7 @@
// Suppresses native event reporting after a programmatic action.
// Each entry is a per-type timer (key = 'playing'|'paused'|'seek').
// While a timer exists, matching native events are consumed and not relayed.
@@ -1445,6 +1446,8 @@
function applyAudioSettings(videoEl, settings) {
const mergedSettings = mergeAudioSettings(settings);
if (!mergedSettings.enabled || !mergedSettings.compressor?.enabled) {
applyAudioBypass(videoEl);
@@ -1456,7 +1459,9 @@
const chain = setupAudioChain(videoEl);
const chain = setupAudioChain(videoEl);
if (!chain) return;
const cSettings = mergedSettings.compressor;
@@ -1674,6 +1679,46 @@
if (video && currentTitle && sameEpisode(currentTitle, expectedTitle)
&& video.currentTime < 5 && video.readyState >= 1) {
// Match! Pause at start and report ready.
if (!video.paused) {
_setSuppress('paused');
video.pause();
}
stopLobbyPoll();
chrome.runtime.sendMessage({
type: 'EPISODE_READY_LOCAL',
payload: { title: currentTitle }
}).catch(() => {});
reportLog(`Episode lobby: Ready for "${currentTitle}"`, 'success');
return true;
}
return false;
}
function startLobbyPoll(expectedTitle) {
stopLobbyPoll();
_pendingLobbyTitle = expectedTitle;
// NOTE: Do NOT pause here. Three callers reach this function:
@@ -1688,7 +1733,14 @@
// 3. CONTENT_BOOT recovery: same reasoning as (2).
}
// Check immediately
if (checkAndReportLobbyReady(expectedTitle)) return;
// Poll every 2 seconds — no log spam, internal only
lobbyPollTimer = setInterval(() => {
+12
View File
@@ -700,6 +700,18 @@
<button id="remoteSeekForward" class="secondary" style="flex:1; font-size:12px;">+30s</button>
</div>
<button id="remoteSeekFiveMin" class="secondary" style="width:100%; font-size:12px; margin-bottom:15px;">Seek 5:00</button>
<div style="margin-top: 15px;">
<label style="font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px;">DOM Timestamps (Scraped)</label>
<div class="info-card" id="devtoolsDomScraperList" style="font-size:10px; max-height:100px; overflow-y:auto; font-family:monospace; line-height:1.2; padding:6px; background:rgba(0,0,0,0.2); white-space:pre-wrap; border: 1px solid #334155;">
No timestamps scraped.
</div>
</div>
<div style="margin-top: 15px; margin-bottom:15px;">
<label style="font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px;">Video Event Log</label>
<div class="info-card" id="devtoolsVideoEventLogList" style="font-size:10px; max-height:150px; overflow-y:auto; font-family:monospace; line-height:1.2; padding:6px; background:rgba(0,0,0,0.2); white-space:pre-wrap; border: 1px solid #334155;">
No events logged.
</div>
</div>
<div style="font-size:10px; color:var(--text-muted); text-align:center; margin-top:10px; opacity:0.7;">
Build: <span id="buildIdentifier">__BUILD_TIMESTAMP__</span>
</div>
+12
View File
@@ -2296,6 +2296,18 @@ function refreshDebugInfo() {
const buttons = Array.isArray(quirk.seekButtons) ? quirk.seekButtons.slice(0, 4).join(' | ') : '';
if (buttons) addField(`${label} Buttons`, buttons);
}
const domScraperEl = document.getElementById('devtoolsDomScraperList');
const eventLogEl = document.getElementById('devtoolsVideoEventLogList');
if (domScraperEl && state.scrapedTimestamps) {
domScraperEl.textContent = state.scrapedTimestamps.length > 0
? state.scrapedTimestamps.join('\n')
: 'No timestamps scraped.';
}
if (eventLogEl && state.videoEventsLog) {
eventLogEl.textContent = state.videoEventsLog.length > 0
? state.videoEventsLog.join('\n')
: 'No events logged.';
}
addSection('Properties');
addField('Seeking', String(state.seeking));