// ==UserScript== // @name 西瓜视频自动自适应网页全屏剧场模式 // @namespace 476321082 // @match https://www.ixigua.com/* // @description This script does something cool. // @license MIT // @grant none // @version 0.1 // @author - // @downloadURL none // ==/UserScript== (function() { 'use strict'; const header = document.querySelector('header'); header.classList.add('hide'); const showHeaderDistance = 10; // distance in pixels from the top of the page const style = document.createElement('style'); style.innerHTML = ` header.hide { visibility: hidden; } .Page_Projection.new-style .xgplayer:not(.xgplayer-is-fullscreen) { max-height: 100vh; } .layoutstatus-header--Normal .v3-app-layout__content { padding-top: 0px; } `; document.head.appendChild(style); window.addEventListener('mousemove', (event) => { if (event.clientY < showHeaderDistance) { header.classList.remove('hide'); } }); header.addEventListener('mouseleave', () => { header.classList.add('hide'); }); window.addEventListener('load', () => { const theaterModeButton = document.querySelector('[tabindex="0"][aria-label="剧场模式"]'); if (theaterModeButton) { theaterModeButton.click(); } }); })();