Skip to content

navigator.clipboard.read and navigator.clipboard.readText can throw NotAllowedError #21568

@mb-jp

Description

@mb-jp

Describe the bug

On the lines:

const clipboardItems = await clipboard.read();

The web browser can throw NotAllowedError, This will crash avalonia in many cases.

This is related to #21530

Another potential problem

clipboard.writeText and clipboard.write can throw NotAllowedError, but nothing I've had a problem with.

To Reproduce

Set browser to "block" for the clipboard permission

Expected behavior

No response

Avalonia version

12.0.4

OS

WebAssembly

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp-wantedA contribution from the community would be most welcome.os-browser

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions