Commits

lornajane committed cb5572a

workarounds for common problems on github, google groups and bbcnews

  • Participants
  • Parent commits 37ec874

Comments (0)

Files changed (1)

 
 
 function isTextInput(e) {
-	return ((e.tagName == "INPUT" && (e.type == "text" || e.type == "password")) ||
-			e.tagName == "TEXTAREA");
+	return ((e.tagName == "INPUT" && (e.type == "text" || e.type == "password")) 
+            || e.tagName == "TEXTAREA" 
+            || e.getAttribute("g_editable") // google groups text box
+            );
 }
 
 function emulateMouseClick(target, ctrlKey, altKey, shiftKey, metaKey){
 		nodes = [document.getElementsByTagName("a"),
 				document.getElementsByTagName("input"),
 				document.getElementsByTagName("textarea"),
-				document.getElementsByTagName("textarea"),
 				document.getElementsByTagName("select"),
 				document.getElementsByTagName("img"),
 				document.getElementsByTagName("button"),
-                document.getElementsByTagName("span")];
+                document.getElementsByClassName("select-menu-button"), // github dropdown menus
+                document.getElementsByClassName("headline"), // bbc news titles
+                [document.getElementById("p-b-0")] // google groups edit box
+                    ];
 		sel = [];
 		for (i = 0; i < nodes.length; i++) {
 			elem = nodes[i];
 			for (j = 0; j < elem.length; j++) {
+                if(!elem[j]) continue;
 				sel.push(elem[j]);
 			}
 		}
 				continue;
 			}
 
-            if((elem.tagName == "SPAN" && elem.className.indexOf("select-menu-button") != -1)) {
-                continue;
-            }
-			
 			if (elem.offsetWidth > 0 && elem.offsetHeight > 0) {
 				nodes.push(elem);
 			}