您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
为B站直播添加全局画中画播放
当前为
// ==UserScript== // @name B站直播全局画中画 // @namespace None // @version 1.0 // @description 为B站直播添加全局画中画播放 // @author IceCat // @match https://live.bilibili.com/* // @run-at document-end // @grant none // ==/UserScript== $(window).load(()=>{ addButton(); $("div.bilibili-live-player-video > video")[0].addEventListener('enterpictureinpicture', function(pipWindow) { $('#PiP')[0].innerText="关闭画中画" }) $("div.bilibili-live-player-video > video")[0].addEventListener('leavepictureinpicture', function() { $('#PiP')[0].innerText="开启画中画" }) }) function switchpip() { if($(document)[0].pictureInPictureElement == null){ $("div.bilibili-live-player-video > video")[0].requestPictureInPicture(); }else{ document.exitPictureInPicture(); } } function addButton() { var pdiv = $("div.supporting-info > div.seeds-wrap > div.live-skin-coloration-area")[0]; pdiv.innerHTML="<div class='item seeds pointer' data-v-19679bde><span id='PiP' herf='javascript:void(0)'>开启画中画</span></div>"+pdiv.innerHTML; $('#PiP').click(switchpip); } (function() { 'use strict'; if (!window.jQuery){ var newScript = document.createElement('script'); newScript.type = "text/javascript"; newScript.src="//libs.baidu.com/jquery/2.0.0/jquery.min.js"; document.head.appendChild(newScript); } })();