Problem Defination:
I need to inject the authorization header to session storage of WebView, so that the server authenticates the user and redirects to the dashboard. If there is any delay in injection the WebView loads and redirects user to server's login page as it couldn't find the authorization header in the session storage.
What I tried:
onLoadStrat of WebView, I've injected the data using this.webview.injectJavaScript()
By doing so I'm able to inject the data to session storage but on first load there's a race condition. Injection takes a bit time and the Login screen has shown in place of the dashboard.
Expected Result:
We want to achieve the injection without any delay. Suggest me if there's any other way to get this working the way we want it to.
Waiting to hear from you guys. Your valuable suggestions are highly appreciated.
Thank you.