Greasy Fork

Greasy Fork is available in English.

HLTV - no news on matches page

Removes news sidebar from matches page

当前为 2020-07-23 提交的版本,查看 最新版本

// ==UserScript==
// @name        HLTV - no news on matches page
// @description Removes news sidebar from matches page
// @namespace   https://www.hltv.org
// @match       https://www.hltv.org/matches
// @grant       none
// @version     1.0
// @author      spmn
// ==/UserScript==

let matches = document.getElementsByClassName("newMatches")[0];

if (matches !== undefined) {
  let blank   = matches.getElementsByClassName("vm-placement")[0];
  let content = matches.getElementsByClassName("mainContent")[0];
  let news    = matches.getElementsByClassName("newSidebar")[0];
  
  if (blank !== undefined) {
    blank.remove();
  }

  if (news !== undefined) {
    news.remove();
  }
  
  if (content !== undefined) {
    matches.appendChild(content);
  }
}