0

Is it possible for a desktop application to communicate with a javascript API that will affect the user's browser? For example, I would like to call a JS API of a web service even if the browser is not in focus. The user can select various functions from within the desktop application and it will take effect in the browser. thanks

4
  • could you give server and JS code examples? Sep 28, 2010 at 23:30
  • Sorry, this is a new project I'm just messing around with. I was wondering if there were any hints on how to set something like this up. Not necessarily asking for code, but a point in the right direction. I guess a starting point would be how to get the browser to do a refresh via the desktop app?
    – XSL
    Sep 28, 2010 at 23:32
  • If you are just trying to invoke a JS API of a web service, why involve the browser at all? Just invoke the web service directly from your desktop app, no?
    – Kirk Woll
    Sep 29, 2010 at 0:02
  • The effects of calling the JS API should affect the browser page. The desktop app simply calls the API, but the result is displayed in the site.
    – XSL
    Sep 29, 2010 at 0:12

2 Answers 2

1

You probably want to consider automating the browser from your application. As you are using .NET, WatiN is a good option to do that:

WatiN

1
  • Thanks, I think this should be perfect to get me started.
    – XSL
    Sep 29, 2010 at 0:11
0

To get something like that to work you would need to have your web app call for updates on a regular interval and then make the appropriate changes.

Your desktop app can make requests to whatever web interface you wish to access data. It really depends on how you build it out.

Is this an existing app? Are you building something new? More info would be nice to have to get more specific.

1
  • It's really just a pet project, but it's completely from scratch, so recommendations much appreciated. Essentially, the browser loads a web site. The website can perform various functions such as "Display Time", via javascript. Within the browser, I could send direct calls to a JS API which will display the time. Can I do this from outside the browser, possibly passing in the browser's window handle to the desktop application to provide some sort of reference. I click 'Display Time' in the desktop app and the web site will call the method and display the time.
    – XSL
    Sep 28, 2010 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.