Hi everyone,

I want to invoke a click in a proxy (XUL browser). I know how to
dispatch a click element and as long I dispatch clicks inside a XUL
window everything works fine but as soon I want to invoke a click on a
-tag inside a browser-element nothing happens (no error is thrown).

The architecure of the XUL-document looks like this:






My source:

for( var i=0; i links[i].onclick = function(event) {

// returns unique XPath-Expression to clicked node
var nodePath = getXPathForElement
(event.target,mainBrowserDocument);
document.getElementById('text').value = nodePath;

// lookup the element in the proxy browser
var nsResolver = proxyBrowserDocument.createNSResolver
(proxyBrowserDocument.documentElement);
var theNode = proxyBrowserDocument.evaluate(nodePath,
proxyBrowserDocument, nsResolver,
XPathResult.ORDERED_NODE_ITERATOR_TYPE, null );
var thisNode = theNode.iterateNext();
thisNode.style.backgroundColor = 'red';

simulateClick(thisNode);

return false;
};
}

Simulate click:

simulateClick : function (e) {
var clickEvent = e.ownerDocument.createEvent('MouseEvents');
clickEvent.initMouseEvent('click', true, true,
e.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false,
false, 0, null);

//works not
e.dispatchEvent(clickEvent);
//this works
//document.getElementById('secondLink').dispatchEven t
(clickEvent);
}

I tried various windows/documents to create the clickEvent but it
seems more likely that the dispatchEvent doesn't fire (even it returns
true...).

Is there a security messure or something that prohibits dispatching
events to a browser? Or is the node referer wrong?

Thanks in advance.

Sebastian