Hacking Gmail

(Grace) #1

98 Part II — Getting Inside Gmail


Listing 6-1(continued)

}
function getText(e){
nodes=e.childNodes;
for (var i=0; i<nodes.length; i++){
if (nodes[i].nodeValue != null){
return nodes[i].nodeValue;
}
}
}
function parsesub(r){
parser=new DOMParser();
dom=parser.parseFromString(r,’text/xml’);
r=dom.getElementsByTagName(‘item’);
return r;
}
function checkifpresenthtml(){
d=document.getElementById(‘nt_9’);
if (!d){
inithtml();
getsubs();
}
}
function switch_labels(){
for(i=0; i<window.labels_readed.length; i++){
label=window.labels_readed[i];
if (label.style.display != ‘none’){
label.style.display=’none’;
}else{
label.style.display=’block’;
}
}
}
function inithtml(){
bar=document.getElementById(‘nav’);
if (bar){

document.styleSheets[0].insertRule(‘ul#bloglines_subs>li>a{tex
t-decoration:none}’,document.styleSheets[0].length);

v=getcachedsubs();
if (v){
data=GM_getValue(‘subs_cached_html’,’’);
}else{
data=’’;
Free download pdf