Custom Google Navigation Bar

Choose what you want to see on the Google navigation bar.

当前为 2014-09-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Custom Google Navigation Bar
  3. // @description Choose what you want to see on the Google navigation bar.
  4. // @namespace 407d4100-4661-11e4-916c-0800200c9a66
  5. // @grant none
  6. // @include https://*.google.com/*
  7. // @version 1.1.0.0
  8. // ==/UserScript==
  9.  
  10. links = [
  11. ["http://www.greasyfork.org", "Greasy Fork"],
  12. ["http://mail.google.com", "Gmail"],
  13. ];
  14. // List of links to display on the navigation bar.
  15. hideApps = false;
  16. // Hide the apps icon
  17. hideNotifications = false;
  18. // Hide notifications
  19. hideShare = true;
  20. // Hide the Google+ Share button
  21. content = "";
  22. var elems = document.getElementsByTagName("div"), i;
  23.  
  24. for(x in links) {
  25. content += "&emsp;<a style='color: #333;text-decoration: none;' onmouseover='this.style.textDecoration = \"underline\";' onmouseout='this.style.textDecoration = \"none\"' href='" + links[x][0] + "'>" + links[x][1] + "</a>";
  26. }
  27. for (i in elems) {
  28. if((" " + elems[i].className + " ").indexOf(" gb_zc ") > -1) {
  29. if(hideApps) elems[i].style.paddingRight = "5px";
  30. elems[i].innerHTML = content;
  31. }
  32. else if((" " + elems[i].className + " ").indexOf(" gb_yc ") > -1) {
  33. if(hideApps) elems[i].children[1].style.display = "none";
  34. if(hideNotifications) elems[i].children[2].style.display = "none";
  35. if(hideShare) elems[i].children[3].style.display = "none";
  36. }
  37. }