bruevp

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • bruevp
    Participant

    So, is it really hard to add such functionality?

    bruevp
    Participant

    Trying to extract some numerical data from different pages for user

    bruevp
    Participant

    Also, are you suggesting there is a way to prepare a page on server side for download (with loading all content hidden by javascript)?

    bruevp
    Participant

    Can you please give an example on how to “use javascript to fetch content of a website and pass it to your C# script” without opening a browser window?
    It’s probably very simple, but I cannot figure it out without documentation
    For now I only found a way to do it after page loads in a browser like this:

    private string javaScriptCode = “UnityInAppBrowser.sendMessageFromJS(document.documentElement.outerHTML)”;

    void Start() {
    InAppBrowserBridge bridge = FindObjectOfType<InAppBrowserBridge>();
    bridge.onBrowserFinishedLoading.AddListener(Execute);
    bridge.onJSCallback.AddListener(OnMessageFromJS);
    }

    private void Execute(string command)
    {
    InAppBrowser.ExecuteJS(javaScriptCode);
    }

    void OnMessageFromJS(string jsMessage)
    {
    var filePath = Application.persistentDataPath + “/savedPage.html”;
    File.WriteAllText(filePath, jsMessage);
    }

Viewing 4 posts - 1 through 4 (of 4 total)