// ==UserScript==
// @id Google
// @name GoogleSearchFix
// @version 1.0
// @namespace
// @author
// @description Hides ads
// @include
http://www.google.*
// @include
https://www.google.*
// @run-at document-end
// ==/UserScript==
function rem(x) x.parentNode.removeChild(x)
function tag(name) unsafeWindow.document.getElementsByTagName(name)
function id(name) unsafeWindow.document.getElementById(name)
function log(data) GM_log(data)
function tistr(data) unsafeWindow.document.title=(data).toString()
function geto(obj) XPCNativeWrapper.unwrap(obj)
function sa(obj,att,val) obj.setAttribute(att,val)
function ga(obj,att) obj.getAttribute(att)
function sall(arr,att,val){ for(i in arr)sa(arr
[i],att,val);}
function removeElem(elem) {
if (elem!==null) elem.parentNode.removeChild(elem);}
ads=['leftnav','gbg','rhs','tads','leqr','leoi','tpa1','tpa2','tpa3','mbEnd']
for (i in ads) removeElem(document.getElementById(ads
[i]));
st=document.getElementsByTagName('style')
for (i in st) st
[i].innerHTML='';
GM_addStyle('.gbmtc,.gbt,.gbzt,.gbtc{list-style:none;display:inline;float: left;} \n #srchdsc,#ab_ctls,#appbar,#resultStats,.vshid,.f,.s,#mngb,#gbw,#gb,#gbz{display:inline;} ');
//fixes links
a=tag('a');for(i in a)if(a
[i].href.search('url=')!=-1)a
[i].href=a
[i].href.replace(/.*url=|\&rct=j.*/gim,'');