PureLive

移除直播网站广告

当前为 2018-01-15 提交的版本,查看 最新版本

// ==UserScript==
// @name PureLive
// @version 0.0.1
// @description:zh-cn 移除直播网站广告
// @namespace Violentmonkey Scripts
// @include https://www.zhanqi.tv/*   
// @grant none
// @description 移除直播网站广告
// ==/UserScript==

/**
 * WARNING
 * 本脚本仅支持 Violentmonkey Scripts
 */
$(document).ready(() => {
  const zhanqi = () => {
    $('.live-chat-content').remove(); // 聊天窗口
    $('.live-side-content').remove(); // 左侧边栏
    $('.want-headlines-btn').remove(); // 上头条
    $('.js-room-fun-area').remove(); // 礼物区域
    $('.sdk-zhanqiMall').remove(); // 商城按钮
    $('.anchor-info-area').remove(); // 主播信息
    let styleTag = $('<style>\
    .no-play-down-ibox {display: none !important;} /* 客户端下载广告 */\
    #js-flash-layer {width: 100vw !important; height: 100vh !important;} /* 拉伸播放器 */\
    .live-room-content {padding: 0 !important;} /* 砍掉主容器左内间距 */\
    .sdk-zhanqiMall {display: none !important;} /* 商城按钮 */\
    .room-rank-ibox,.ranking-btn {display: none !important;} /* 排名展示和排名按钮 */\
    </style>')
    $('html > head').append(styleTag);
    $(window).trigger('resize');
  }
  
  switch(location.host){
    case 'www.zhanqi.tv':
    case 'zhanqi.tv':
      zhanqi(); break;
  }
});