您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Блокирует кнопки "Окно в окне" (PiP) у фоновых видео на AnimeStars в браузере Opera GX
// ==UserScript== // @name AnimeStars — блокировка PiP кнопок Opera GX // @namespace https://animestars.org/ // @version 1.3 // @description Блокирует кнопки "Окно в окне" (PiP) у фоновых видео на AnimeStars в браузере Opera GX // @author Sandr // @match *://animestars.org/* // @match *://asstars.tv/* // @match *://astars.club/* // @match *://as1.astars.club/* // @match *://as1.asstars.tv/* // @match *://as2.asstars.tv/* // @match *://asstars.club/* // @match *://asstars.online/* // @license MIT // @grant none // @run-at document-idle // ==/UserScript== (function () { "use strict"; // Список селекторов кнопок Opera GX const BAD_SELECTORS = ` #detach-button-host, #video-detach-button, #skip-button, #send-by-qrcode-button, #lucid-mode-button, .button-container, .custom-button, .rgx-button-wrapper `; // Добавляем CSS, чтобы скрывать кнопки даже если они появились const style = document.createElement("style"); style.textContent = ` ${BAD_SELECTORS} { display: none !important; opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; } `; document.head.appendChild(style); // Функция для запрета PiP на видео function disablePiP(video) { if (!video) return; if (video.dataset._pip_disabled === "1") return; video.dataset._pip_disabled = "1"; video.setAttribute("disablePictureInPicture", ""); // стандартный способ video.setAttribute("pip", "false"); // кастомный флаг Opera GX } // Применяем сразу ко всем видео document.querySelectorAll("video").forEach(disablePiP); // Следим за новыми видео const videoObserver = new MutationObserver(mutations => { mutations.forEach(m => { m.addedNodes.forEach(node => { if (node instanceof HTMLVideoElement) { disablePiP(node); } if (node.querySelectorAll) { node.querySelectorAll("video").forEach(disablePiP); } }); }); }); videoObserver.observe(document.body, { childList: true, subtree: true }); })();