# How to a call c++ method from javascript running in WebBrowser widget?

**URL:** <https://forums.unrealengine.com/t/how-to-a-call-c-method-from-javascript-running-in-webbrowser-widget/438123>\
**Category:** UI\
**Tags:** webbrowser, javascript, unreal-engine, Widget, question\
**Created:** [November 22, 2018, 1:49pm UTC](https://forums.unrealengine.com/t/how-to-a-call-c-method-from-javascript-running-in-webbrowser-widget/438123 "2018-11-22T13:49:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_561baee7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_561baee7](https://forums.unrealengine.com/u/anonymous_user_561baee7)\
**Post date:** [November 22, 2018, 1:49pm UTC](https://forums.unrealengine.com/t/how-to-a-call-c-method-from-javascript-running-in-webbrowser-widget/438123/1 "2018-11-22T13:49:44Z")

</div>

My game opens a WebBrowser widget with given URL. There is a javascript that I want to somehow call back to my c++ method in the game.

I assume that WebBrowser widget may have some UE object available for the javascript, and that I could bind some c++ method to that, but have not been able to find any solid example or document about that.

How to do that?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_561baee7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_561baee7](https://forums.unrealengine.com/u/anonymous_user_561baee7)\
**Post date:** [December 4, 2018, 6:38am UTC](https://forums.unrealengine.com/t/how-to-a-call-c-method-from-javascript-running-in-webbrowser-widget/438123/2 "2018-12-04T06:38:52Z")

</div>

I received a tip to use blueprint “execute javascript” node. That seems promising, but does not allow a return value. With return value I might be able to replace the need for callback. Being a newbie with UE and blueprints in special, is there some way to get a return value?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6789817d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6789817d](https://forums.unrealengine.com/u/anonymous_user_6789817d)\
**Post date:** [December 5, 2018, 5:30pm UTC](https://forums.unrealengine.com/t/how-to-a-call-c-method-from-javascript-running-in-webbrowser-widget/438123/3 "2018-12-05T17:30:21Z")

</div>

Hi Teleporno,

To bind UE objects to your JavaScript, you need to call `BindUObject` on your `SWebBrowser`. That will allow you to bind any of your objects to JavaScript, with the engine automatically handling all property and function registration. Functions that you wish to call from JavaScript must have the `UFUNCTION` macro specifier on them.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_561baee7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_561baee7](https://forums.unrealengine.com/u/anonymous_user_561baee7)\
**Post date:** [December 11, 2018, 7:47am UTC](https://forums.unrealengine.com/t/how-to-a-call-c-method-from-javascript-running-in-webbrowser-widget/438123/4 "2018-12-11T07:47:53Z")

</div>

Thanks for the advice, I will test that shortly, probably next week.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_561baee7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_561baee7](https://forums.unrealengine.com/u/anonymous_user_561baee7)\
**Post date:** [March 12, 2019, 1:52pm UTC](https://forums.unrealengine.com/t/how-to-a-call-c-method-from-javascript-running-in-webbrowser-widget/438123/5 "2019-03-12T13:52:05Z")

</div>

I recently noticed that if I set the target Android API level to 24 or higher, I do not have the window.ue object available in the javascript!? How to call c++ without the Unreal object?

---

<div class="post-metadata">

**Author:** ![startechnology19](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/startechnology19/32/1204465_2.png) [@startechnology19](https://forums.unrealengine.com/u/startechnology19)\
**Post date:** [August 27, 2026, 12:53pm UTC](https://forums.unrealengine.com/t/how-to-a-call-c-method-from-javascript-running-in-webbrowser-widget/438123/6 "2026-08-27T12:53:55Z")

</div>

Recommend a high-performance web UI solution for UE5: WebNativeBrowser. Based on Chromium kernel, GPU accelerated rendering, supports Windows/Linux/ARM64 three platforms.  
JS ↔ Blueprint bidirectional message channel, the front-end can directly embed pages generated by Vue, React, or even AI into UE. For digital twin and gaming tool projects, the development efficiency is significantly improved by doing business on the web side and scenario on the UE side. Git hub Serch: [starTechnology1994/uewebbrowser]
