mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-20 17:02:53 -04:00
note on user agents
This commit is contained in:
@@ -5,6 +5,11 @@ pub const ARTCRAFT_DESKTOP_USER_AGENT: &str = "storyteller-client/1.0";
|
||||
|
||||
/// `User-Agent` sent to third parties: the default of the OS webview Tauri runs on
|
||||
/// (WKWebView on macOS, WebView2 on Windows, WebKitGTK on Linux).
|
||||
///
|
||||
/// NB: These are hardcoded snapshots and WILL go out of date as the OS webviews update
|
||||
/// (especially WebView2's Chrome/Edge version, which auto-updates on Windows). Rust can't read
|
||||
/// the webview's real `navigator.userAgent`, so refresh these periodically by checking
|
||||
/// `navigator.userAgent` in the desktop app's devtools on each OS.
|
||||
#[cfg(target_os = "macos")]
|
||||
pub const WEBVIEW_USER_AGENT: &str =
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)";
|
||||
|
||||
@@ -35,6 +35,10 @@ values from one place, `crates/lib/artcraft_client_identity`
|
||||
- The native Rust client (`artcraft_client`) sends the Origin and User-Agent on
|
||||
every API request via `storyteller_client_builder`; it previously sent no
|
||||
Origin.
|
||||
- The "OS webview" User-Agents are hardcoded snapshots in
|
||||
`artcraft_client_identity/src/user_agents.rs` and go out of date as the
|
||||
webviews update (notably WebView2's Edge version on Windows). Refresh them
|
||||
from `navigator.userAgent` in the desktop app's devtools on each OS.
|
||||
- The vendored HTTP plugin only replaces the webview's own origin (packaged
|
||||
`tauri://localhost` etc., or a loopback Vite origin), and only sets the
|
||||
User-Agent when the frontend didn't.
|
||||
|
||||
Reference in New Issue
Block a user