Skip to content

Instantly share code, notes, and snippets.

@oott123
Created November 15, 2014 13:10
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 oott123/283cca3582ffebf69ce5 to your computer and use it in GitHub Desktop.
Save oott123/283cca3582ffebf69ce5 to your computer and use it in GitHub Desktop.
google_chinese_webpage
// ==UserScript==
// @id google_chinese_webpage
// @name 谷歌显示“中文网页”链接
// @version 1.0
// @namespace google_chinese_webpage
// @author oott123
// @description
// @include https://www.google.*/search*
// @run-at document-end
// ==/UserScript==
setTimeout(function(){
try{
var chineseUrl = document.getElementById('lr_lang_1zh-CN|lang_1zh-TW').childNodes[0].href;
var chineseDiv = document.createElement('div');
chineseDiv.className = "hdtb_mitem hdtb_imb";
var chineseA = document.createElement('a');
chineseA.href = chineseUrl;
chineseA.className = "q qs";
chineseA.innerHTML = "中文";
chineseDiv.appendChild(chineseA);
document.getElementById('hdtb_msb').insertBefore(chineseDiv, document.getElementsByClassName('hdtb_mitem')[1]);
}catch(e){
console.log(e);
}
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment