Greasemonkey:文本处理 - 在网站中查找某些单词并使用其功能的最佳方法是什么?

时间:2021-02-23 21:46:05

I want greasemonkey to scan through a website and change certain words to something else. Is there a way to do it with regex or some other string processing function in javascript?

我希望greasemonkey扫描一个网站并将某些单词更改为其他内容。有没有办法在javascript中使用正则表达式或其他一些字符串处理函数?

Thanks for your help :)

谢谢你的帮助 :)

1 个解决方案

#1


In greasemonkey you use the DOM and then on the text nodes regular expressions might be used for finding your words. Check the Wikiproxy user script for an example that searches for words and changes stuff.

在greasemonkey中,您使用DOM,然后在文本节点上使用正则表达式来查找单词。检查Wikiproxy用户脚本以获取搜索单词和更改内容的示例。

#1


In greasemonkey you use the DOM and then on the text nodes regular expressions might be used for finding your words. Check the Wikiproxy user script for an example that searches for words and changes stuff.

在greasemonkey中,您使用DOM,然后在文本节点上使用正则表达式来查找单词。检查Wikiproxy用户脚本以获取搜索单词和更改内容的示例。