🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

YouTube Cast Button - Apple AirPlay Style

Change the YouTube Cast button to resemble the Apple AirPlay icon on all YouTube pages

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         YouTube Cast Button - Apple AirPlay Style
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Change the YouTube Cast button to resemble the Apple AirPlay icon on all YouTube pages
// @author       GPT
// @match        https://www.youtube.com/*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // CSS to replace the Cast icon with an AirPlay-style icon
    GM_addStyle(`
        /* Target the YouTube Cast button */
        .ytp-chrome-controls .ytp-button[data-tooltip-target-id="ytp-id-18"] svg {
            visibility: hidden; /* Hide the default Cast icon */
        }

        /* Insert custom AirPlay icon using :after pseudo-element */
        .ytp-chrome-controls .ytp-button[data-tooltip-target-id="ytp-id-18"]::after {
            content: '';
            display: inline-block;
            width: 16px;
            height: 16px;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 3C7.03 3 3 7.03 3 12h2c0-3.87 3.13-7 7-7s7 3.13 7 7h2c0-4.97-4.03-9-9-9zm1 14h-2v-5h2v5zm1.59-8.58-2.12 2.12c-.36.36-.94.36-1.3 0L9.41 8.42c-.36-.36-.36-.94 0-1.3.36-.36.94-.36 1.3 0l1.29 1.3 1.3-1.3c.36-.36.94-.36 1.3 0 .36.36.36.94 0 1.3z"/></svg>');
            background-size: cover;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
    `);

    console.log("Custom YouTube Cast button styling applied: AirPlay-style icon.");
})();