GAB Notification Count in Title

Show a notification count in the title of the page for tab browsing convenience.

  1. // ==UserScript==
  2. // @name GAB Notification Count in Title
  3. // @namespace http://gab.ai/Jeremy20_9
  4. // @version 0.1
  5. // @description Show a notification count in the title of the page for tab browsing convenience.
  6. // @author Jeremiah 20:9
  7. // @match https://gab.ai/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. var pagetitle = document.title;
  12. var itvcheck = -1;
  13. $(document).ready(function(){
  14. itvcheck = setInterval(function(){
  15. var indicator = $(".header__link--notifications");
  16. if(indicator.length > 0)
  17. {
  18. indicator = $(indicator).find("span");
  19. var count = parseInt($(indicator).text());
  20. if(count > 0)
  21. document.title = pagetitle + "(" + count + ")";
  22. else
  23. document.title = pagetitle;
  24. }
  25. }, 1000);
  26. });
  27.