I have a basic question. Can Greasemonkey do more than just a one-shot
post-processing of a page after it renders?

In my user case, a Greasemonkey script modifies the rendered page by
inserting an img element to the page. This image has an onmousemove
attribute. When the mouse moves over the image, instead of calling a
javascript function from the page, I would like to run a function from
the same Greasemonkey script that has created the image node. In other
words, I would like to do something like this:

< img src="http://..../image.jpg";
onmousemove="call_greasemonkey_function_here(not_javascript_from_page);" /
>

How can this be done?

I tried to add the greasemonkey function to the page using
createElement('script') but that does not work in my case, because my
greasemonkey function contains some specifics like
GM_xmlhttpRequest(). I need to do cross-domain ajax, which is not
possible in javascript in the page.

Probably I am stuck because of the GM sandbox being separated form the
page DOM? What are my alternatives then?

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