Allow hinting ';e' and 'gi' also for input without type attribute.
authorDaniel Carl <danielcarl@gmx.de>
Thu, 7 Nov 2013 10:24:34 +0000 (11:24 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Thu, 7 Nov 2013 10:24:34 +0000 (11:24 +0100)
This enables to focus the search box of google, that has not type attribute.

src/dom.c
src/hints.js

index f13c3af..4d25cb8 100644 (file)
--- a/src/dom.c
+++ b/src/dom.c
@@ -91,7 +91,7 @@ gboolean dom_focus_input(WebKitWebView *view)
     }
 
     result = webkit_dom_document_evaluate(
-        doc, "//input[@type='text']|//input[@type='password']|//textarea",
+        doc, "//input[not(@type) or @type='text' or @type='password']|//textarea",
         html, resolver, 0, NULL, NULL
     );
     if (!result) {
index 164703c..666c8e6 100644 (file)
@@ -377,11 +377,11 @@ var VbHint = (function(){
                 );
             case "e":
                 if (!s) {
-                    return "//input[@type='text'] | //textarea";
+                    return "//input[not(@type) or @type='text'] | //textarea";
                 }
                 return buildQuery(
                     ["@value", ".", "@placeholder"],
-                    "//input[@type='text' and ($@value or $@placeholder)] | //textarea[$.]",
+                    "//input[(not(@type) or @type='text') and ($@value or $@placeholder)] | //textarea[$.]",
                     s
                 );
             case "i":