Closed Bug 62467 Opened 23 years ago Closed 14 years ago
Highlight all "find" results in page
1.75 KB, text/plain
29.57 KB, text/plain
8.31 KB, text/plain
18.75 KB, image/jpeg
80.89 KB, image/jpeg
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.
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': <X>F</X>oo 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-.
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?
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.
Marking nsbeta1- bugs as future to get off the radar
Target Milestone: --- → Future
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 http://www.google.com/search?q=cache:RdND2rcfmnM:www.mozilla.org/+mozilla&hl=en 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.
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?
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.
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.
I fixed Paul's code to work with non-trivial regexps and turned it into a pair of bookmarklets: http://www.squarefree.com/bookmarklets/pagedata.html#highlight http://www.squarefree.com/bookmarklets/pagedata.html#highlight_regexp 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).
reassigning matt's old bugs to default owner.
Assignee: matt → sgehani
*** Bug 124311 has been marked as a duplicate of this bug. ***
Summary: [rfe] Enable highlighting of searched words in webpage → [rfe] Highlight "find" results in page
Summary: [rfe] Highlight "find" results in page → Highlight "find" results in page
Is this bug now also dependant on bug 135928?
Summary: Highlight "find" results in page → Highlight all "find" results in page
See also bug 157788, same bug for Find As You Type.
Googlebar (http://googlebar.mozdev.org/) does the requested functionality just fine. Can that code be checked in?
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
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.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.