.



on-line?
? ?
Ru.Board » » » Opera Presto - , , .. (. 5)

: gyra, Maz

   •

     

DCT

Advanced Member
| | | |

:
// ==UserScript==
// @name        Google Search Extra Buttons
// @description Add buttons (last 1/2/3 days, weeks, PDF search etc.) for results of Google search page
// @version     201706 DCT lightmod of https://greasyfork.org/ru/scripts/7543-google-search-extra-buttons/versions
// @exclude      https://www.google.*&tbm=isch*
// @include       https://www.google.*/search?*
// ==/UserScript==
 
 
(function(){
 
function createURLButton(name, extraURL)
{
var JSAction = "url = '/search?q=';url += encodeURIComponent(document.getElementsByName('q')[0].value) + '" + extraURL + "';location.href = url;return false;";
linkContainer = document.getElementById("hdtb-msb");
linkContainer.innerHTML += '<DIV class="hdtb-mitem hdtb-imb" ><a href="#" onClick="'+JSAction+'">'+name+'</a></div>';
}
 
 
/**
 * check occurrence of third-party event with growing interval
 * @constructor
 * @param{Number} t start period of check
 * @param{Number} i number of checks
 * @param{Number} m multiplier of period increment
 * @param{Function} check event condition
 * @param{Function} occur event handler
 */
var Tout = function(h){
var th = this;
(function(){
if((h.dat = h.check() )) //wait of positive result, then occurs
h.occur();
else if(h.i-- >0) //next slower step
th.ww = setTimeout(arguments.callee, (h.t *= h.m) );
})();
};
 
new Tout({t:120, i:8, m: 1.6
,check: function(){
return document && document.getElementsByName("q") && document.getElementsByName('q')[0];
},
occur: function(){
var inputSearch = this.dat
,buttSearch = document.getElementsByName("btnG") && document.getElementsByName('btnG')[0];
 
if(buttSearch && top == self)
{

// ------------------Buttons creation ----------------------
createURLButton("PDF", '&as_filetype=pdf');
//search languages
createURLButton("ru", '&lr=lang_ru');
createURLButton("en", '&lr=lang_en');
createURLButton("ua", '&lr=lang_uk');
//search durations
createURLButton("1D", '&tbs=qdr:d');
createURLButton("7D", '&tbs=qdr:w');
createURLButton("1M", '&tbs=qdr:m');
createURLButton("1Y", '&tbs=qdr:y');
//clear
createURLButton("x", '&tbs=0');
// ----------------/Buttons creation ----------------------

}
}
});
 
})();

: 785 | . 22-12-2005 | : 00:37 17-06-2017 | : DCT, 00:41 17-06-2017
     


Ru.Board » » » Opera Presto - , , .. (. 5)


Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.Board
© Ru.Board 2000-2020

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

.ru

.ru