AtCoder Default Search Fields

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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=`;
})();