aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdh19952016-12-23 01:51:09 +0800
committergdh19952017-01-03 16:45:19 +0800
commit48c169bd5a61685bb4e67b1e76c939dbf360a658 (patch)
tree867fbe81fcee1d4b74cd9319f52c62862fc4d850
parentb12ed93d0b96df90511d3331e8a5f54e7b1b7da4 (diff)
downloadvimium-48c169bd5a61685bb4e67b1e76c939dbf360a658.tar.bz2
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
-rw-r--r--content_scripts/mode_insert.coffee1
1 files changed, 1 insertions, 0 deletions
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"