Text Highlight and Seek

Automatically highlight user-defined text with Seek function (2019-09-22)

< Feedback on Text Highlight and Seek

Question/comment

§
Posted: 2020-08-31

Hey there!

LOVE this script - it helps a ton with what I was looking to do and really helps my workflow.

I was hoping to refine it further - is it possible to have the highlighted text only match bolded words or ignore stuff like headers?

Thanks!

§
Posted: 2020-08-31

Hi there, if you look at the lines with

var snapElements = document.evaluate(

you can see how the script excludes various parent/ancestor tags. Currently it's not designed to accommodate more options; it needs a rewrite.

§
Posted: 2020-12-03

Love this script - any way to make it look for text in dropdown boxes? Would love this to help me look for errors there.

§
Posted: 2020-12-04

any way to make it look for text in dropdown boxes?

Hmm, what kind of dropdown boxes?

The script already searches in the <option>'s of <select> controls, but unless the particular option is visible, the highlighting doesn't work.

To make all the options visible, you could temporarily expand all your select controls before highlighting by assigning a size attribute. To fully expand the listbox, if there are 5 items on the drop-down, for example, apply size="5" to your <select>.

You could do that on a one-time basis using the Web Console:

var sels = document.querySelectorAll('select');
for (var i=0; i<sels.length; i++){
    if (sels[i].options.length > 1){
        sels[i].setAttribute('size', sels[i].options.length);
    }
}

Then disable/enable your set to re-apply highlighting

§
Posted: 2020-12-04

I would like to Highlight if HB1, or HB2 (for example) were selected in the dropdown. I'm only looking to highlight selected values but right now it is not working...

§
Posted: 2020-12-05

> I would like to Highlight if HB1, or HB2 (for example) were selected in the dropdown.

Okay, yes, that is what I suspected. When I look at what has happened to the HTML of the page, the tags that indicate the set number (used to style the highlight) are getting injected into the options but they don't work on the drop-down. The only workaround I can see is to change the style of the select from a hidden list to a displayed list before applying the highlighting.

§
Posted: 2020-12-06

Thank you for the reply but sadly that went way over my head. I sort of know what is going on, but have no way of making it happen. Is this something that with a small snippet of code the program could be modified on my end?

§
Posted: 2020-12-06

What do you think about a bookmarklet? That is a bookmark which runs the script I posted earlier. You can put it either on your Bookmarks Menu or Bookmarks Toolbar.

https://www.jeffersonscher.com/res/sumomarklets.html#expandlist

When you click the "bookmark" it should expand all the select controls in the current page into list boxes.

§
Posted: 2020-12-06

Thanks for replying but I can't make heads or tails with that either. I don't want to keep bothering you if there is no easy fix or adjustment, but thanks for the time you put into this.

Cheers!

§
Posted: 2020-12-07

OK now I get it, thanks - never used those before!. Sadly that just makes the page a giant mess, there are over 30 drop=downs on the page :P

Post reply

Sign in to post a reply.