Skip to content

Instantly share code, notes, and snippets.

@0-oo
Last active December 17, 2016 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0-oo/9bc5ab1d10809b720131 to your computer and use it in GitHub Desktop.
Save 0-oo/9bc5ab1d10809b720131 to your computer and use it in GitHub Desktop.
Greasemonkey/Tampermonkey: Google検索に「日本語のみ」ボタン(=日の丸アイコン)を追加する
// ==UserScript==
// @name Google検索 日本語のみボタン
// @namespace http://0-oo.net/
// @description Google検索に「日本語のみ」ボタンを追加する
// @homepage http://0-oo.net/log/category/greasemonkey/
// @version 0.2.2
// @include http*://www.google.tld/search*
// @include http*://www.google.tld/webhp*
// @include http*://www.google.tld/#*
// @include http*://www.google.tld/
// @grant none
// ==/UserScript==
//
// ( The MIT License )
//
(function(){
var btn = document.body.appendChild(document.createElement("img"));
btn.src = "https://chart.googleapis.com/chart?chst=d_simple_text_icon_above&chld=|0|000|flag_ja|24|000|000";
btn.title = "日本語のページを検索";
btn.style.position = "absolute";
btn.style.top = "96px";
btn.style.right = 0;
btn.style.zIndex = 1000;
btn.style.border = "solid 1px #ccc";
btn.style.cursor = "pointer";
btn.addEventListener("click", function() {
location.href = location.href + "&lr=lang_ja";
}, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment