1

On Safari this can be done with Cmd+E, and it might even work on Chrome on OSX as well, but when on Windows I browse with Chrome. I do not want to type out what I want to search every time.

By search i mean search on the page, not search the internet.

If there is no built in key binding, then I hope someone can suggest a plugin or Tampermonkey style script to do it (I know that is definitely going to be possible).

Steven Lu
  • 3,620
  • 3
  • 35
  • 46
  • In Visual Studio, pressing Ctrl+F searches for the text that you've selected. I'd love to see this functionality in Chrome, perhaps you should make a [feature request](http://developer.chrome.com/extensions/faq.html#faq-fea-02). – Robert Rouhani Aug 05 '13 at 20:37

3 Answers3

1

Well, you can always copy it to the clipboard and paste it in the searchbox like so:

Ctrl+C, Ctrl+F, Ctrl+V

Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
  • This does work, but is not ideal because it takes 5 steps (must select in the beginning, which is at least a mouse double-click, and hit Enter to actually search at the end) and it's just too long a sequence. On OSX for instance it's 3 steps, not 5. Also the step of finding the next one is 1 step (Cmd+G) instead of 2 (Ctrl+F, Enter) – Steven Lu Aug 05 '13 at 20:25
  • @StevenLu: Instead of hitting Enter, you could go right to hitting F3 (which is also the key to continue the search). But, yeah, I know what you mean. I wouldn't mind a quicker way of doing this either. – Oliver Salzburg Aug 05 '13 at 21:11
  • Ah! right, F3 is usually the counterpart to Cmd+G. It's a good one and I usually forget about it. Well, I'll make do with this, at least c, f, and v are close together. – Steven Lu Aug 05 '13 at 23:42
  • @Oliver, are you “PastaPillows”? `:^Þ` – Synetech Aug 08 '13 at 00:06
  • @Synetech What or who is that? – Oliver Salzburg Aug 08 '13 at 08:15
  • @Oliver, [PastaPillows](http://steamcommunity.com/id/Pasta_Pillows/). Wait, I guess not; that’s Brandon Maxwell. Doh. – Synetech Aug 09 '13 at 01:08
  • @Synetech: Wow :D I actually took the image from http://gunshowcomic.com/731 – Oliver Salzburg Aug 09 '13 at 10:07
1

Ask and ye shall receive.

When I saw your question, I too figured it would be simple, even trivial, to throw something together to do this. Unfortunately it turned out to be much harder to do because of numerous obstacles and limitations (you can see a list of problems encountered and references in the script).

After much research, experimentation, and testing, I managed to create a Chrome userscript that can do what you want. One limitation is that it does not use the browser’s actual search/find control because the devs have not provided any programmatic access to it. However, the DOM does provide a way to search the page for specified text and jump around to them, so it does work more or less.

I enhanced it a bit so that it doesn’t trigger incorrectly:

  • Hold Ctrl or Command⌘ while selecting text (by dragging or double-clicking) to jump to the next occurrence of the selected text.
  • Hold ⇧Shift+Ctrl or ⇧Shift+Command⌘ while selecting text to jump to the previous occurrence of the selected text.

The Find Selected userscript.

Synetech
  • 68,243
  • 36
  • 223
  • 356
  • Fantastic!! Any chance you can provide functionality to search across tabs? That would be ordinarily for another question but this seems like a prime opportunity. (It would surely be a pretty heavyweight task but I have been known to keep 100+ tabs open and it would be much appreciated for users like me) – Steven Lu Aug 07 '13 at 19:48
  • Unfortunately that is indeed a big ask. There are a few extensions that let you search across tabs, but there’s no way to do a cross-tab search with the native search control, so they have to hack it by accessing the tabs, extracting the contents of the pages, performing a string-search on the contents, building a list of matches, then displaying them in a custom results page. This cannot be done with a userscript; it has to be a full Chrome extension. I don’t generally only do scripts, not extensions, so if you want to do a cross-tab search by selecting text, someone else would have to do it. – Synetech Aug 08 '13 at 00:11
  • You can try the existing extensions to see if their cross-tab search is sufficient: [Search Plus](https://chrome.google.com/webstore/detail/search-plus/cdpohbejnbclggljmoijjcpdhbaaijfm), [TabJuggler](https://chrome.google.com/webstore/detail/tabjuggler/jgiplclhploodgnkcljjgddajfbmafmp), [Search in Tabs](https://chrome.google.com/webstore/detail/search-in-tabs/mfgnkoalhhbahhljidhjpnbmimamnfko?hl=en). You may also find [Type-ahead-find](https://chrome.google.com/webstore/detail/type-ahead-find/cpecbmjeidppdiampimghndkikcmoadk) useful. – Synetech Aug 08 '13 at 00:14
  • Ah. I see. Thanks for explaining! Btw unfortunately I wasnt able to get your userscript working when I tried it. – Steven Lu Aug 08 '13 at 00:37
0

Just select the text, then click and drag it into the search bar. You can also right-click on selected text and choose "search for selected text on default search engine".

nhinkle
  • 37,198
  • 36
  • 140
  • 177
  • 1
    I need search in page. Not search Google. The drag might help but it's a bit awkward if the search field isn't already present. And if it is, it simply appends rather than replaces what's already in the search field. This all gets in the way of filtering and finding stuff on a page quickly. – Steven Lu Aug 05 '13 at 17:45
  • @StevenLu Ah. It wasn't clear from the question that you meant search on the page. Could you edit your question to clarify that? – nhinkle Aug 05 '13 at 17:50