From 42025fd9ceb7042e80b09744fdcdd47d447dec2f Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Mon, 17 Apr 2017 17:33:16 +0100 Subject: Clarify postFindFocus and obviously separate it from the try..catch --- content_scripts/mode_find.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content_scripts/mode_find.coffee b/content_scripts/mode_find.coffee index d6835e6b..63825600 100644 --- a/content_scripts/mode_find.coffee +++ b/content_scripts/mode_find.coffee @@ -181,6 +181,9 @@ class FindMode extends Mode try result = window.find(query, options.caseSensitive, options.backwards, true, false, true, false) catch # Failed searches throw on Firefox. + + # window.find focuses the |window| that it is called on. This gives us an opportunity to (re-)focus + # another element/window, if that isn't the behaviour we want. options.postFindFocus?.focus() if options.colorSelection -- cgit v1.2.3