2012-05-01 15:56:45 -04:00
|
|
|
// ==UserScript==
|
2015-10-26 03:40:13 -04:00
|
|
|
// @name Open Google's search results in tabs
|
2013-07-02 11:10:21 -04:00
|
|
|
// @namespace google_GM_openInTab.user.js
|
2015-10-26 03:40:51 -04:00
|
|
|
// @include http*://www.google.*/search*
|
2015-10-26 03:40:40 -04:00
|
|
|
// @grant GM_openInTab
|
2013-07-02 11:10:21 -04:00
|
|
|
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
|
|
|
|
// @run-at document-idle
|
|
|
|
// see: https://github.com/piroor/treestyletab/issues/517
|
2012-05-01 15:56:45 -04:00
|
|
|
// ==/UserScript==
|
|
|
|
|
2013-07-02 11:10:21 -04:00
|
|
|
function init()
|
|
|
|
{
|
2015-10-26 02:56:58 -04:00
|
|
|
$("div#res.med").prepend('<div><a id="use_GM_openInTab"><img src="http://i.imgur.com/cQkJVZY.png" alt="">Open All Links with GM_openInTab</a></div>');
|
2013-07-02 11:10:21 -04:00
|
|
|
$('#use_GM_openInTab').click(function()
|
|
|
|
{
|
|
|
|
useGMopenIn();
|
|
|
|
});
|
|
|
|
|
2015-10-26 02:56:58 -04:00
|
|
|
$("div#res.med").prepend('<div><a id="use_windowOpen"><img src="http://i.imgur.com/cQkJVZY.png" alt="">Open All Links window.open</a></div>');
|
2013-07-02 11:10:21 -04:00
|
|
|
$('#use_windowOpen').click(function()
|
|
|
|
{
|
|
|
|
useWinOpen();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function useGMopenIn()
|
|
|
|
{
|
|
|
|
$('.r a').each(function (i, e)
|
|
|
|
{
|
|
|
|
var linkURI = $(e).attr('href');
|
|
|
|
GM_openInTab(linkURI, true);
|
|
|
|
}); return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
function useWinOpen()
|
|
|
|
{
|
|
|
|
$('.r a').each(function (i, e)
|
|
|
|
{
|
|
|
|
var linkURI = $(e).attr('href');
|
|
|
|
window.open(linkURI, "_blank");
|
|
|
|
}); return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
init();
|