// ==UserScript== // @name 咪咕视频增强 // @namespace https://github.com/hzmming/miguvideo-enhance // @version 1.0 // @description 支持弹幕等其它功能 // @author LoryHuang <844155285hzm@gmail.com> // @match https://www.miguvideo.com/p/live/* // @match https://www.miguvideo.com/p/pugcLive/* // @icon https://www.google.com/s2/favicons?sz=64&domain=miguvideo.com // @require https://cdn.jsdelivr.net/npm/danmu.js@1.1.13 // @license WTFPL // @grant none // @downloadURL https://update.greasyfork.icu/scripts/481311/%E5%92%AA%E5%92%95%E8%A7%86%E9%A2%91%E5%A2%9E%E5%BC%BA.user.js // @updateURL https://update.greasyfork.icu/scripts/481311/%E5%92%AA%E5%92%95%E8%A7%86%E9%A2%91%E5%A2%9E%E5%BC%BA.meta.js // ==/UserScript== (function () { 'use strict'; function $(selector) { return document.querySelector(selector); } function createElementFromHTML(htmlString) { const div = document.createElement('div'); div.innerHTML = htmlString.trim(); // Change this to div.childNodes to support multiple top-level nodes. return div.firstChild; } function createStyle(cssString) { const style = document.createElement('style'); style.innerHTML = cssString; return style; } setTimeout(() => { main(); }, 5000); const enhanceCssString = ` .enable-danmu .episode { display: none !important; } .episode { position: absolute; right: 0; height: auto !important; z-index: 1; } .right-box, .right-box .noYellowLineTab{ height: auto !important; width: auto !important; } .right-box { background: rgba(26, 28,44, 0.5) } .right-box .yellow-line-box { display: none !important; } .right-box .tabColumn { display: none !important; } .right-box .chatroom-wrapper { height: 400px !important; padding-top: 14px; } .webPlay { height: 100vh !important; margin-right: 0 !important; } .webPlay .title { display: none !important; } `; const danmuCssString = ` .webPlay .danmu-entrance { float: right; background: url(/mgs/player/prd/v_20231120142225_8ea37cca/dist/assets/p_sprites.png) -84px -208px no-repeat; width: 48px; height: 40px; cursor: pointer; } .webPlay .danmu-entrance.danmu-entrance-off { background-position: -40px -160px; } `; function main() { const controlBox = $('.right-control'); const playcont = $('.playcont'); const playerWrapper = $('.webPlay .play'); // 添加增强全屏入口 const myFullscreen = createElementFromHTML( '