Add YouTube to Google Search Bar

Adds back the missing YouTube link in the new Google Search Bar

  1. // ==UserScript==
  2. // @name Add YouTube to Google Search Bar
  3. // @namespace AfzalivE
  4. // @version 1.0
  5. // @description Adds back the missing YouTube link in the new Google Search Bar
  6. // @include https://www.google.*/search*
  7. // @include http://www.google.*/search*
  8. // @include https://google.*/search*
  9. // @include http://google.*/search*
  10. // @copyright 2013 AfzalivE
  11. // ==/UserScript==
  12.  
  13. query = document.getElementById("gbqfq").value;
  14. shopping = document.getElementById("hdtb_msb").childNodes[3];
  15. videos = document.createElement("div");
  16. videos.setAttribute("class", "hdtb_mitem");
  17. yt_link = document.createElement("a");
  18. yt_link.setAttribute("class", "q qs");
  19. yt_link.setAttribute("href", "https://www.youtube.com/results?num=20&q="+ query);
  20. yt_link.innerHTML = "YouTube";
  21. videos.appendChild(yt_link);
  22. shopping.parentNode.insertBefore(videos, shopping);