From 38ae5683b7ae17f721da8ca54488905c21ecfb45 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Mon, 22 Jun 2015 23:08:59 +0200 Subject: [PATCH] Add prevent_autofocus_modes pref It allows to configure which modes prevent_autofocus should be used in. It defaults to normal mode only. --- documentation/options.md | 4 ++++ extension/lib/defaults.coffee | 1 + extension/lib/events.coffee | 2 +- extension/lib/parse-prefs.coffee | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/documentation/options.md b/documentation/options.md index 1d9578a..1a4c844 100644 --- a/documentation/options.md +++ b/documentation/options.md @@ -137,6 +137,10 @@ you dislike that, disable this option. If `prevent_autofocus` is enabled, all focus events except those that occur within this number of milliseconds after a user interaction are suppressed. +### `prevent_autofocus_modes` + +Space separated list of modes where `prevent_autofocus` should be used. + ### `hints_timeout` The number of milliseconds a matched hint marker should stay on screen before diff --git a/extension/lib/defaults.coffee b/extension/lib/defaults.coffee index de6c7bd..57bf94e 100644 --- a/extension/lib/defaults.coffee +++ b/extension/lib/defaults.coffee @@ -124,6 +124,7 @@ options = advanced_options = 'prevent_target_blank': true 'autofocus_limit': 100 + 'prevent_autofocus_modes': 'normal' 'hints_timeout': 200 'smoothScroll.lines.spring-constant': '1000' 'smoothScroll.pages.spring-constant': '2500' diff --git a/extension/lib/events.coffee b/extension/lib/events.coffee index d7f6b22..a51063c 100644 --- a/extension/lib/events.coffee +++ b/extension/lib/events.coffee @@ -148,7 +148,7 @@ windowsListeners = # a second) and then focuses the `