🏠 Home 

Github Repository Name as Tab Title

change tab title to : Repository Name / blabla


Install this script?
  1. // ==UserScript==
  2. // @name Github Repository Name as Tab Title
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description change tab title to : Repository Name / blabla
  6. // @author You
  7. // @match https://github.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
  9. // @grant none
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. setTimeout(()=>{
  14. var loca = location.href, name = loca, d=document, t=d.title;
  15. // https://github.com/user/repository-name
  16. var name = name.slice(name.indexOf('/', 20)+1);
  17. if(name.includes('/'))
  18. name = name.slice(0, name.indexOf('/'));
  19. debug(t, name);
  20. if(!t.includes(name) || loca.includes('/issues/'))
  21. t = name+' / '+t;
  22. else
  23. t = t.slice(t.indexOf(name))
  24. t = t[0].toUpperCase() + t.slice(1)
  25. d.title = t;
  26. }, 800)
  27. // Your code here...
  28. })();