derLoki / YouTubeSearchInNewTab

// ==UserScript==
// @id			 YouTubeSearchInNewTabLOKI
// @name         YouTubeSearchInNewTab
// @namespace    derLoki.YouTubeSearchInNewTab
// @include      *://*.youtube.*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @version		 2.6
// @description  Adds a new Button next to the search button, to search in a new tab
// @author       derLoki
// @grant        none
// ==/UserScript==


(function() {
    'use strict';

    
    var srchButton = $("#search-btn");
    $("#search-btn .yt-uix-button-content");
	srchButton.parent().prepend(srchButton.clone()
	.attr('id','search-button-newTab')
	.attr('onClick','')
	.click(function(){
		var textFieldText = $("#masthead-search-term").val();
		if (textFieldText !== "")
			window.open('http://www.youtube.com/results?search_query='+textFieldText);
		return false;
	}).css({float:"right"}).find("span").css({background:'url("//s.ytimg.com/yt/imgbin/www-refresh-vflmpZ5kj.png") no-repeat scroll -76px -210px transparent',width:'13px',height:'11px'}).end());
    
})();