clipboard_apis library Null safety
Clipboard API and events
- Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers. The interface implements the Clipboard API, providing—if the user grants permission—both read and write access to the contents of the system clipboard. The Clipboard API can be used to implement cut, copy, and paste features within a web application.
Experimental: This is an experimental technologyCheck the
Browser compatibility table carefully before using this in
The interface represents events providing information related to
modification of the clipboard, that is
The interface of the
Clipboard APIrepresents a single item format, used when reading or writing data via the
Clipboard API. That is
clipboard.write()respectively. The benefit of having the interface to represent data, is that it enables developers to cope with the varying scope of file types and data easily. Access to the contents of the clipboard is gated behind the Permissions API: The
clipboard-writepermission is granted automatically to pages when they are in the active tab. The
clipboard-readpermission must be requested, which you can do by trying to read data from the clipboard.