Greasy Fork is available in English.

Text Highlight and Seek

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

< Rückmeldungen aufText Highlight and Seek

Frage/Kommentar

§
Veröffentlicht: 31.08.2020

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!

Jefferson ScherVerfasser
§
Veröffentlicht: 31.08.2020

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.

§
Veröffentlicht: 03.12.2020

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

Jefferson ScherVerfasser
§
Veröffentlicht: 04.12.2020

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

§
Veröffentlicht: 04.12.2020

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...

Jefferson ScherVerfasser
§
Veröffentlicht: 05.12.2020

> 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.

§
Veröffentlicht: 06.12.2020

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?

Jefferson ScherVerfasser
§
Veröffentlicht: 06.12.2020

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.

§
Veröffentlicht: 06.12.2020

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!

§
Veröffentlicht: 07.12.2020

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

Antwort schreiben

Anmelden um eine Antwort zu senden.