西瓜视频自动自适应网页全屏剧场模式

This script does something cool.

目前为 2023-06-09 提交的版本。查看 最新版本

// ==UserScript==
// @name        西瓜视频自动自适应网页全屏剧场模式
// @namespace   476321082
// @match       https://www.ixigua.com/*
// @description  This script does something cool.
// @license      MIT
// @grant       none
// @version     0.1
// @author      -
// ==/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();
    }
  });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址