I’m recently working with the WebView2 in C# where I’m accessing to an API through an iframe.
Basically when the WebView2 gets initialized i call the method “ExecuteScriptAsync” where an HTML-Code gets executed which creates an iframe inside this html-code an then calls the api and shows me a website.
The problem is, when i call the API the iframe tries to get some information from the localstorage to initialize the website from the API and runs against an error.
Error trying to access the localStorage
i also tried to set the localStorage inside the iframe but this doesn’t work – i tried a lot of things but it won’t work -.-
I’m at the end of my knowledge, do you guys have an idea or a hint how to fix this?
Please say it if you need more information – i’ll add it.
Thank you guys!