Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you find out when new data is loaded via ajax in a firefox addon?

I am creating an addon for firefox with the new addon builder. I would like to have an event fired when data is loaded with an XMLHttp request so I can run a script to add in some extra features. Similar to a page load except the site uses ajax. This is my first addon and I'm not sure how to go about doing this. I looked around and there was this method

XMLHttpRequest.prototype.getResponseHeader=function(){
    runCheck();
};

But when I added it in the console tells me that there is no XMLHttpRequest.prototype. I had tested it by loading it in firebug and it worked, but when I try to use in the content script it doesn't?

like image 298
qw3n Avatar asked Jan 30 '26 13:01

qw3n


1 Answers

There's a little known event called DOMSubtreeModified, which fires when the DOM Subtree is Modified (big surprise there). I read some place that it is supposed to be deprecated, but I can't remember where. Check the DOM event reference.

like image 108
Paul J Avatar answered Feb 01 '26 03:02

Paul J