Pass Data With ExecuteJS()

Welcome! Forums Unity Plugins In-App Web Browser Pass Data With ExecuteJS()

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23056
    sp33d
    Participant

    Hello, thanks for the great plugin.

    Was hoping for some insight into the limitations of the InAppBrowser.ExecuteJS() function. I see in the example it is used to trigger an alert, but I’m wondering if there’s a way to pass data from Unity to the javascript code, like for example having unity set a javascript variable. I assume this function’s JS code is executed in the browser’s context, so it wouldn’t be possible to directly interact with the web server’s JS code, but I’m hoping I’m mistaken?

    Additionally, I’m curious if there’s any method to monitor the browser’s console during runtime.

    Thanks!

    #23057
    PiotrPiotr
    Keymaster

    ExecuteJS is executed in context of the browser, so obviously it does not have access to your back end. Probably you would not want to have clients having access to your back end – security would be non existent 😉

    Regarding console.log – you dont’ see them in Unity logs? I guess you can overwrite console.log with something custom which will send those messages to Unity.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.