BR: WebView Freezes DAW

This bug took us a while to reproduce!

If you call either evaluateJavascript or emitEventIfBrowserIsVisible before the very first page was loaded on the WebView, this would freeze the UI when loading a project in a DAW with multiple instances loaded.

To reproduce:

  1. Windows only (does not happen on Mac).
  2. Build attached plugin
  3. Load an FL Studio or Cubase project that has multiple instances loaded with their window open (attaching projects for both).
  4. The UI of any instance after the first along with the DAW would freeze.

The offending code is just:

struct WebEditor : WebBrowserComponent
{
    WebEditor()
        : WebBrowserComponent(getOptions())
    {
        evaluateJavascript("console.log('hello');");
        emitEventIfBrowserIsVisible("hey", "hello");
        goToURL(getResourceProviderRoot());
    }
};

If I move those evaluate and emit calls to be after pageFinishedLoading, that resolves the freeze.

FreezingProjects.zip (62.0 KB)

1 Like

Thank you for reporting this, and for doing it in such a wonderfully detailed and easy to reproduce way. A fix is now out on develop

1 Like