改变显示的网页
我正在尝试编写一个 Firefox 插件,它将分析显示的页面并将文本显示更改为超链接(根据某种算法)。
我试图弄清楚如何解析 html 文档树以检索文本以使其成为链接。 所以我不仅需要文本,还需要它在文档中的位置。 就像如果我有某种解析器,它只会给我文本节点或其他东西,然后我可以替换它的内容。
有这样的事吗?
I am attempting to write a firefox addon that will analyze the displayed page and change the text display to be hyper links (according to some algorithm).
I am trying to fogure out how can i parse the html document tree to retrieve the text in order to make it a link.
So i need not only the text but its position in the document.
Like if i had some kind of parser that will give me only text nodes or something, and then i can replace its content.
Is there such a thing at all?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将 javascript 插入到每个页面中,这样您就拥有了 javascript 可以做的一切。开始学习 Firefox 插件开发的一个好地方是 MDN https://developer.mozilla.org/en/ Building_an_Extension
You can insert javascript into every page so you have everything that javascript can do. A good place to start learning about Firefox addon development is the MDN https://developer.mozilla.org/en/Building_an_Extension