I am trying to manipulate a real time web application that only runs with Google Chrome, the objective is to integrate this web app with my C# desktop app to seamlessly communicate with each other, yet a user will interact with both independently. What are the best practices I should consider when trying to do this in production?
Environment assumptions and restrictions:
- I do not have any access / privileges over the web app (is a commercial site hosted by another company)
- There is not API / REST interface for the web app.
- This web app does not run in any other browser other than Chrome
- Browser must be independent; the user must be able to work with the web app even if the desktop C# app is not running.
Below is a small list of the methods I am aware of for manipulating Chrome, please help me determine which is better suited for production, if any:
- Selenium WebDriver
- I believe this is the most standardized approach.
- It seems link! that WebDriver is not able to take control over an already existing web browser instance. As explained, this is not a web automatization project. The user must be able to open the web app even if the desktop app is closed. (work around suggestions?)
- Chrome remote debugging
- This is the one I like the most, it easy and convenient, I would simply need to launch every browser with the parameter --remote-debugging-port. With this, my C# app can have access to anything within Chrome, it can even evaluate JS code to impersonate user’s activity.
- A lots of security concerns, simply, by calling it remote debugging in production makes me nervous, this approach does not even require basic authentication and even though it is restricted to localhost, things like port tunneling can be use as proxy by an attacker.
- Chrome extension