Created
March 27, 2012 00:51
-
-
Save issa-tseng/2211200 to your computer and use it in GitHub Desktop.
Add scholar link to any Google bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @version 1.0 | |
// @match http://*.google.com/* | |
// @match https://*.google.com/* | |
// ==/UserScript== | |
(function() | |
{ | |
// why can't the world just standardize on jQuery? | |
var listElem = document.createElement('li'); | |
listElem.className = 'gbt'; | |
var anchorElem = document.createElement('a'); | |
anchorElem.className = 'gbzt'; | |
anchorElem.href = '//scholar.google.com/scholar' + location.search; | |
var span1Elem = document.createElement('span'); | |
span1Elem.className = 'gbtb2'; | |
var span2Elem = document.createElement('span'); | |
span2Elem.className = 'gbts'; | |
span2Elem.appendChild(document.createTextNode('Scholar')); | |
var barElem = document.getElementById('gbz').getElementsByClassName('gbtc')[0]; | |
anchorElem.appendChild(span1Elem); | |
anchorElem.appendChild(span2Elem); | |
listElem.appendChild(anchorElem); | |
barElem.appendChild(listElem); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment