JS function hook

614 views Asked by At

Working in Greasemonkey script. HTML page contains JS script with some function. I want know event (when) this function executed (done/return).

This code looks like work (Proxy for setPointer function):

setPointer = new Proxy(setPointer, {
    apply: function(method, context, args) {
        alert("setPointer was invoked");
        method();
    }
});

But it's NOT works from Greasemonkey script. Only if I put it directly into HTML after setPointer function.

0

There are 0 answers