Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Zeroclipboard | 6,633 | 527 | 128 | 3 years ago | 39 | December 12, 2016 | 85 | mit | JavaScript | |
The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface. | ||||||||||
The Front End Knowledge You May Not Know | 2,230 | 4 years ago | 36 | |||||||
:innocent: 你可能不知道的前端知识点 | ||||||||||
Clipboard Inspector | 102 | 8 months ago | 1 | mit | JavaScript | |||||
A browser tool to look at what's available in the clipboard for a "paste" event. | ||||||||||
Clipboard Dom | 35 | 1 | 9 years ago | 5 | March 12, 2015 | 1 | JavaScript | |||
Makes a DOM element (i.e. <button>) write to the system clipboard | ||||||||||
Copy Button | 16 | 1 | 2 years ago | 7 | January 11, 2022 | 4 | JavaScript | |||
Web component to copy target text/dom-node value to clipboard | ||||||||||
Copypaste Webcomponent | 5 | 5 years ago | 6 | June 27, 2018 | 2 | JavaScript | ||||
Dependency-free custom element with shadow DOM. Specify text as a property that a user can then copy to the clipboard. | ||||||||||
Dom Paste | 5 | 1 | 1 | 8 years ago | 5 | November 10, 2014 | 2 | TypeScript | ||
Retrieve the clipboard content as an HTMLElement on a paste event | ||||||||||
Bee Clipboard | 4 | 3 years ago | 2 | CSS | ||||||
a bee-clipboard component for tinper-bee | ||||||||||
Swfclipboard | 3 | 14 years ago | mit | JavaScript | ||||||
A JavaScript clipboard interface. | ||||||||||
Polyfills | 3 | 5 months ago | mit | |||||||
List of polyfills to use modern things safely |
This library is no longer maintained as it is no longer necessary for modern web development. If you want your frontend JavaScript to manipulate the clipboard, please look into the new HTML Clipboard API (various docs available on MDN) or a small convenience wrapper around it like clipboard.js. Thanks for all your support, this project was a labor of love for many years. ❤️
This master
branch contains the v2.x
codebase for ZeroClipboard! For the v1.x
codebase, see the 1.x-master
branch instead.
The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface. The "Zero" signifies that the library is invisible and the user interface is left entirely up to you.
This is achieved by automatically floating the invisible movie on top of a DOM element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mousedown effects.
Suggestions welcome read over the contributing guidelines.
To setup the project for local development start with these commands in your terminal.
$ git clone https://github.com/zeroclipboard/zeroclipboard.git
$ cd zeroclipboard/
$ npm install -g grunt-cli
$ npm install
$ grunt
Before submitting a pull request you'll need to validate, build, and test your code. Run the default grunt task in your terminal.
$ grunt
If you just want to run the tests, run grunt test.
$ grunt test
Due to browser and Flash security restrictions, this clipboard injection can ONLY occur when
the user clicks on the invisible Flash movie. A simulated click
event from JavaScript will not
suffice as this would enable clipboard poisoning.
For a complete list of limitations, see docs/instructions.md#limitations.
On that page, you will also find an explanation of why ZeroClipboard will NOT work by default on code playground sites like JSFiddle, JSBin, and CodePen, as well as the appropriate "View" URLs to use on those sites in order to allow ZeroClipboard to work.
<html>
<body>
<button id="copy-button" data-clipboard-text="Copy Me!" title="Click to copy me.">Copy to Clipboard</button>
<script src="ZeroClipboard.js"></script>
<script src="main.js"></script>
</body>
</html>
// main.js
var client = new ZeroClipboard( document.getElementById("copy-button") );
client.on( "ready", function( readyEvent ) {
// alert( "ZeroClipboard SWF is ready!" );
client.on( "aftercopy", function( event ) {
// `this` === `client`
// `event.target` === the element that was clicked
event.target.style.display = "none";
alert("Copied text to clipboard: " + event.data["text/plain"] );
} );
} );
See docs/instructions.md for more advanced options in using the library on your site. See docs/api/ZeroClipboard.md for the complete API documentation.
Here is a working test page where you can try out ZeroClipboard in your browser.
To test the page demo page locally, clone the website repo.
This library is fully compatible with Flash Player 11.0.0 and above, which requires that the clipboard copy operation be initiated by a user click event inside the Flash movie. This is achieved by automatically floating the invisible movie on top of a DOM element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mousedown effects with just a little extra effort.
ZeroClipboard v2.x
is expected to work in IE9+ and all of the evergreen browsers.
Although support for IE7 & IE8 was officially dropped in v2.0.0
, it was actually
still technically supported through v2.0.2
.
Starting with version 1.1.7, ZeroClipboard uses semantic versioning.
see releases
MIT © James M. Greene Jon Rohan