Greasy Fork is available in English.

Text Highlight and Seek

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

< Σχολιασμός για τον κώδικα Text Highlight and Seek

Αναφορά: Καλός - ο κώδικας λειτουργεί

§
Δημοσιεύτηκε: 10/10/2018

Conditional highlight

Hello, how can I change this script for it to only activate a set if it find the first word in that set. Or to activate the set if it find a specific word on the site?

Jefferson ScherΔημιουργός
§
Δημοσιεύτηκε: 11/10/2018

Hi Daniel, currently, the entire set is checked in one step using Regular Expressions for each piece of text. So the script doesn't keep track of what was found, it just marks as it goes.

I don't know RegEx well enough to say whether there is an easy way to pre-check for a particular word across the entire document before doing any highlighting. The cumbersome way would be to use an additional loop similar to lines 396-399 to pre-check whether the word is in the document before proceeding with the actual highlighting.

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.