Hello,

my scripts broke by the current changes of FF/GM.
One problem is the dispatching of mouse clicks.
My old function:

function click(node){
var evt = document.createEvent("MouseEvents");
evt.initEvent("click", true, true);
node.dispatchEvent(evt);
}

Can anyone here help me how I have to create a click event now?
Thanks in advance!

Re: @BastianKanaan:
Hi there,
I'm trying to rebuild myfreefarm but I'm not too good with this. It does not work at all. Can you help me?
Can you tell me what to do?
Thanks in advance

Re: @marine64:

Slightly incorrect place for this I think... might try the script itself.

Re: @BastianKanaan:

Can anyone here help me how I have to create a click event now?

Did you try just calling a synthetic click event on the node element? e.g. someNode.click();

Re: @Marti:

Did you try just calling a synthetic click event on the node element? e.g. someNode.click();

It should work if a node has click() method. If it hasn't (<a> element for ex.), the call of dispatchEvent(click) does nothing.
The only thing I can advise in this situation -- to simulate the behavior of mouse click using lower-level functions (window.open,
XMLHttpRequest..)

This is my working function now:

function click(node){
    var evt=new MouseEvent('click',{'view':window,'bubbles':true,'cancelable':true});
    node.dispatchEvent(evt);
}

The problem of my script was another one (security change of FF 30/31).

Also note that 2nd argument of MouseEvent constructor is optional at least under FF33 (I just tested right now):

var evt = new MouseEvent('click');