mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-29 12:07:09 +00:00
TEMPORARY DIAGNOSTICS: Implement Proposal 2 and 3 logs in Dev tools tab
This commit is contained in:
@@ -62,6 +62,7 @@
|
|||||||
|
|
||||||
// Suppresses native event reporting after a programmatic action.
|
// 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.
|
// While a timer exists, matching native events are consumed and not relayed.
|
||||||
|
|
||||||
@@ -1445,6 +1446,8 @@
|
|||||||
function applyAudioSettings(videoEl, settings) {
|
function applyAudioSettings(videoEl, settings) {
|
||||||
|
|
||||||
const mergedSettings = mergeAudioSettings(settings);
|
const mergedSettings = mergeAudioSettings(settings);
|
||||||
|
|
||||||
|
if (!mergedSettings.enabled || !mergedSettings.compressor?.enabled) {
|
||||||
|
|
||||||
applyAudioBypass(videoEl);
|
applyAudioBypass(videoEl);
|
||||||
|
|
||||||
@@ -1457,6 +1460,8 @@
|
|||||||
const chain = setupAudioChain(videoEl);
|
const chain = setupAudioChain(videoEl);
|
||||||
|
|
||||||
if (!chain) return;
|
if (!chain) return;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const cSettings = mergedSettings.compressor;
|
const cSettings = mergedSettings.compressor;
|
||||||
|
|
||||||
@@ -1674,6 +1679,46 @@
|
|||||||
|
|
||||||
if (video && currentTitle && sameEpisode(currentTitle, expectedTitle)
|
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:
|
// NOTE: Do NOT pause here. Three callers reach this function:
|
||||||
@@ -1689,6 +1734,13 @@
|
|||||||
// 3. CONTENT_BOOT recovery: same reasoning as (2).
|
// 3. CONTENT_BOOT recovery: same reasoning as (2).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Check immediately
|
||||||
|
|
||||||
|
if (checkAndReportLobbyReady(expectedTitle)) return;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Poll every 2 seconds — no log spam, internal only
|
// Poll every 2 seconds — no log spam, internal only
|
||||||
|
|
||||||
lobbyPollTimer = setInterval(() => {
|
lobbyPollTimer = setInterval(() => {
|
||||||
|
|||||||
@@ -700,6 +700,18 @@
|
|||||||
<button id="remoteSeekForward" class="secondary" style="flex:1; font-size:12px;">+30s</button>
|
<button id="remoteSeekForward" class="secondary" style="flex:1; font-size:12px;">+30s</button>
|
||||||
</div>
|
</div>
|
||||||
<button id="remoteSeekFiveMin" class="secondary" style="width:100%; font-size:12px; margin-bottom:15px;">Seek 5:00</button>
|
<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;">
|
<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>
|
Build: <span id="buildIdentifier">__BUILD_TIMESTAMP__</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2296,6 +2296,18 @@ function refreshDebugInfo() {
|
|||||||
const buttons = Array.isArray(quirk.seekButtons) ? quirk.seekButtons.slice(0, 4).join(' | ') : '';
|
const buttons = Array.isArray(quirk.seekButtons) ? quirk.seekButtons.slice(0, 4).join(' | ') : '';
|
||||||
if (buttons) addField(`${label} Buttons`, buttons);
|
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');
|
addSection('Properties');
|
||||||
addField('Seeking', String(state.seeking));
|
addField('Seeking', String(state.seeking));
|
||||||
|
|||||||
Reference in New Issue
Block a user