/Find Bar/
/Find Bar/ is a new extension for Firefox that is still a little bit in progress. I’ve always believed that one of the best features of Firefox is it’s quick find bar. I probably use it about 20 times a day, if not more. But it has to be said its a fairly simple beast. When it comes to more powerful searches you’re just out of luck. This extension adds a whole new dimension to the find bar, regular expressions. The regular expressions are implemented using the JavaScript engine so check the JavaScript RegExp syntax for the full details.
Turns out to be a reasonably popular request in the Firefox support channels where I hide out and I’d generally discounted it as an extremely difficult task. But then I like a challenge and when I suddenly stumbled across an idea that might make it fairly simple this actually all came together quite easily, though as I’ve said it’s not actually complete yet, for that I need your help.
Questions
There are a few questions that I haven’t yet figured out about how the find bar should actually operate. My plan is that anyone who wants to can test out the alpha version, see where it does what they expect and where it doesn’t do what they expect and let me know so I can answer a few of these things:
- Whitespace. HTML is made up a lot of this, most of it is ignored by the browser and not visible on the page. At the moment this extension doesn’t ignore anything so you may find there are more spaces between words than you expected. Should I err on the side of accuracy as it is now, or collapse all whitespace?
- Block content. The standard find bar wont find searches that span blocks (paragraphs in human terms). This extension does, which while potentially useful also causes some issues. One thought is to make each paragraph like a line then you can use line breaks to match paragraphs as you might expect.
(Installs from addons.mozilla.org)
Comments
April 21, 2008
Anon
How do you search for a whole word? I tried using the regular expressions but it didn’t work for me. Also even not not using regular expressions, when I try to find a word, it only displays the first occurance of the word, and not the remaining ones when I press Next.
April 17, 2008
Redhat71
i think i triggered something, by accident
1) press / (or ctrl+f) to bring the find bar, search anything, then close it with esc
2) go to another tab, press / (or ctrl+f) to bring the find bar:
click “highlight all”
cpu goes 99% and i can only kill it
in step 1, you have to search something, “highlight all” is grayed out till you do
in step 2, do NOT search anything, just click “highlight all” directly (which was an accident)
it’s reproducible and does not happen while /Find Bar/ is disabled
it’s a trivial problem but accident happens
March 26, 2008
Daniel MellergÄrdh
Hi!
Thanks for this useful extension which I use at home on Windows XP.
However, when trying to install this at work the following is shown instead of the install button. At work I am running Solaris 9. There are other extensions that work for this system, so it might be that you need to compile for Solaris? Could it be done?
https://addons.mozilla.org/en-US/firefox/addon/6534
/Find Bar/ is not available for Unknown.
Best Regards,
Daniel
August 13, 2007
Simon Gingras
Very nice addon, it would be nice if you could add the option in the view source option. When I watch sources, I like to be able for use regular expression to find stuff rapidly.
July 21, 2007
Ali
Very nice! It’s really necessary and should be Firefox built in.
July 2, 2007
fwyzard
I love this extension, I’ve been looking for something like it for… well 5 minutes, then I Google’d for it
Regarding whitespace, I’d make a single ‘ ‘ match all consecutive whitespaces except r and n (not sure how those are used on web pages) by default, that is [ ftvu00A0u2028u2029]+
If you ever add Options to /Find bar/, I’d let the user pick among
‘ ‘ single spaces matches
* a single space / /
* all consecutive whitespace but newlines /[ ftvu00A0u2028u2029]+/
* all consecutive whitespace /s+/
After some test with newlines, I’ve found that
<p>this is a test</p>
<p>this is a test</p>
renders to ‘this is a testn this is a test’, that is with an extra ‘ ‘ after the newline - but I have no quick idea about this
Keep up the good work!
June 15, 2007
Pete
I’m having the same results as Boy on OSX 10.4.9. Might this be a windows-only extension? That would be disappointing.
May 11, 2007
tiuk
This is fantastic, I’ve been wanting RE support in the find bar for longer than I can remember.
Thanks!
May 9, 2007
rs
Works brilliantly. Actually, far better than I expected.
Kudos!
I think you should point out that one has to choose the "Regular Expression" checkbox to enable it ![]()
April 8, 2007
Richard Turner
Love this addon. Came accross it the other day have been using it since.
Actually used your extension to start ‘playing’ around with my very first addon for Firefox, have extracted the code into it’s own addon now, but it was your xul and js that started me off, and helped me learn stuff.
Rest of what i learnt came from MDC site, but i’m the sort of person who learns from doing / seeing, that’s where your simple addon came in
Double thanks from me ![]()
April 7, 2007
Matt
This is a great add-on — very useful. Why don’t you post it on Mozilla’s list of Firefox add-ons?
March 19, 2007
Xin
Excellent idea.
But it crashed my browser. 2.0.0.2 on Windows XP Home.
It froze the browser after typing in ‘^s’, only displayed ^.
March 16, 2007
Boy
Hmmm… doesn’t work for me on Firefox 2.0.0.2 in Ubuntu Edgy Eft.
It installs fine, but doesn’t do anything.
Too bad. Sounds like exactly the kind of thing I’ve been searching for.
February 26, 2007
MIke
Working well for me and very useful; boggles the mind why this is not a standard feature.
Block content: I would submit that HTML block elements be treated as "lines." The current implementation appears to be based on the layout of the source code. In other words, if paragraphs, list items, etc. end, then begin on a new line, the search does not span the block. However, if paragraphs, lists, etc are all on a single line (as on your /Find Bar/ Web page) then the search spans the block elements.
January 19, 2007
Ben
It works, thanks for creating it!
2.0b1 - 3.0pre
2.0 - 3.0a2pre

April 24, 2008
BlindWanderer
I found a fun bug that causes DOM corruption.
Repro:
0) Have Find Toolbar Tweaks installed (this may not be necessary) http://homepage3.nifty.com/georgei/extension/ftt_en.html
1) Goto https://wiki.secondlife.com/w/index.php?title=Special:Wantedcategories&limit=500&offset=0
2) Open the find bar and check “Regular Expression” checkbox
3) Search for “^LSL[^/]*$” but without the quotes
4) Click the Highlight all button
5) Observe that the list numbers all increase.
Theory:
I believe this happens because the Highlight All captures the “li” element and tries to wrap the element in a span tag. At which point Firefox tries to fix the error by automatically nesting the span tag in a new “li” element.