Zen Mode for Codeforces

Add a button to your Codeforces tool bar.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Zen Mode for Codeforces
// @namespace    https://subc.rip
// @version      2024-02-19
// @description  Add a button to your Codeforces tool bar.
// @author       subcrip
// @match        https://codeforces.com/contest/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=codeforces.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    const contest = window.location.pathname.split('/')[2];
    let button = document.createElement('li');
    let inner = document.createElement('a');
    inner.target = '_blank';
    inner.href = `https://codeforces.com/contest/${contest}/problems`;
    inner.innerText = 'ZEN MODE';
    button.appendChild(inner);
    let menu = document.getElementsByClassName('second-level-menu-list')[0];
    menu.insertBefore(button, menu.children[2])
})();