hxty.live - remove player footer and chat panel

Remove player footer and chat panel

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        hxty.live - remove player footer and chat panel
// @namespace   Violentmonkey Scripts
// @match       *://*.hxty.live/live/*
// @match       *://*.360pai.xyz/live/*
// @match       *://*.idevkit.com/live/*
// @grant       none
// @version     0.0.1
// @author      Bin
// @description Remove player footer and chat panel
// @license     GNU AGPLv3
// ==/UserScript==

/* jshint esversion: 6 */

window.addEventListener("load", () => {
  document.querySelector('[class^="player-footer_live-player-footer"]').remove();
  document.querySelector('[class^="anchor-detail-page_chat-panel"]').remove();

  const playerContainer = document.querySelector('[class^="anchor-detail-page_anchor-live-container"]');

  var observer = new MutationObserver((mutations) => {
    mutations.forEach((mutation) => {
      const target = mutation.target;
      if (mutation.type === "attributes" && /anchor-detail-page_theater-mode/.test(target.className)) {
        target.style.bottom = 0
      }
    });
  });

  observer.observe(playerContainer, {
    attributes: true //configure it to listen to attribute changes
  });
});