As noted in the onLoadRequest
docs, you can override onLoadRequest with something like this (kotlin):
private fun createNavigationDelegate() = object : GeckoSession.NavigationDelegate {
override fun onLoadRequest(session: GeckoSession, request: GeckoSession.NavigationDelegate.LoadRequest): GeckoResult<AllowOrDeny> {
if (request.target === NavigationDelegate.TARGET_WINDOW_NEW) {
session.loadUri(request.uri)
}
return GeckoResult.fromValue(AllowOrDeny.ALLOW)
}
}
From the docs linked above:
For example, this can be used to override the behavior of TAGET_WINDOW_NEW requests, which defaults to requesting a new GeckoSession via onNewSession.