Help using web browser widget

I’m using a local build of 5.2.1 and I’m trying to display some static HTML using the Epic’s Web Browser widget.

I have the widget embedded in an actor using the widget component.

I can successfully use LoadURL, but I can’t get LoadString to work.

Here’s my simple test: at begin play, wait 3 seconds and load url www.google.com, wait 3 more seconds and load string. When I run this it google appears after 3 seconds, but after a further 3 seconds there’s no changes to the browser content.

Questions:

  • does LoadString expect a fully formed HTML page? or just a snippet? (I’ve tried both)
  • what is the purpose of dummy url? If I pass in a value then the browser tries to redirect to that url.

Help - I know I must be doing something stupid…

Many thanks!

It has to be a fully formed HTML and dummy url creates a static file hosting route. It has to be like this

http://localhost:RANDOM_PORT
if you don’t have IIS or any other HTTP server on your server, you can use 80 8080 8081 like ports.

So, it shouldn’t be empty.

For snippets, you can use Execute JavaScript Function node. But for that, you have to create a JS function in your web app and you can only call it from Unreal Engine.

I made this plugin to use Chart.js in Unreal Engine. Look at Content/Widget/UI_Chart and Content/chart_bar_basic.html

Btw. I suggest you to use 5.3.1 as I remember Quest browser problem solved at 5.3 generally they update CEF version.

2 Likes

Many thanks! I really appreciate it.

One more question - I seem to need to still have a delay (0.2s) between Begin Play and the call to Load String.

Do you know why? (Not a big deal - I’m simply curious)

Starting router can takes time after begin play. But there are some http server plugins in marketplace. you can use fully featured static web sites which have separated files for css and css.

Also you can use them as microservice api servers. other applications can send get and post requests to you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.