Firing UI Events from Content Scripts

16 views
Skip to first unread message

Hitesh Sharma

unread,
Jun 21, 2015, 5:45:39 PM6/21/15
to mozilla-la...@googlegroups.com
Hey,

I want to simulate a mouse click, something similar to this - https://developer.mozilla.org/samples/domref/dispatchEvent.html 
However, when I try the same code in a Content Script injected by my extension, it says "the fourth argument does not implement a Window interface".
Is there a way to make UI events work ?(Also, I couldn't get KeyboardEvent to work either).

Any help will be appreciated :)

Thanks,
Hitesh

Hitesh Sharma

unread,
Jun 21, 2015, 6:30:27 PM6/21/15
to mozilla-la...@googlegroups.com
[Update]
MouseEvents work !

But I'm still not able to get KeyboardEvents to work. 
I want to automate filling some "content-editable" fields and also simulate "enter" key press so that a form could possibly get submitted. Is it possible to do so via a content script ?

Reply all
Reply to author
Forward
0 new messages