Github.com - Add "Watching" tab

Adds a "Watching" tab beside the "News Feed", "Pull Requests" and "Issues" tabs on the Github homepage

目前為 2014-07-08 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Github.com - Add "Watching" tab
  3. // @namespace r-a-y/github/watching/homepage
  4. // @description Adds a "Watching" tab beside the "News Feed", "Pull Requests" and "Issues" tabs on the Github homepage
  5. // @include https://github.com/
  6. // @version 1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. var nav = document.getElementsByClassName('pagehead-nav');
  11.  
  12. var watchingLink = document.createElement('a');
  13. watchingLink.href = '/watching';
  14. watchingLink.setAttribute( 'class', 'pagehead-nav-item' );
  15. watchingLink.innerHTML = '<span class="octicon octicon-eye"> </span> Watching';
  16.  
  17. nav[0].appendChild( watchingLink );