Add YouTube to Google Search Bar

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name       Add YouTube to Google Search Bar
// @namespace  AfzalivE
// @version    1.0
// @description  Adds back the missing YouTube link in the new Google Search Bar
// @include      https://www.google.*/search*
// @include      http://www.google.*/search*
// @include      https://google.*/search*
// @include      http://google.*/search*
// @copyright  2013 AfzalivE
// ==/UserScript==

query = document.getElementById("gbqfq").value;
shopping = document.getElementById("hdtb_msb").childNodes[3];
videos = document.createElement("div");
videos.setAttribute("class", "hdtb_mitem");
yt_link = document.createElement("a");
yt_link.setAttribute("class", "q qs");
yt_link.setAttribute("href", "https://www.youtube.com/results?num=20&q="+ query);
yt_link.innerHTML = "YouTube";
videos.appendChild(yt_link);
shopping.parentNode.insertBefore(videos, shopping);