{"repo":"lgarron/clipboard-polyfill","free":true,"listed":false,"github":"https://github.com/lgarron/clipboard-polyfill","clone":"git clone https://github.com/lgarron/clipboard-polyfill.git","description":":clipboard: Simple copying on the web, with maximum browser compatibility. (You probably don't need this anymore!)","language":"TypeScript","stars":927,"topics":["clipboard","copy","paste","javascript","web","api","polyfill","ponyfill"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"clipboard-polyfill ⚠️ You don't need clipboard-polyfill to copy text! ⚠️ Note: As of 2020, you can use navigator.clipboard.writeText(...) in the stable versions of all major browsers. This library will only be useful to you if you want to: - target very old browsers (see below for compatibility) for text copy, - copy text/html in Firefox ≤126, - use the ClipboardItem API in Firefox ≤126, or - polyfill the API shape in a non-browser environment (e.g. in jsdom ). See the Compatibility section below for more details. --- Summary Makes copying on the web as easy as: This library is a ponyfill/polyfill for the modern Promise -based asynchronous clipboard API. Usage If you use npm , install: Sample app that copies text to the clipboard: Notes: - You need to call a clipboard operation in response to a user gesture (e.g. the event handler for a button click). - Some browsers may only allow one clipboard operation per gesture. async / await syntax More MIME types (data types) Check the Clipboard API specification for more details. Notes: - You'll need to use async functions for the await syntax. - Currently, text/plain and text/html are the only data types that can be written to the clipboard across most browsers. - If you try to copy unsupported data types, they may be silently dropped (e.g. Safari 13.1) or the call may throw an error (e.g. Chrome 83). In general, it is not possible to tell when data types are dropped. - In some current browsers, read() may only return a subset of su","default_branch":null,"files":null,"tree":[],"storefront":"/r/lgarron","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lgarron/clipboard-polyfill/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}