From 48c169bd5a61685bb4e67b1e76c939dbf360a658 Mon Sep 17 00:00:00 2001 From: gdh1995 Date: Fri, 23 Dec 2016 01:51:09 +0800 Subject: InsertMode should not handle key events if document.body is editable For example, the host JavaScript may create an "about:blank" iframe with a `content-editable` `body`, and then: * the parent frame may handle `Escape` key events by itself * but now, Vimium always grabs `Escape` events * and tries to exit `InsertMode` * although `document.body` is still current `activeElement` after `body.blur()` * as a result, neither the parent can receive and handle wanted keyevents, nor Vimium will succeed in returing back to NormalMode --- content_scripts/mode_insert.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/content_scripts/mode_insert.coffee b/content_scripts/mode_insert.coffee index d5d98297..a998a040 100644 --- a/content_scripts/mode_insert.coffee +++ b/content_scripts/mode_insert.coffee @@ -10,6 +10,7 @@ class InsertMode extends Mode handleKeyEvent = (event) => return @continueBubbling unless @isActive event + return @passEventToPage if @insertModeLock is document.body # Check for a pass-next-key key. if KeyboardUtils.getKeyCharString(event) in Settings.get "passNextKeyKeys" -- cgit v1.2.3