I'm not sure that the trick we use in our GM script is relevant to
your question, but I prefer to ask, just in case our script might not
work well with GM 1.0.
The site we plug into relies heavily on AJAX and some kind of JSOND.
So we have some framework to deal with that and keep an abstraction
layer over this problem, in order to ease the different insertions we
handle.
The main technique we use is to "hook" on a callback function of the
site's javascript.
For example let say that the page DOM nodes are populated by a
js.SiteFillPage(data) function, from the site scripts.
Our script saves this function with
OriginalFunction=window.wrappedJSObject.js.SiteFillPage.
Then we replace this function by our own:
window.wrappedJSObject.js.SiteFillPage = function(data) {
... // checking things...
window.unsafeCall(function() { OurFunctions.ProcessPage(); });
return OriginalFunction(data);
}
The OurFunctions.ProcessPage is our main function in our script, and
it uses GM_ specific functions.
As you see, to be able to use GM functions from such a call, we use
this unsafeCall function:
window.unsafeCall = function(fn) {
if(typeof fn == 'function') window.setTimeout(fn, 0); else
GM_log("Error: window.unsafeCall argument must be a Function!");
};
I would like to know what impact the 1.0 version would have on our
technique, or what we could use for a stronger security.
Thanks a lot for Greasemonkey :)
--
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.