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


#1

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 domElement.click() (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 domElement.click() 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:


#2

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


#3

For anyone else searching for a solution, I used https://github.com/Mr0grog/nightmare-real-mouse and it worked great.