diff options
author | Emil Ernerfeldt <emil.ernerfeldt@gmail.com> | 2024-06-28 08:40:58 +0200 |
---|---|---|
committer | Emil Ernerfeldt <emil.ernerfeldt@gmail.com> | 2024-06-28 08:40:58 +0200 |
commit | e62bd7037ad2fa71f6da8c144d3e9cbbbb314d40 (patch) | |
tree | 95e7fa0cc5b4b5b433721ce3f48f50352065d29d /crates | |
parent | 814eddd0940bf455a741084e25c7f402f9217757 (diff) |
Improve warning when failing to copy on web
Diffstat (limited to 'crates')
-rw-r--r-- | crates/eframe/src/web/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/eframe/src/web/mod.rs b/crates/eframe/src/web/mod.rs index 3f314752..212c0ae6 100644 --- a/crates/eframe/src/web/mod.rs +++ b/crates/eframe/src/web/mod.rs @@ -172,7 +172,12 @@ fn set_clipboard_text(s: &str) { }; wasm_bindgen_futures::spawn_local(future); } else { - log::warn!("window.navigator.clipboard is null; can't copy text"); + let is_secure_context = window.is_secure_context(); + if is_secure_context { + log::warn!("window.navigator.clipboard is null; can't copy text"); + } else { + log::warn!("window.navigator.clipboard is null; can't copy text, probably because we're not in a secure context. See https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts"); + } } } } |