diff options
| author | Jez Ng | 2012-03-02 18:24:00 -0500 | 
|---|---|---|
| committer | Jez Ng | 2012-03-02 18:32:37 -0500 | 
| commit | d04f2a57771d04d1014699ef47b147d1c11380bc (patch) | |
| tree | 951778f04edbffe90c041c272bb6b2df7d877ac5 | |
| parent | 5c6182d794e109515ccc30e2122e43a215c67077 (diff) | |
| download | vimium-d04f2a57771d04d1014699ef47b147d1c11380bc.tar.bz2 | |
Only show hints for focusable input elements.
Closes #496.
| -rw-r--r-- | linkHints.js | 3 | ||||
| -rw-r--r-- | vimiumFrontend.js | 3 | 
2 files changed, 4 insertions, 2 deletions
diff --git a/linkHints.js b/linkHints.js index 53760b95..456f634c 100644 --- a/linkHints.js +++ b/linkHints.js @@ -41,7 +41,8 @@ var linkHints = {     * The final expression will be something like "//button | //xhtml:button | ..."     * We use translate() instead of lower-case() because Chrome only supports XPath 1.0.     */ -  clickableElementsXPath: domUtils.makeXPath(["a", "area[@href]", "textarea", "button", "select","input[not(@type='hidden')]", +  clickableElementsXPath: domUtils.makeXPath(["a", "area[@href]", "textarea", "button", "select", +                             "input[not(@type='hidden' or @disabled or @readonly)]",                               "*[@onclick or @tabindex or @role='link' or @role='button' or " +                               "@contenteditable='' or translate(@contenteditable, 'TRUE', 'true')='true']"]), diff --git a/vimiumFrontend.js b/vimiumFrontend.js index d1f0aac5..8a4da834 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -32,7 +32,8 @@ var activatedElement;  var textInputXPath = (function() {    var textInputTypes = ["text", "search", "email", "url", "number", "password"];    var inputElements = ["input[" + -    textInputTypes.map(function (type) { return '@type="' + type + '"'; }).join(" or ") + "or not(@type)]", +    "(" + textInputTypes.map(function(type) {return '@type="' + type + '"'}).join(" or ") + "or not(@type))" + +    " and not(@disabled or @readonly)]",      "textarea", "*[@contenteditable='' or translate(@contenteditable, 'TRUE', 'true')='true']"];    return domUtils.makeXPath(inputElements);  })();  | 
