DOM Changed Event Firefox Extension

◇◆丶佛笑我妖孽 提交于 2021-01-27 17:29:43

问题


So I have created a Firefox extension and it works great, however when I submitted it (although it was accepted) it came up with one security warning. It said setTimeout() was removed in an else clause.

So, is there a way to listen for any DOM change? (or even a specific element changing, I have an ID for both). However, divs do not have an onChange event so any ideas?

I don't mind if it's ANY change, doesn't have to be div-specific.


回答1:


DOMSubtreeModified event sound like something you want to use. Keep in mind, that it is deprecated and after some time its support will probably be removed from browsers.

http://help.dottoro.com/ljrmcldi.php




回答2:


It turns out adding an "onChange" event to a div works fine, although it might not be W3C valid it doesn't really matter as it's only a Firefox extension (plus it works!).



来源:https://stackoverflow.com/questions/7560131/dom-changed-event-firefox-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!