Help with fake event
|
|
One of the functions of my script YousableTubeFix (http://userscripts.org/scripts/show/13333) is to automatically expand video description in a Youtube page. A "(more)" link button with an associated onclick event handler does that, so I usually did something like this:
$x1 is a function that executes a Xpath search and return the first item found Recently I changed the script to create a fake event and dispatch it. It has the additional advantage of don't breaking the sandbox:
It worked until recently, I think because Youtube changed something. I rolled back the change in my script and it is now working with the old code, but I'd like what is the problem with the event code Thanks in advance |
|
|
You're creating event of wrong type. Check this example.
PS: maybe |
|
|
This is a pretty good site: http://www.howtocreate.co.uk/tutorials/javascri...
|
|
|
Opera, AFAIK. I used to be there too. |
|
|
Thanks Descriptor and LouCypher for the documentation, I'll check it Mikado:
I can assure it worked before. I had also checked the documentation in Mozilla Developer site, but I haven't checked the official documentation since I was following the Greasemonkey wiki example (http://wiki.greasespot.net/Location_hack#Really...) and it uses HTMLEvents The location hack is good, but I'd rather use initMouseEvent since it respects possible event Listeners added with addEventListener, and it bubbles up like a real event |
