Reputation: 1756
So I have this concept that I'd like to try out, but the first step is to see if I can somehow intercept or "sniff" for changes to the DOM that are implemented by ajax/jquery/javascript or whatever other means the browser is updating the HTML content after the page has been loaded.
I'm familiar with basic google chrome extension building and I know there is a part of the flow of data to the browser that would allow the extension to grab the updated html as it is updated in the DOM of the current page loaded.
I found a phenomenal resource that has got me pretty far here Getting the source HTML of the current page from chrome extension
But the only problem is I need to continuously click the browser_action icon in order to "reload" the updated content. Is it possible to load the new HTML content in the browser_action as it is updated in the page in real time?
What I have so far is exactly as the [ANSWER] it is listed in the above link
Upvotes: 0
Views: 940
Reputation: 463
If you know ahead of time which specific DOM node(s) are going to have their contents modified, you can set up a WebKitMutationObserver in your injected script and use that to trigger the messaging to the browser action popup.
Upvotes: 1