From 2b3f7c4fa5b5be13a72d807b80c7dcc531d52829 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 30 Nov 2009 00:35:55 -0800 Subject: Add extra sanity checking to partially address issue #12 -- insert mode detection throws javascript error. --- vimiumFrontend.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimiumFrontend.js b/vimiumFrontend.js index 3f245e17..4edb9677 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -87,7 +87,7 @@ function initializeOnDomReady() { // Enter insert mode automatically if there's already a text box focused. var focusNode = window.getSelection().focusNode; var focusOffset = window.getSelection().focusOffset; - if (focusNode && focusOffset && + if (focusNode && focusOffset && focusNode.children.length > focusOffset && isInputOrText(focusNode.children[focusOffset])) { enterInsertMode(); } // Tell the background page we're in the dom ready state. chrome.extension.connect({ name: "domReady" }); -- cgit v1.2.3