Click here to Skip to main content
15,743,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

Have inherited some code that is trying to find a Javascript API that is already in a browser, from a Winforms application all running on a local user's Windows PC. The browser could be either Chrome or IE (we only say we supprt these 2). We don't necessarily have control of the web page that contains the API.

When the EXE runs, we try to obtain the API from the Browser, if it's IE, we are iterating through the SHDocVw objects that are running on the PC. We then try and Invoke the API, believe it or not, and if successful, we're OK.

In Chrome, we obviously don't have the SHDocVw object to enquire upon. What has been done before in this code, is to iterate through the IAccessible objects in the hope that it is available. I would say that this is successful 10% of the time. I won't go into detail unless I need to here, but basically, even using Inspect.exe doesn't always give us the area holding the API.

So the question is, does anyone know of a reliable way of accessing a JS API inside a running Chrome instance, from an EXE running on the same computer.

A bit of a strange question I know.

Any thoughts on the matter would be greatly appreciated, I find that thoughts and discussions can sometimes lead to a solution.


What I have tried:

Multiple Google searches.
Issuing a refresh to the Chrome page, that sometimes gives us access to the API (unreliable).
Asking if we can not support Chrome!
Scratching my head.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900