There is a onmousedown event on a webpage. I want to be able to have this event called from my app and have the WebBrowser object move to that page. How can I achieve this?
Long story short, you can't do this. This is because the javascript is a client side technology and to accomplish what javascript does on your client you're going to have to pretend to be a client: you'll need to rebuild the entire document object model and execute the javascript that way.
You can reference this ticket where I tried solving a similar issue (calling javascript from within a PHP script): http://stackoverflow.com/questions/3221466/can-a-php-proxy-script-call-javascript-functions-like-click
Maybe if you explain the problem domain a little more, you'll discover that you don't even need the javascript all-together! What are you trying to accomplish and why is the javascript required? Good luck!
The WebBrowser.Document
property gives you an HtmlDocument
object, which has an InvokeScript
method. I have used this before to execute JavaScript from a WebBrowser
control. Frankly, it's an atrociously messy way to get something done, but it has worked for me. Could that be of use to you, maybe?
gnucom's right.
Perhaps not the solution you are looking for: http://watir.com/examples/
It's Ruby based and but you could have your app interact with that perhaps...