fix(extension): harden player discovery for Crunchyroll

This commit is contained in:
KoalaDev
2026-08-21 12:15:44 +02:00
parent 1e41d98c2f
commit 258f66f240
8 changed files with 127 additions and 2 deletions
+8 -1
View File
@@ -659,7 +659,14 @@
|| Number(style.opacity) === 0)) {
return false;
}
if (typeof current.checkVisibility === 'function'
// `display: contents` deliberately gives the wrapper no box, so
// Chromium reports the wrapper itself as not visible even while
// its children are fully rendered. Crunchyroll's player layout
// uses exactly that shape. The explicit CSS checks above still
// reject genuinely hidden ancestors; skip only this boxless
// wrapper case when walking up from the video.
if (style?.display !== 'contents'
&& typeof current.checkVisibility === 'function'
&& !current.checkVisibility({ checkOpacity: true, checkVisibilityCSS: true })) {
return false;
}