Skip to content

fix(Crunchyroll): restore iframe playback detection#10650

Open
CreepsoOff wants to merge 5 commits intoPreMiD:mainfrom
CreepsoOff:fix/crunchyroll-iframe
Open

fix(Crunchyroll): restore iframe playback detection#10650
CreepsoOff wants to merge 5 commits intoPreMiD:mainfrom
CreepsoOff:fix/crunchyroll-iframe

Conversation

@CreepsoOff
Copy link
Copy Markdown

Description

Crunchyroll uses two different video player implementations. PR #10587 removed iframe support in favor of direct
<video> element detection, but this caused the presence to remain stuck on "Browsing..." on /watch/ pages for
users with the iframe-based player (https://static.crunchyroll.com/vilos-v2/web/vilos/player.html).

This PR re-introduces iframe support to ensure compatibility with both player types:

  1. Direct video player: Checks for <video> in #player-container or document root
  2. Iframe player (vilos): Receives playback data from iframe via iFrameData event

Changes

  • metadata.json: Re-enable iframe injection with "iframe": true and "iFrameRegExp": "static.crunchyroll.com"
  • iframe.ts (new): Polls for <video> element inside the player iframe and sends playback data via
    iframe.send()
  • presence.ts: Add iFrameData event handler + dual playback detection (direct video with iframe fallback)

All existing features (privacy mode, hideWhenPaused, timestamps, buttons, browsing pages) remain unchanged.

Acknowledgements

Screenshots

Proof showing the creation/modification is working as expected image image image image

@@ -0,0 +1,19 @@
const iframe = new iFrame()

setInterval(() => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use iframe UpdateData event

Comment thread websites/C/Crunchyroll/metadata.json Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants