Calling javascript on the page from html5 game

Hi, is it possible to call external javascript function from html5 game created by Defold?
I’m trying to figure out is it possible to use javascript api of some game portals like ArmorGames or Kongrgate with games made with defold.

2 Likes

No, not currently. This is something we wish to solve, especially now with the advent of messenger gaming on the rise. @Pkeod started working on a solution for this as well: Implement Gamedistribution ads using webview

1 Like

Thank you for the answer. I hope the solution will be found, I really like Defold so far, but this feature is crucial for me right now.

1 Like

Do we have a solution to this now?

Yes, we’ve had a solution for this for quite some time:

local result = html5.run("some_function();")

And we have full native Javascript support as well:

2 Likes

That’s great, thank you. Sorry for the dumb question - this is a new area of Defold to me.

2 Likes