Browse Source

use alt text if available

pull/1/head
10sr 12 years ago
parent
commit
8ac0ad6821
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      _keysnail.js

+ 10
- 2
_keysnail.js View File

@@ -162,9 +162,17 @@ ext.add("list-url", function(){
var urls = [];
var aa = window.content.document.getElementsByTagName("a");
var text = "";
var alt = "";
for (var i = 0; i < aa.length ; i++) {
if (aa[i].text == "" && aa[i].childNodes[0].nodeName == "IMG"){
text = "img: " + aa[i].childNodes[0].getAttribute("alt");
if(aa[i].href == ""){ continue; }

if (aa[i].text == "" && aa[i].hasChildNodes() && aa[i].childNodes[0].nodeType == Node.ELEMENT_NODE){
alt = aa[i].childNodes[0].getAttribute("alt");
if (alt != null){
text = aa[i].childNodes[0].nodeName + ": " + alt;
}else{
text = "";
}
}else{
text = aa[i].text;
}


Loading…
Cancel
Save