Highlight all "find" results in page



17 years ago
3 years ago


(Reporter: Paul McGarry, Unassigned)


Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(5 attachments)



17 years ago
I'd like to have the ability to highlight words entered in the search bar in the
webpage. I've knocked up some crufty code to do this and will attach it in a
minute. It's not complete, but I'd like to get the idea on the radar because
there are a few other bugs on the radar about redesigning the search sidepanel.
I'd like this addition (or a varient of it) to be included within any redesign.
These are bug 40704  bug 44816 and bug 44724 (which seem somewhat dupey)

In my implementation you basically type in some search words in the search
sidebar and click on highlight.

Comment 1

17 years ago
Created attachment 20435 [details]
File to go in chrome/comm/content/communicator/search/ to implement highlight

Comment 2

17 years ago
Created attachment 20436 [details]
slightly modified search-panel.js

Comment 3

17 years ago
Created attachment 20437 [details]
Slightly modified search-panel.xul


17 years ago
Ever confirmed: true

Comment 4

17 years ago
Following a helpful chat with glazou and others on #mozilla it is clear that
doing this properly is somewhat more complex than I initially thought.
For example when using the word 'foo':
should be highlighted where X is any inline element.
Even further for something like:
<B>F</B><I>oo bar</I>
I'd have to generate something like
<B><SPAN style="...">F</SPAN></B><I><SPAN style="...">oo</SPAN> bar</I>

It seems that what I have done so far is nothing but a cheap hack and there is a
serious amount of going back to the drawing board to be done, but after having a
couple of bad ideas, I think I'm onto a good one......
Netscape nav triage team: as per Matt Fisher's pre-triage recommendation, this 
bug is nsbeta1-.
Keywords: nsbeta1-
Just a random thought, but perhaps this was already dealt with to some extent in
the code that handles a selection in the content window, like for cut/copy? 

Comment 7

17 years ago
My thought was that this might relate in many ways to whatever Search->'Search
in page' does. I hope to find the time to see what that does over xmas.

Comment 8

17 years ago
Marking nsbeta1- bugs as future to get off the radar
Target Milestone: --- → Future

Comment 9

16 years ago
Oye, its been a year since any real indication of work on this bug.
I was going to file a new bug that was similar to this, but figured it would 
probably be marked a dupe of this.  
Its slightly different in its GUI approach though, allowing for multiple words 
to be highlighted (like google does for it's cached pages).  See 
for an example if you don't know what I'm talking about.

I'll attached a few mock screen shots to illustrate my proposal.  The guys over 
at googlebar.mozdev.org might be interested in this, or they might have already 
started working on a similar feature, so that should be looked into as well.

Comment 10

16 years ago
Created attachment 63138 [details]
Note the additional item in the Search menu.

Comment 11

16 years ago
Created attachment 63139 [details]
Highlight multiple words with multiple colors

Comment 12

16 years ago
As someone who works on the googlebar, I know that our find in page feature has
some really annoying bugs in it- it can only highlight one instance of one
search term at a time on the page, and the buttons only appear once the search
has been run (and don't start me on what it takes to make the buttons disappear-
it's not pretty). Was this just a mockup screenshot you'd prepared, or do you
have any code you might suggest? We'd be very interested if you do have a better
way. What would be involved in multiple keywords with mult colors?

Comment 13

16 years ago
As I indicated above, those were merely mock screenshots.  I don't know how to 
code really.  These were just mock screen shots (using google's cache feature) I 
made intending to spur on visualization and development of this feature.

Comment 14

16 years ago
Shame they were mockups and not code behind it... while I have some coding
ability that I'm working on extending, I don't have anything on the order of
what I'd need to implement this feature and the project person who does is
focusing attention on another project. Therefore I'll put out the question to
anyone who reads this- what would be involved it highlighting multiple terms
found in the page? Ie code, ideas of what types of styles to invoke- the url is
http://googlebar.mozdev.org/annotation.html if you'd like to make a suggestion.
We'd appreciate it.

Comment 15

16 years ago
I fixed Paul's code to work with non-trivial regexps and turned it into a pair 
of bookmarklets:


Theoretically it should be possible to use the browser's built-in find feature 
and use Range.surroundContents to mark off matches that span element 
boundaries.  Unfortunately, surroundContents doesn't work half the time and 
crashes the other half of the time (bug 58974).  Also, it would be nice if I 
could find ranges instead of having to convert selections created by find() 
into ranges (bug 123087).
Depends on: 58974, 123087

Comment 16

16 years ago
reassigning matt's old bugs to default owner.
Assignee: matt → sgehani

Comment 17

16 years ago
*** Bug 124311 has been marked as a duplicate of this bug. ***


16 years ago
Summary: [rfe] Enable highlighting of searched words in webpage → [rfe] Highlight "find" results in page


15 years ago
Summary: [rfe] Highlight "find" results in page → Highlight "find" results in page
QA Contact: claudius → sairuh

Comment 18

14 years ago
Is this bug now also dependant on bug 135928?


14 years ago
Summary: Highlight "find" results in page → Highlight all "find" results in page

Comment 19

14 years ago
See also bug 157788, same bug for Find As You Type.

Comment 20

14 years ago
Googlebar (http://googlebar.mozdev.org/) does the requested functionality just
fine.  Can that code be checked in?

Comment 21

11 years ago
This bug is (albeit remotely) related to my bug 324898 regarding bugzilla search results.

Isn't this what "highlight all" does in FF v1.5?
Assignee: samir_bugzilla → search
QA Contact: bugzilla


10 years ago
Duplicate of this bug: 401695
Product: Core → SeaMonkey
Bug 97023 fixed this one, marking duplicate.

Bug 157788 is about incremental search. This now opens a bar, too, but that one disappears automatically (I guess using the same timeout that disables FAYT after some time of inactivity) and doesn't provide the "Highlight all" option (or any other, actually). I'd probably go for WONTFIX, but it's not my decision.
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 97023


5 years ago
Blocks: 565552


5 years ago
No longer blocks: 565552
You need to log in before you can comment on or make changes to this bug.