Crunchyroll Picture-in-Picture (page + iframe)

cyberaguiar
2025-09-26T08:55:55Z

Enables PiP on Crunchyroll player by fixing iframe and video element restrictions.

📖 Description

This userscript enables Picture-in-Picture (PiP) mode for Crunchyroll’s HTML5 player. By default, Crunchyroll blocks PiP by:

Wrapping the video element inside a restricted iframe.

Applying the attribute disablepictureinpicture to the video element.

This script solves both issues:

On the main Crunchyroll page, it updates the iframe’s allow attribute to include picture-in-picture.

Inside the iframe player, it automatically removes (and prevents re-adding) the disablepictureinpicture attribute from the video element.

As a result, you can use the standard PiP feature (or shortcut) to pop the video out while browsing.

🛠️ Features

Works on Crunchyroll main site and its embedded player iframe (static.crunchyroll.com/vilos).

Automatically patches the iframe permissions.

Continuously watches for player reloads or replaced elements.

Removes disablepictureinpicture as soon as it appears.

Optional shortcut: Ctrl + Alt + P forces PiP mode immediately.

📋 Installation

Install a userscript manager such as Tampermonkey (Chrome/Edge/Opera) or Violentmonkey (Firefox).

Click “Install” on this script page.

Ensure that the script is enabled and is set to run in all frames (iframes included).

Visit https://www.crunchyroll.com and play any video.

🎮 Usage

Simply start playback. The script will silently enable PiP support.

Right-click on the video and choose “Picture in Picture” (or use your browser’s toolbar shortcut).

Or press Ctrl + Alt + P to enter PiP instantly.