Opening SWebBrowser widget steals focus

Hi,

I try to open a SBrowserWidget in the scene so that it covers only part of the scene. I would like the player to do normal actions, i.e. use controls, while the browser widget is open. However, when I open the browser, it seems to steal the input focus, and I havent found a method to make it “modeless”.

I open the browser like this:

void AStandardHUD::BeginPlay()
{
	SlateBrowserWidget = SNew(SWebBrowser)
		.ShowErrorMessage(false)
		.InitialURL(TEXT("https://www.google.com"))
		.OnUrlChanged(BIND_UOBJECT_DELEGATE(FOnTextChanged, HandleOnUrlChanged));

	GEngine->GameViewport->AddViewportWidgetContent(
		SNew(SWeakWidget).PossiblyNullContent(SlateBrowserWidget.ToSharedRef())	);

	FVector2D scale_size;
	scale_size.X = 0.25;
	scale_size.Y = 0.25;

	SlateBrowserWidget->SetContentScale(scale_size);

	// Set widget's properties as visible (sets child widget's properties recursively)
	SlateBrowserWidget->SetVisibility(EVisibility::Visible);
}

I have studied the widget class hierarchy, but there is no obvious way to yield the focus to actual gameplay.

How to solve?

I noticed that different visibility setting solves the problem, at least in my case.

SlateBrowserWidget->SetVisibility(EVisibility::HitTestInvisible);

Do you come up with issues regarding this solution, or have a better proposal?

Did you ever find an answer to this? I’m having the same issue. The browser widget takes up the whole screen, but it displays transparency showing the game behind it. I’d like the buttons/sliders/etc. displayed by the browser widget to be clickable, and clicking in the transparent areas would yield to gameplay focus, but I’m having trouble figuring out a proper solution.