mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-24 01:39:01 +00:00
096775d39f
Reproduced against the live yummyanime.tv layout, which is: top (no video) ├── visible same-origin wrapper 830x498 -> cross-origin player ├── hidden same-origin wrapper 0x0 -> cross-origin mirror └── hidden cross-origin trailer 0x0 Three things kept that page from ever settling on a target. Equally-ranked players were a hard failure. Several mirrors or dubs loaded at once is an ordinary layout for these sites, and refusing to activate made them unusable. The resolver now holds the top frame and waits for one of them to start playing, which is the signal that breaks the tie. Inconclusive probes moved the target. A page whose players are still loading resolves differently from one call to the next, and every difference triggered a full teardown and reinjection, so activation never finished — the popup sat on "activating" with nothing in the log. A probe that finds no video now leaves the target where it is. The visibility handshake expired mid-probe. Its listener lived 1000ms while the probe sequence is six separate executeScript round trips; on a heavy page it was gone before the answer arrived, leaving every frame's visibility unknown — the exact state that makes two players look equal. It now outlives the sequence. A settled failure also no longer reports itself as "activating". Covered by two fixtures built from the real page: one where the player exists up front, and one where the host only creates it on play, asserting the target is promoted into the deep cross-origin frame without touching the popup again. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
30 lines
1.2 KiB
HTML
30 lines
1.2 KiB
HTML
<!doctype html>
|
|
<meta charset="utf-8">
|
|
<title>Anime-style player built on demand</title>
|
|
<style>
|
|
body { margin: 0; font: 14px sans-serif; }
|
|
#info { height: 900px; padding: 24px; }
|
|
iframe { border: 0; }
|
|
#visible-wrapper { display: block; }
|
|
#hidden-wrapper { width: 0; height: 0; display: block; }
|
|
</style>
|
|
<!--
|
|
Same layout as yummy-style-player.html, except the visible player builds its
|
|
<video> only when the viewer presses play. Until then the tab has no video at
|
|
all, which is the state the extension is in when the user picks the tab.
|
|
-->
|
|
<div id="info">
|
|
<h1>Series page</h1>
|
|
<p>Description block that pushes the player below the fold.</p>
|
|
</div>
|
|
<iframe id="visible-wrapper" name="xfplayer_visible" width="830" height="498"
|
|
src="frames/xfp-wrapper.html?player=deferred-player-frame.html" allowfullscreen></iframe>
|
|
<iframe id="hidden-wrapper" name="xfplayer_hidden"
|
|
src="frames/xfp-wrapper.html?player=player-frame-2.html" allowfullscreen></iframe>
|
|
<script>
|
|
const frames = [...document.querySelectorAll('iframe')];
|
|
Promise.all(frames.map(f => new Promise(resolve => {
|
|
f.addEventListener('load', resolve, { once: true });
|
|
}))).then(() => { window.__fixtureReady = true; });
|
|
</script>
|