WebBrowser2 - Receiving events from actions in browser

Is it possible to receive events from embedded browser? I’d like to do a login via a webview for the plugin,
so I would need to capture a succes/error response.

How can I do this?

A simple way to get the web view to “trigger” events in your c++ code is to have the JavaScript in your webpage open a new window/tab using the window.open(…) method. You can use “fake” urls with a custom protocol such as event://action/login/success. Juce won’t actually open a new window or tab but you can then catch these in the web browser components newWindowAttemptingToLoad() method. From there you can dispatch different functionality depending on the URL you receive. You can read more about the method below.

1 Like