TAdvWebbrowser access session storage

Hi,

We are trying to encorporate a TAdvWebbrowser in our application for signing in a webserver. For our application we need the JWT (amongst other thing) provided by the server in the TAdvWebbrowser. These properties are stored in the (local) session storage of the browser. Is there any way to access this?

Alex

There are currently no APIs included to access the local storage, but this can be done with the ExecuteJavaScript method:

  AdvWebBrowser.ExecuteJavaScript('window.localStorage.getItem("myObject")',
  procedure(AValue: string)
  begin
    TAdvUtils.Log(AValue);
  end
  );

Hi @Pieter, thanks for you reply!
We've managed to get some of the keys from the sessionstorage, however when a key has an JSON object in its value it seems the function always results in "null".
Any suggestion on how to handle these keys?

In this example we can retrieve all values except the last (app_oauth), which is an object

2022-10-04_15-03-22

Hi,

I suppose you can do this by wrapping the code with JSON.stringify();

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.