add_GoogleScholar

Google検索の上部バーにScholarを追加する

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        add_GoogleScholar
// @namespace   jp.gr.java_conf.kyu49.add_GoogleScholar
// @description Google検索の上部バーにScholarを追加する
// @include     https://www.google.co*/search?*
// @include     https://www.google.co*/?gfe_rd*
// @version     2
// @grant       none
// @license     MIT
// ==/UserScript==
var func = function(){
  var links=document.getElementsByTagName("a");
  for(var i=0; i<links.length; i++){
      if(links[i] && (links[i].innerHTML.includes("Shopping") || links[i].innerHTML.includes("ショッピング")) ){
          links[i].href="http://scholar.google.co.jp/scholar?"+window.location.href.match(/q=.+?(&|$)/i)[0];
          links[i].innerHTML="<span class='gs_ico' style='display: inline-block;background: no-repeat url(/intl/ja/scholar/images/1x/sprite_20161020.png);background-position: -44.52px -161.25px;opacity: .55;background-size: 109px;width: 13.55px;height: 15.55px;'></span>Scholar";
          clearInterval(timer);
      }
  }
}
var timer = setInterval(func, 50);