sample erase

サンプルを消します

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         sample erase
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  サンプルを消します
// @author       imomo
// @match        https://atcoder.jp/contests/*/tasks/*
// @grant        none
// ==/UserScript==

 window.onload = function(){
     var elements = document.getElementsByClassName("lang-ja")[0];
     for(var i = elements.children.length - 1;0<=i;i--){
         if(elements.children[i].className === "io-style")break;
         else elements.removeChild(elements.children[i]);
     }
     elements.appendChild(document.createElement("hr"));
     var alertText = document.createElement("h3");
     alertText.innerHTML="<span style='color: red;'>スクリプトでサンプルを非表示にしています。<br>バチャ終了後このスクリプトをオフにしてください</span>";
     elements.appendChild(alertText);
 }