diff options
Diffstat (limited to 'vimiumFrontend.js')
| -rw-r--r-- | vimiumFrontend.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js index f2f5abd3..d74c6d53 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -200,15 +200,11 @@ function scrollRight() { window.scrollBy(settings["scrollStepSize"], 0); } function focusFirstInput() { var xpath = '//input[@type="text" or @type="search"]'; - var result = document.evaluate( xpath, document.documentElement, null, - XPathResult.FIRST_ORDERED_NODE_TYPE, null ); - - if ( result.singleNodeValue == null ) return; - - var el = document.getElementById( result.singleNodeValue.id ); - if ( el ) { - el.focus(); - } + var result = document.evaluate(xpath, document.documentElement, null, + XPathResult.FIRST_ORDERED_NODE_TYPE, null); + if (!result.singleNodeValue) + return; + result.singleNodeValue.focus(); } function reload() { window.location.reload(); } |
