AtCoder Default Search Fields

すべての提出検索にデフォルトの値を設定します

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name    AtCoder Default Search Fields
// @namespace    http://tampermonkey.net/
// @version    0.2
// @description    すべての提出検索にデフォルトの値を設定します
// @author    Chippppp
// @license    MIT
// @match    https://atcoder.jp/contests/*
// @grant    none
// ==/UserScript==

(function() {
    "use strict";

    let path = location.pathname.split("/");
    let ul = document.getElementsByClassName("dropdown-menu")[2];
    if (ul == undefined) return;
    let problem = "";
    let idx = path.indexOf("tasks");
    if (idx != -1 && idx + 1 < path.length) {
        problem = path[idx + 1];
    }
    if (!ul.children[0].children[0].href.endsWith("me")) ul.children[0].children[0].href += `?f.Task=${problem}&f.LanguageName=&f.Status=AC&f.User=`;
    ul = document.getElementsByClassName("nav nav-pills small")[0];
    if (ul == undefined) return;
    if (!ul.children[0].children[0].href.endsWith("me")) ul.children[0].children[0].href += `?f.Task=&f.LanguageName=&f.Status=AC&f.User=`;
})();