Hi all,

is there an event that I can attach to a page so that I am notified when an image is changed? (E.g. when a dummy is replaced by the real picture.)

Today, a page I already modified by my gm-script changed its design in a way that my script is not longer able to catch the images. Because in the newsfeed they placed just dummy images. The real image is inserted as soon as it is in the visible part of the feed. So I need a way to recognize the change of an image.


Until today it worked fine for me to catch pictures in a news feed by

    document.body.addEventListener( 'DOMNodeInserted',
        function( event ) {
            ImageContainer(event.target);
        },
        false
    );

    function ImageContainer( container ) {
        var xpathResult = document.evaluate(
'.//img[contains(@src,'/img/users')]', container, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null
        );

        var i=0;
        function continuationImages() {
            var node, counter=0;
            while( node = xpathResult.snapshotItem(i++) ) {
                HoverImage( node );
if( ++counter>50 ) { return setTimeout( continuationImages, 0 ); }
            }
        }
        setTimeout( continuationImages, 0 );
    }

   (This functions are originally by Anthony. I just adapted them for
   my purposes.)


Now I need a new way to get them...


Tnx in advance,
Robert

--
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.

Reply via email to