mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-31 04:58:09 +00:00
fix: harden frame observation and unblock supported Drive tabs
Audit follow-ups on the same-origin frame walk: - prune detached frames from the load-hook set so ad/SPA frame churn no longer grows it for the page's lifetime - hook load on nested frames, not just top-level ones - re-observe from scratch after a frame reload instead of leaving the replaced document's tree registered - reset the frame registry when the heartbeat error path disconnects Also: a broad parent domain in the blacklist no longer hides a host with its own supported player path (drive.google.com behind google.com), while an exact user entry for that host still filters it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+21
-6
@@ -1697,23 +1697,37 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// --- Helper: Wait until video is ready for playback (buffered & seeked) ---
|
||||
|
||||
function pollSeekReady(targetTime, timeoutMs = 8000) {
|
||||
return new Promise((resolve) => {
|
||||
const interval = 150;
|
||||
const interval = 150;
|
||||
let elapsed = 0;
|
||||
const timer = setInterval(() => {
|
||||
if (destroyed) {
|
||||
let elapsed = 0;
|
||||
const timer = setInterval(() => {
|
||||
if (destroyed) {
|
||||
clearInterval(timer);
|
||||
seekPollTimers.delete(timer);
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
const video = findVideo(); // Re-query DOM on every iteration
|
||||
if (!video) {
|
||||
clearInterval(timer);
|
||||
seekPollTimers.delete(timer);
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const video = findVideo(); // Re-query DOM on every iteration
|
||||
elapsed += interval;
|
||||
|
||||
const current = getSyncCurrentTime(video);
|
||||
const timeDiff = current !== null ? Math.abs(current - targetTime) : Infinity;
|
||||
const ready = video.readyState >= 3 && timeDiff < 2.0;
|
||||
if (ready) {
|
||||
clearInterval(timer);
|
||||
seekPollTimers.delete(timer);
|
||||
resolve(true);
|
||||
@@ -1764,6 +1778,7 @@
|
||||
|
||||
|
||||
if (message.action === 'RESET_AUDIO_PROCESSING') {
|
||||
|
||||
_audioProcessingAllowed = false;
|
||||
|
||||
bypassCurrentAudioProcessing();
|
||||
|
||||
Reference in New Issue
Block a user