-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[feat] API to clear webview-managed data #6567
Comments
I have this requirement too, for example user may want to switch to user another user to login to my app, and the authentication is done by using webview and authenticated data is stored in the cookie. It seems we can do this by remove some data in app dir? |
Yeah you could, but at least on Windows this should only reliable work when there is no webview open, as far as i know at least. Anyway, in contrast to last time we talked about this API all webviews should now have built-in ways to clear the data so it should be possible now for us to implement this :) |
Glad to hear that, it seems the javascript context can't be accessed directly from the tauri WebviewWindow object, if the API is not implemented now, do you know there is some way we can inject a tiny javascript to the webview to do that ? can initialization_script achieve that? I do not know much above web programming, if there is an API to be released, I can delay a feature depend on this and implement when the API is released, thanks a lot. |
The API we're talking about here would need to be implemented in Rust (via the webview bindings) so we could add an api for it on the WebviewWindow object too (unless there are security concerns i don't have in mind right now) |
/upstream tauri-apps/wry |
Most likely you need to find the paths or folders where the files are stored, check different options for deleting them,
You can also use native Rust code, which has access to the file system and deletes files and folders. |
Upstream issue at tauri-apps/wry#914 has been closed. |
any updates on this? |
hello?? |
Hi 👋 |
Describe the problem
My application uses cookies/localStorage on the javascript side for various purposes.
I don't see a clear way to clear all the stuff stored by the Webview engine. I could have the javascript side clear these, but there are things that this side can't clear like disk cache, etc
Describe the solution you'd like
I want to put a native button like 'Logout' that clears all this data.
An API on app/app_handle that clears this data might make sense. Maybe it needs to be part of exit or relaunch?
Alternatives considered
I considered manually deleting some of the path_resolver() directories, but directories like
/Users/pttamkin/Library/HTTPStorage/{pkg}
and/Users/pttamkin/Library/WebKit/{pkg}
aren't captured here. Also not sure I can delete these while my app is running?Additional context
No response
The text was updated successfully, but these errors were encountered: