Skip to content

Commit

Permalink
remove #result_ before traversing SERP DOM
Browse files Browse the repository at this point in the history
  • Loading branch information
dslatten committed Jan 18, 2012
1 parent e4d4fdb commit af865af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion snippet.js
Expand Up @@ -29,6 +29,9 @@ javascript:void(function(){
if(mofoListItems[i].getElementsByTagName('cite').length!=0){
if(mofoListItems[i].getElementsByTagName('h3')[0].getElementsByTagName('a')[0].href.indexOf('q=related')==-1){
r += 1;
if(document.getElementById('result_' + r)){
document.getElementById('result_' + r).parentNode.removeChild(document.getElementById('result_' + r));
}
blueLink = mofoListItems[i].getElementsByTagName('h3')[0].getElementsByTagName('a')[0];
divsInVSC = mofoListItems[i].firstChild.getElementsByTagName('div');
linkURL = blueLink.href;
Expand Down Expand Up @@ -70,7 +73,6 @@ javascript:void(function(){

message += '<tr><td align="center" bgcolor="' + bgColor + '" title="Jump to this SERP listing"><a href="#result_' + r + '" style="text-decoration:none;font-size:medium;font-weight:bold;display:block;width:33px;height:33px;line-height:33px">&#x21d0;</a></td><td align="right" bgcolor="' + bgColor + '" title="SERP position">' + r + '</td><td bgcolor="' + bgColor + '" title="' + linkURL + '" style="color:#222">' + spanST.innerHTML + '</td><td align="right" bgcolor="' + bgColor + '" title="number of characters">' + snip.length + '</td><td align="right" bgcolor="' + bgColor + '" title="width in pixels">' + spanST.offsetWidth + '</td></tr>';

if(document.getElementById('result_' + r)){document.getElementById('result_' + r).parentNode.removeChild(document.getElementById('result_' + r));}
jumpLink = document.createElement('div');
jumpLink.id = 'result_' + r;
mofoListItems[i].insertBefore(jumpLink,mofoListItems[i].firstChild);
Expand Down
4 changes: 3 additions & 1 deletion title.js
Expand Up @@ -29,6 +29,9 @@ javascript:void(function(){
if(mofoListItems[i].getElementsByTagName('cite').length!=0){
if(mofoListItems[i].getElementsByTagName('h3')[0].getElementsByTagName('a')[0].href.indexOf('q=related')==-1){
r += 1;
if(document.getElementById('result_' + r)){
document.getElementById('result_' + r).parentNode.removeChild(document.getElementById('result_' + r));
}
blueLink = mofoListItems[i].getElementsByTagName('h3')[0].getElementsByTagName('a')[0];
linkURL = blueLink.href;
linkText = clean(blueLink.innerHTML);
Expand Down Expand Up @@ -59,7 +62,6 @@ javascript:void(function(){

message += '<tr><td align="center" bgcolor="' + bgColor + '" title="Jump to this SERP listing"><a href="#result_' + r + '" style="text-decoration:none;font-size:medium;font-weight:bold;display:block;width:33px;height:33px;line-height:33px">&#x21d0;</a></td><td align="right" bgcolor="' + bgColor + '" title="SERP position">' + r + '</td><td bgcolor="' + bgColor + '" title="' + linkURL + '"><div style="color:#12c;font-size:medium;text-decoration:underline;white-space:nowrap;width:512px;overflow:hidden;text-overflow:ellipsis">' + blueLink.innerHTML + '</div></td><td align="right" bgcolor="' + bgColor + '" title="number of characters">' + linkText.length + '</td><td align="right" bgcolor="' + bgColor + '" title="width in pixels">' + blueLink.offsetWidth + '</td></tr>';

if(document.getElementById('result_' + r)){document.getElementById('result_' + r).parentNode.removeChild(document.getElementById('result_' + r));}
jumpLink = document.createElement('div');
jumpLink.id = 'result_' + r;
mofoListItems[i].insertBefore(jumpLink,mofoListItems[i].firstChild);
Expand Down
4 changes: 3 additions & 1 deletion url.js
Expand Up @@ -29,6 +29,9 @@ javascript:void(function(){
if(mofoListItems[i].getElementsByTagName('cite').length!=0){
if(mofoListItems[i].getElementsByTagName('h3')[0].getElementsByTagName('a')[0].href.indexOf('q=related')==-1){
r += 1;
if(document.getElementById('result_' + r)){
document.getElementById('result_' + r).parentNode.removeChild(document.getElementById('result_' + r));
}
blueLink = mofoListItems[i].getElementsByTagName('h3')[0].getElementsByTagName('a')[0];
divsInVSC = mofoListItems[i].firstChild.getElementsByTagName('div');
linkURL = blueLink.href;
Expand Down Expand Up @@ -65,7 +68,6 @@ javascript:void(function(){

message += '<tr><td align="center" bgcolor="' + bgColor + '" title="Jump to this SERP listing"><a href="#result_' + r + '" style="text-decoration:none;font-size:medium;font-weight:bold;display:block;width:33px;height:33px;line-height:33px">&#x21d0;</a></td><td align="right" bgcolor="' + bgColor + '" title="SERP position">' + r + '</td><td bgcolor="' + bgColor + '" title="' + linkURL + '" style="color:#093">' + citation.innerHTML + '</td><td align="right" bgcolor="' + bgColor + '" title="number of characters">' + displayURL.length + '</td><td align="right" bgcolor="' + bgColor + '" title="width in pixels">' + citation.offsetWidth + '</td></tr>';

if(document.getElementById('result_' + r)){document.getElementById('result_' + r).parentNode.removeChild(document.getElementById('result_' + r));}
jumpLink = document.createElement('div');
jumpLink.id = 'result_' + r;
mofoListItems[i].insertBefore(jumpLink,mofoListItems[i].firstChild);
Expand Down

0 comments on commit af865af

Please sign in to comment.