DatL4g / KCEF

Kotlin implementation of jcefmaven with more modern setup and depending on JetBrains/jcef
https://datl4g.github.io/KCEF/
Apache License 2.0
28 stars 5 forks source link

Bug: Unable to add app handler? #13

Open JR-Mitchell opened 1 week ago

JR-Mitchell commented 1 week ago

It is possible to call KCEF.init with a builder that has an app handler supplied, like:

KCEF.init(
    builder = {
        addAppHandler(myAppHandler)
    }
)

However, none of the overridden methods of myAppHandler appear to be called.

This appears to be because of the line at line 93 of KCEF.kt:

currentBuilder.addAppHandler(AppHandler)

While the name of addAppHandler seems to suggest that multiple app handlers can be added, by looking at its implementation in CefAppHandler.java it seems that this is not true, and any subsequent call to it will remove any previously set app handler. So it looks like the issue may be that this call in KCEF.kt removes any app handler that is added in the builder.