VirtualContestUpSolver

Remove all elements except the contest title from "Joined Contests" and set the six checkboxes.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         VirtualContestUpSolver
// @namespace    https://kenkoooo.com/atcoder/
// @version      1.0
// @description  Remove all elements except the contest title from "Joined Contests" and set the six checkboxes.
// @author       G4NP0N
// @match        https://kenkoooo.com/atcoder/*
// @grant        none
// ==/UserScript==

var script = document.createElement("script");
script.setAttribute("type","text/javascript");
script.innerText='function RemoveHead(thead) {    console.log("thead remove");    thead.remove();}function ReWrite(table) {    contests = table.children;    for (var i = 0; i < contests.length; i++) {        for (var j = 0; j < 5; j++) {            contests[i].children[1].remove();        }        var contestid = contests[i].getElementsByTagName("a")[0].getAttribute("href");        for (var j = 1; j <= 6; j++) {            td = document.createElement("td");            html = "<input> " + String(j);            td.innerHTML = html;            problemid = contestid + "_" + String(j);            var cb = td.children[0];            cb.setAttribute("type", "checkbox");            cb.setAttribute("id", problemid);            cb.setAttribute("onchange", "Check(this.id)");            if (!localStorage.getItem(problemid)) {                localStorage.setItem(problemid, "false");            } else {                if (localStorage.getItem(problemid) === "true") {                    cb.setAttribute("checked", "checked");                    td.setAttribute("style", "background-color:#c3e6cb");                }            }            contests[i].appendChild(td);        }    }    contests[0].getElementsByTagName("td")[0].setAttribute("style", "width:50%;");    contests[0].setAttribute("class", "rewrited");    console.log("rewrited!");}function Check(id) {    var parent = document.getElementById(id).parentElement;    if (localStorage.getItem(id) === "true") {        localStorage.setItem(id, "false");        parent.setAttribute("style", "background-color:" + window.getComputedStyle(parent.children[0]).backgroundColor);    } else {        localStorage.setItem(id, "true");        parent.setAttribute("style", "background-color:#c3e6cb");    }}var observer = new MutationObserver(function (mutations) {    if (location.href === "https://kenkoooo.com/atcoder/#/login/user/contests") {        console.log("rewrite check");        theads = document.getElementsByTagName("thead");        if (theads.length > 1) {            RemoveHead(theads[1]);        }        if (document.getElementsByTagName("tbody").length < 2) return;        var table = document.getElementsByTagName("tbody")[1];        if (table.children[0].childElementCount == 1) {            return;        }        if (table.children[0].getAttribute("class") === "rewrited") return;        ReWrite(table);    }});observer.observe(document, { childList: true, subtree: true });';
document.getElementsByTagName("body")[0].appendChild(script);