Repository navigation
feat: add Webview::cookies and Webview::cookies_for_url()
#12665
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
Changes from 1 commit
bccd107
fdbefdd
dc50f2c
fa1db55
47c95da
b53ebb2
3a0aee3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "tauri": minor:feat | ||
| "tauri-runtime": minor:feat | ||
| "tauri-runtime-wry": minor:feat | ||
| --- | ||
|
|
||
| Added `Webview::cookies_for_url()` and `tauri::Cookie` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ use tauri_runtime::{ | |
| pub use tauri_utils::config::Color; | ||
| use tauri_utils::config::{BackgroundThrottlingPolicy, WebviewUrl, WindowConfig}; | ||
| pub use url::Url; | ||
| pub use tauri_runtime::Cookie; | ||
|
|
||
| use crate::{ | ||
| app::{UriSchemeResponder, WebviewEvent}, | ||
|
|
@@ -1157,6 +1158,11 @@ impl<R: Runtime> Webview<R> { | |
| Ok(()) | ||
| } | ||
|
|
||
| /// Returns all cookies for a specified URL including HTTP-only and secure cookies. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a note about the scheme requirements here? imo quite important
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added a note. This actually seems more of a bug/runtime limitation than anything. I would imagine this is because the |
||
| pub fn cookies_for_url(&self, url: Url) -> crate::Result<Vec<Cookie<'static>>> { | ||
| self.webview.dispatcher.cookies_for_url(url).map_err(Into::into) | ||
| } | ||
|
|
||
| /// Sets whether the webview should automatically grow and shrink its size and position when the parent window resizes. | ||
| pub fn set_auto_resize(&self, auto_resize: bool) -> crate::Result<()> { | ||
| self | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.