Is there any way of making Ctrl+f in Chrome use the selected text, as per Firefox?

One thing that's really bugged me since switching to Chrome is that Ctrl + F behaves slightly differently from Firefox.

In Firefox, if you have text highlighted and hit Ctrl + F, it'll start finding with that text.

Is there any way of getting Chrome to do this?


Solution 1:

This issue was once raised in Chrome and is documented in :
Issue 6356004: If the user selects text in the current tab, and types CTRL-F,... (Closed)

In this Issue article, six successive patches were applied to Chrome to enable this functionality. However, because of too numerous unsolved issues, such as line breaks and other characters that can't be printed in the find box, the developer Simon Morris has given up and concluded :

Besides these issues, this behavior just doesn't feel terribly compelling when testing it. Perhaps I'm too used to the existing Chrome behavior, but while I expect prepopulation based on previous search strings in this or other tabs, I don't really expect selecting text to change my search string, and it doesn't feel terribly hard to sandwich the ctrl-f in a ctrl-c/ctrl-v pair to be explicit, given that I've just selected what I want to search for.

Since Ben already voted against this and the above testing doesn't give me strong counterarguments, I'm going ahead and closing.

I see this as pure laziness, as this problem and others were easily solved in other browsers. I have also searched but not found any Chrome extension that solves the problem.

The only solution I can therefore suggest, is to use a keyboard macro bound to a hotkey to issue the series of "Ctrl+C Ctrl+F Ctrl+V".

If you are on Windows you can use a Autohotkey script for this.
See this thread for an example : Chrome extension for highlight+find prepopulate?

An Autohotkey script can also be bound to a given process or window, so one can further fine-tune this script to apply only to Chrome.

If you are on Linux, you can use this port of Autohotkey : IronAHK, which runs on .NET or Mono for Linux/Mac. This article might be useful : Install IronAHK on Linux.

Solution 2:

If you really crave for that behavior, download AutoHotkey and load the following script:

~^f::
SetTitleMatchMode 2
IfWinActive, Google Chrome
{
  Send, ^c
  Send, {F3}
  Send, ^v
  Send ^a
  return
}
else
{
  Send ^f
  return
}

Solution 3:

Actually the feature is there, at least on Mac OS.

It's called "Use selection for Find" and it's bound to +E.

Press +E +G to highlight all words equal to the selected!

Press +E +F +G to start a search with the current selection.

(Can't check on Windows, but it seems not to have the feature altogether)

Solution 4:

I use Ctrl+C, Ctrl+F, Ctrl+V - at least they are close together on the keyboard and reasonably quick to type.