Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Clipboard on Safari/iOS help request #3778

Closed
miketwenty1 opened this issue Jan 14, 2024 · 0 comments
Closed

Clipboard on Safari/iOS help request #3778

miketwenty1 opened this issue Jan 14, 2024 · 0 comments
Labels

Comments

@miketwenty1
Copy link

Summary

Following up with a discussion here to get more visibility.
May be related to: emilk/egui#3480 ?

I'm trying to get clipboard working with Safari browsers / iOS. Any help would be greatly appreciated.

let _task = spawn_local(async move {
    let window = web_sys::window().expect("window");
    let nav = window.navigator().clipboard();
    match nav {
        Some(a) => {
            let p = a.write_text("this text copies to clipboard on android and desktop but not Safari/iOS");
            let result = wasm_bindgen_futures::JsFuture::from(p).await;
            match result {
                Ok(_) => info!("copy worked"),
                Err(e) => info!("copy fail {:?}", e),
            }
        }
        None => {
            warn!("failed to clippy the clipboard clip clip");
        }
    };
});

The error is JsValue(NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

The same error happens on both safari/macbook and safari/iOS.

@rustwasm rustwasm locked and limited conversation to collaborators Jan 14, 2024
@daxpedda daxpedda converted this issue into discussion #3781 Jan 14, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

1 participant