I still fail to see the problem. If all of it amounts to avoiding unsafeWindow, in this particular case you can use [1], in particular the "location hack", since you don't need to 'read' values from the page scope.
I used to play with a script called 'Post Interceptor', which I lost track of. There is an spin-off script [2] though, which you can use as inspiration/verification. [1] http://wiki.greasespot.net/Category:Coding_Tips:Interacting_With_The_Page [2] http://userscripts.org/scripts/review/45264 On Sat, Feb 27, 2010 at 3:57 AM, rveach <[email protected]> wrote: > On Feb 25, 4:21 pm, esquifit <[email protected]> wrote: >> http://diveintogreasemonkey.org/patterns/override-method.html > > That's actually the original page I was using to do all this from the > beginning. The problem is GM doesn't have access to > "HTMLFormElement.prototype" as I get an error saying its undefined, > which lead me to use 'unsafeWindow', but as > Anthony said, I should avoid using it. Also the 'submit' parameter in > window.addEventListener NEVER fires. I'm not sure firefox recognizes > 'submit', as 'click' works fine. > > On Feb 25, 3:52 pm, RodMcguire <[email protected]> wrote: >> document.createEvent code > > I think you misunderstood what I want to do. > Correct me if I'm wrong, but CreateEvent forces all events of a type > you specify to fire on an element. > I'm not trying to fire off an event on an element, but I want to > CAPTURE the event, in this case, the form submission and record which > form is being submitted for future reference. > I can capture clicks on the forms, but if the user is using a > secondary GM script that fires the form using JS > ("document.forms.namedItem('search1').wrappedJSObject.submit();"), > then I miss out on the form submission. > > > I have still yet found a way to achieve this and am still looking. -- 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.
