diff options
| author | Jez Ng | 2012-01-10 00:31:52 +0800 | 
|---|---|---|
| committer | Jez Ng | 2012-01-10 00:37:56 +0800 | 
| commit | a73f92604fca5380609f271685266cadf376ccbc (patch) | |
| tree | 2804155f8ae03bbfb38dee97872d4ba9ffb6246d | |
| parent | f6de023d964f2b4f8739e96361d542eb71d49dec (diff) | |
| download | vimium-a73f92604fca5380609f271685266cadf376ccbc.tar.bz2 | |
Detect contentEditable elements for hinting / input focus.
| -rw-r--r-- | linkHints.js | 4 | ||||
| -rw-r--r-- | vimiumFrontend.js | 2 | 
2 files changed, 4 insertions, 2 deletions
| diff --git a/linkHints.js b/linkHints.js index d37d2d7c..170dacb8 100644 --- a/linkHints.js +++ b/linkHints.js @@ -39,9 +39,11 @@ var linkHints = {    /*     * Generate an XPath describing what a clickable element is.     * 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: utils.makeXPath(["a", "area[@href]", "textarea", "button", "select","input[not(@type='hidden')]", -                             "*[@onclick or @tabindex or @role='link' or @role='button']"]), +                             "*[@onclick or @tabindex or @role='link' or @role='button' or " + +                             "@contenteditable='' or translate(@contenteditable, 'TRUE', 'true')='true']"]),    // We need this as a top-level function because our command system doesn't yet support arguments.    activateModeToOpenInNewTab: function() { this.activateMode(true, false, false); }, diff --git a/vimiumFrontend.js b/vimiumFrontend.js index a9dc1d37..8fa72509 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -32,7 +32,7 @@ var textInputXPath = (function() {    var textInputTypes = ["text", "search", "email", "url", "number"];    var inputElements = ["input[" +      textInputTypes.map(function (type) { return '@type="' + type + '"'; }).join(" or ") + "or not(@type)]", -    "textarea"]; +    "textarea", "*[@contenteditable='' or translate(@contenteditable, 'TRUE', 'true')='true']"];    return utils.makeXPath(inputElements);  })(); | 
