gleam.io days in title

Shows the runtime of the contest in the title

Stan na 27-11-2021. Zobacz najnowsza wersja.

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

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

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         gleam.io days in title
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Shows the runtime of the contest in the title
// @author       woebbi
// @license     GNU GPLv3 https://choosealicense.com/licenses/gpl-3.0/
// @match        *gleam.io/*
// @icon         https://www.google.com/s2/favicons?domain=gleam.io
// @grant        none
// ==/UserScript==

$(document).ready(function() {
    if (document.getElementsByClassName("status ng-binding")[1] !== null) {
        var status = document.getElementsByClassName("status ng-binding");
        var duration = status[status.length - 1].innerHTML.trim();


        var descr = document.getElementsByClassName("description ng-binding")
        descr = descr[descr.length - 1].innerHTML;
        var timething = descr.trim().charAt(0).toLowerCase();
        if (duration == "Ended"){
            duration = "e";
            timething = ""
        }
        console.log(duration + " " + timething);
        var textfortitle = "(" + duration + timething + ")";
        document.title = textfortitle + document.title;
    }
});