-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add warning in the Quick Start guides about Safari breaking Copy to Clipboard #3898
Conversation
#[cfg(target_arch = "wasm32")] | ||
let result = web_sys::window()?.navigator().user_agent().ok(); | ||
|
||
#[cfg(not(target_arch = "wasm32"))] | ||
let result = None; | ||
|
||
result | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[cfg(target_arch = "wasm32")] | |
let result = web_sys::window()?.navigator().user_agent().ok(); | |
#[cfg(not(target_arch = "wasm32"))] | |
let result = None; | |
result | |
} | |
#[cfg(target_arch = "wasm32")] | |
eframe::web::user_agent() | |
#[cfg(not(target_arch = "wasm32"))] | |
None | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the most compact I can think of:
fn user_agent() -> Option<String> {
#[cfg(target_arch = "wasm32")]
return eframe::web::user_agent();
#[cfg(not(target_arch = "wasm32"))]
None
}
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
What
For security reason, Safari doesn't let use copy text from our Web viewer, see:
This PR detects if we are running on Safari and adds a warning to the top of the Quick Start guides.
Checklist