62

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?

3

5 Answers 5

45
+50

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.

5
  • Thanks!! I was looking for a plugin, but autohotkey should work. But i need it on linux too. Anyway will award you bounty if no one else gives an answer with settings in chrome or a plugin.
    – nandeesh
    Sep 8, 2012 at 2:46
  • There exists a port of Autohotkey to Linux. See my addition at the end.
    – harrymc
    Sep 8, 2012 at 6:40
  • 15
    Shame on Chrome for not providing this!
    – Mr. Roland
    Nov 10, 2014 at 17:21
  • 1
    Bah... it seems the day when I switch to Chrome is not arrived yet May 9, 2015 at 23:33
  • You can also script xdotool with bash, perl, etc. on Linux rather than using AHK. Mar 28, 2017 at 11:25
12

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
}
0
8

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)

8
  • 1
    Ctrl+E brings up a "Search Google" prompt in the address bar.
    – mbomb007
    Jul 26, 2017 at 19:18
  • 1
    For me, it only works when the search is already open.
    – xpy
    Sep 7, 2018 at 7:55
  • @xpy you can try with Cmd+E, Cmd+F, Cmd+G in sequence
    – caesarsol
    Sep 12, 2018 at 8:08
  • 2
    @mbomb007 Mac Keyboards have a ctrl key and a 'cmd' key. Clearly the icon he showed there (besides being particular to a MAC Keyboard), is the mac keyboard's cmd key, not ctrl key.
    – barlop
    Sep 12, 2018 at 10:37
  • 2
    @barlop The OS can interpret the keys differently, but if you plug a mac keyboard into a windows computer, the Cmd key is the Windows key. They are both the same keyboard input.
    – mbomb007
    Sep 13, 2018 at 14:26
6

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

4
  • 4
    Ctrl can be even pressed down the whole time.
    – Daniel Beck
    Apr 10, 2011 at 11:43
  • @Daniel Beck: yes that's what I do, I just thought it clearer to spell out that Ctrl is needed for the last two keys as well as the first.
    – Hugh Allen
    Apr 11, 2011 at 2:20
  • Maybe I misunderstood the question, but either way, how is this any use though. It'd be useful if it could search within highlighted text. But this just finds a lump of text that he already found when he selected it. If it was searching within highlighted text then that'd be useful
    – barlop
    Sep 12, 2018 at 10:40
  • 3
    @barlop it is useful to find other occurrences of the same piece of text. I don't know of any browser that has the feature to search within selected text, though it would sometimes be useful. Perhaps you could write an extension to do that.
    – Hugh Allen
    Sep 15, 2018 at 13:03
0

I wrote a chrome extension with 5000+ users and recently ported it to firefox, it won’t populate the find palette but it automatically highlights all occurrences, maintains your original selection, shows scroll markers, and is configurable (gate key, window location rules, ancestor rules, etc)

see https://github.com/neaumusic/selection-highlighter

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .