aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content_scripts/mode_find.coffee7
1 files changed, 6 insertions, 1 deletions
diff --git a/content_scripts/mode_find.coffee b/content_scripts/mode_find.coffee
index 0178527b..73b3a77a 100644
--- a/content_scripts/mode_find.coffee
+++ b/content_scripts/mode_find.coffee
@@ -178,7 +178,12 @@ class FindMode extends Mode
# ignore the selectionchange event generated by find()
document.removeEventListener("selectionchange", @restoreDefaultSelectionHighlight, true)
- result = window.find(query, options.caseSensitive, options.backwards, true, false, true, false)
+ try
+ result = window.find(query, options.caseSensitive, options.backwards, true, false, true, false)
+ catch # Failed searches throw on Firefox.
+ # NOTE(mrmr1993): On Firefox, window.find moves the window focus away from the HUD. We put it back, so
+ # the user can continue typing.
+ try HUD.hudUI.iframeElement.contentWindow.focus()
if options.colorSelection
setTimeout(