Text Highlight and Seek

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

< 腳本Text Highlight and Seek的回應

評論:正評 - 腳本一切正常

§
發表於:2020-04-16

Small issue with youtube live chat

I love this script to help with moderating youtube chat, but there's a slight issue where it'll assign the wrong username to people's messages. I think it happens if a matching word is found in a username, then that username gets used a lot more incorrectly. Is there any workaround to this do you think? Love the script otherwise!

§
發表於:2020-04-16

I'm not sure what you mean about assigning a user name??

I didn't test the script on a dynamic page that would keep changing, so I'm not sure what happens in that scenario.

The highlighting is applied by inserting new HTML tags around the matching text, and then style rules color that tagged text. If a script in your tool copies the modified text to another place without cleaning out those tags, that might cause weird consequences.

If there are parts of your page that you want to exclude from highlighting there may be a workaround by adding another "and not" statement to the script. You can see where those are starting around line 377. However, I'm not very experienced with XPath syntax and have zero knowledge of your web app, so I'm not in a good position to give you specific language for the edit.

If you use the Inspector (right-click > Inspect Element) to look at the area that is getting mucked up, does it have any kind of unique identifier that might help in creating an exclusion?

§
發表於:2020-04-16

Thank you for the quick reply and pointing me in the right direction. Thankfully they use a span tag around the author name so it was easy enough to add an ignore like you said. 'and not(ancestor::span[@id="author-name"]) ' + is working well so far!

發表回覆

登入以回復

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址