Welcome Guest Search | Active Topics | Sign In | Register

JavaScript extension function called in the first script of a page fails with "Failed to call JavaScript extension." o Options
Komarek
Posted: Monday, November 30, 2026 1:35:59 AM
Rank: Newbie
Groups: Member

Joined: 11/29/2026
Posts: 1
Hi,

we are evaluating an upgrade of EO.WebBrowser (WPF, .NET Framework 4.8) from 23.3.13 to 26.3.58 and found a behavior difference that we cannot find in the change log.

Setup (identical on both versions):

view = new EO.Wpf.WebView { Engine = engine };
view.RegisterJSExtensionFunction("hostCall", (s, e) => { /* store e.Arguments[0] */ });
// window shown, then:
view.LoadUrl("http://localhost:PORT/page");

The page calls the registered function from its very first script and again 300 ms later:

function call(label) { try { window.hostCall(label); return 'ok'; } catch (e) { return 'EXC ' + e.message; } }
window.res = { first: call('first'), second: call('second') }; // synchronous, in the first script
setTimeout(function () { window.res.third = call('third'); }, 300);

Result (same machine, same page, new WebView in a warmed engine, 2 repetitions plus 2 more pages in one WebView):

- First call made synchronously in the first script (0 ms): on EO 23.3.13 it works (3 of 3). On EO 26.3.58 the first and the second call throw "Failed to call JavaScript extension." (3 of 3); the third call 300 ms later works.
- First call made after setTimeout 20, 40, 60, 80, 120, 200, 500, 1500 ms: works on both versions (16 of 16 each).

The registered handler is not invoked for the failed calls (the host received only the third call). We did not test eoapi.extInvoke directly at this early moment.

Questions:
1. Is it intended that a JavaScript extension function cannot be called in the first moments of a page on newer versions? If yes, what is the earliest safe moment (an event, not a fixed delay)?
2. Is there an engine or WebView option that restores the earlier behavior (for example EOAPILevel)?
3. Is a fixed version known in which the first script can call a registered function?

We can send a small test project if that helps.

Thank you.
eo_support
Posted: Monday, November 30, 2026 8:07:06 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,531
Hi,

Please send us a small test project so that we can investigate further. See here for more details on sending test project to us:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.