I’m working on a Greasemonkey script to insert a random signature into Google Groups postings. It half works…inserting the signature for new threads works great. But, with replies, the reply box pops up inline with the thread. This is where my problem comes in. The element I need to insert the text in is called cmp_body, but that element does not exist until the user clicks on the Reply button. So basically, I need the script to wait until that particular element exists, then insert the extra text into it. Here’s a link to what I’ve got so far:
[URL=”http://userscripts.org/scripts/show/8226″]http://userscripts.org/scripts/show/8226
The original idea was to use an onclick event handler, and that worked nicely, only problem being every time there was an additional click anywhere in the page, the signature would get inserted again. The do while loop I’ve got in there now isn’t doing anything. Anyone got an idea?