OGS Utilities

Small improvements of online-go.com

  1. // ==UserScript==
  2. // @name OGS Utilities
  3. // @description Small improvements of online-go.com
  4. // @author TPReal
  5. // @namespace https://greasyfork.org/users/9113
  6. // @version 0.4.1
  7. // @match *://online-go.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. /* jshint esnext:true */
  12. (()=>{
  13. 'use strict';
  14.  
  15. const TITLE_MATCHER=/^(?:\[\d+\] )?(.*)$/;
  16.  
  17. var tick=()=>{
  18. const counterElem=document.querySelector(".turn-indicator");
  19. if(counterElem)
  20. document.title=`[${counterElem.innerText.trim()||"0"}] ${TITLE_MATCHER.exec(document.title)[1]}`;
  21. setTimeout(tick,1000);
  22. };
  23. tick();
  24.  
  25. })();