How to programmatically perform a native click in a BrowserWindow instance?


Any idea how I can perform a trusted event on a dom element from the main process to a BrowserWindow instance?

I am working on a crawler that goes and click on button for the user in order to gather some data from different websites.

I have implemented an architecture similar to Nightmare but the problem I have is that the (in javascript) method does not work on some website, especially the control panel of Google Apps when I try to click on the following button:

I think the click is not behaving correctly because the event generated by the javascript function does not have all the same properties. The x/y mouse position, the “isTrusted” property etc are not the same than when a click is actually performed by the user.

any idea is more than welcome :slight_smile:


Did you ever figure anything out on this? I’m having the same problem.


For anyone else searching for a solution, I used and it worked great.