Folks, I've worked on a number of GM scripts lately that run against twitter.com and facebook.com. Both sites initially load a "shell" of the page, then fill in the content "late" via XMLHttpRequests (I believe). I'm handling this at the moment through the risky strategy of triggering my script action later via window.setTimeout().
That's such a vile hack. It's fragile: if anything causes the page to take longer to load than the timeout, the script triggers on an incomplete page. It also doesn't handle content that is loaded after the timeout, which occurs on both sites, which load a clump of older content when the user scrolls to or near the bottom of the page. I think I need to hook into some sort of event to catch those late content loads and process the newly-loaded content. I will figure out how to set a "high-water mark" so that I only modify the most recently-loaded content. That's not the problem I need your help to solve, but how to detect those late-load events and trigger my script when they occur. For simplicity, let's concentrate on Facebook, where I'm working on a userscript that will eventually be part of a larger social media feature pack. Has anyone successfully hooked into that update event to process the dynamic DOM of a Facebook page? Dave -- You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
