OGS Title Count

Displays number of games waiting for your move in page title on online-go.com

Verze ze dne 14. 02. 2015. Zobrazit nejnovější verzi.

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

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 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         OGS Title Count
// @description  Displays number of games waiting for your move in page title on online-go.com
// @author       TPReal
// @namespace    https://greasyfork.org/users/9113
// @version      0.2
// @match        *://online-go.com/*
// @grant        none
// ==/UserScript==

var TITLE_MATCHER=/^(?:\[\d+\] )?(.*)$/;

var updateTitle=function(){
  var value=document.getElementById("turn-notification-indicator").innerText;
  var prefix="";
  if(value&&value!="0")
    prefix="["+value+"] ";
  var baseTitle=TITLE_MATCHER.exec(document.title)[1];
  document.title=prefix+baseTitle;
};

var tick=function(){
  updateTitle();
  setTimeout(tick,1000);
};
tick();