Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please document how to clear the cache when using WebView2 within Unity #3727

Closed
RubenGarcia opened this issue Aug 21, 2023 · 9 comments
Closed
Assignees
Labels
doc documentation issues

Comments

@RubenGarcia
Copy link

I tried

using Microsoft.Web.WebView2.Core;
CoreWebView2Profile.ClearBrowsingDataAsync();

which gives

 The type or namespace name 'Web' does not exist in the namespace 'Microsoft'`
@michaelfarnsworth
Copy link
Collaborator

@RubenGarcia our WebView Unity plugin exposes a subset of what's available with the underlying CoreWebView2 control. You can find the current API surface area here: https://learn.microsoft.com/en-us/windows/mixed-reality/develop/advanced-concepts/webview2-unity-plugin. We don't currently expose a method for clearing the cache. We can look into that.

@RubenGarcia
Copy link
Author

Yes, clearing the cache would be very useful.
Please expose it.
Thank you.

@michaelfarnsworth
Copy link
Collaborator

@RubenGarcia are you interested in clearing everything? Browsing history, cookies, temp files, etc.?

@RubenGarcia
Copy link
Author

My usecase is being able to change the html in a webpage, and seeing the changes in WebView2. Right now, if I change the webpage, Webview2 shows the old, cached page.

@RubenGarcia
Copy link
Author

Another thing which I would like exposed is a way to get and set the ZoomFactor.
This is especially important since wheel functionality to traverse long pages is currently not working
(#3705)

@michaelfarnsworth
Copy link
Collaborator

My usecase is being able to change the html in a webpage, and seeing the changes in WebView2. Right now, if I change the webpage, Webview2 shows the old, cached page.

Could you give a few more details on your scenario? I did some quick testing, but didn't hit a caching issue. Is the page hosted locally? How is the HTML modified? I assume you're refreshing and expecting the updated content?

@RubenGarcia
Copy link
Author

RubenGarcia commented Sep 1, 2023

I browsed
https://rubengarcia.userweb.mwn.de/videos/
with hololens.
Then closed the program
Then used sftp to upload a new page with a different background colour to https://rubengarcia.userweb.mwn.de/videos/index.html
Then I opened the hololens again, and the page displayed the old background colour.

@michaelfarnsworth
Copy link
Collaborator

@RubenGarcia how are you closing the app?

@RubenGarcia
Copy link
Author

In hololens, tap on wrist, click on the button at the bottom of the menu, then long press on app name in menu, then close.

@MicrosoftEdge MicrosoftEdge locked and limited conversation to collaborators Oct 10, 2023
@victorhuangwq victorhuangwq converted this issue into discussion #4058 Oct 10, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
doc documentation issues
Projects
None yet
Development

No branches or pull requests

4 participants