add_GoogleScholar

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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_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);