{"id":13447924,"url":"https://github.com/zeroclipboard/zeroclipboard","last_synced_at":"2025-10-05T17:31:50.540Z","repository":{"id":2995369,"uuid":"4012085","full_name":"zeroclipboard/zeroclipboard","owner":"zeroclipboard","description":"The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.","archived":true,"fork":false,"pushed_at":"2021-02-15T20:36:42.000Z","size":3232,"stargazers_count":6609,"open_issues_count":85,"forks_count":1040,"subscribers_count":251,"default_branch":"master","last_synced_at":"2024-12-30T09:09:37.676Z","etag":null,"topics":["adobe-flash","adobe-flex","apache-flex","clipboard","dom","flash","frontend","javascript","web","zeroclipboard"],"latest_commit_sha":null,"homepage":"http://zeroclipboard.github.io/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeroclipboard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":null}},"created_at":"2012-04-13T03:59:44.000Z","updated_at":"2024-12-22T21:23:55.000Z","dependencies_parsed_at":"2022-07-16T05:30:35.188Z","dependency_job_id":null,"html_url":"https://github.com/zeroclipboard/zeroclipboard","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroclipboard%2Fzeroclipboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroclipboard%2Fzeroclipboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroclipboard%2Fzeroclipboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroclipboard%2Fzeroclipboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroclipboard","download_url":"https://codeload.github.com/zeroclipboard/zeroclipboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235425013,"owners_count":18988332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adobe-flash","adobe-flex","apache-flex","clipboard","dom","flash","frontend","javascript","web","zeroclipboard"],"created_at":"2024-07-31T05:01:30.495Z","updated_at":"2025-10-05T17:31:45.201Z","avatar_url":"https://github.com/zeroclipboard.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Uncategorized","31. 文本处理 ##","JavaScript Libs","31. 文本处理","javascript"],"sub_categories":["Uncategorized","13.20 视差滚动(Parallax Scrolling) ###","Clipboard","24.3 Web Sockets"],"readme":"### :warning: WARNING!\nThis 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](https://github.com/zenorocha/clipboard.js). Thanks for all your support, this project was a labor of love for many years. :heart:\n\n---\n\n#### Note:\n**This `master` branch contains the `v2.x` codebase for ZeroClipboard! For the `v1.x` codebase, see the [`1.x-master`](https://github.com/zeroclipboard/zeroclipboard/tree/1.x-master) branch instead.**\n\n\n# ZeroClipboard\n[![GitHub Latest Release](https://badge.fury.io/gh/zeroclipboard%2Fzeroclipboard.svg)](https://github.com/zeroclipboard/zeroclipboard) [![Build Status](https://secure.travis-ci.org/zeroclipboard/zeroclipboard.svg?branch=master)](https://travis-ci.org/zeroclipboard/zeroclipboard) ![GZip Size](https://badge-size.herokuapp.com/zeroclipboard/zeroclipboard/master/dist/ZeroClipboard.min.js?compression=gzip) [![Coverage Status](https://coveralls.io/repos/zeroclipboard/zeroclipboard/badge.svg?branch=master)](https://coveralls.io/r/zeroclipboard/zeroclipboard?branch=master) [![Dependency Status](https://david-dm.org/zeroclipboard/zeroclipboard.svg?theme=shields.io)](https://david-dm.org/zeroclipboard/zeroclipboard) [![Dev Dependency Status](https://david-dm.org/zeroclipboard/zeroclipboard/dev-status.svg?theme=shields.io)](https://david-dm.org/zeroclipboard/zeroclipboard#info=devDependencies)\n\nThe ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible [Adobe Flash](http://en.wikipedia.org/wiki/Adobe_Flash) movie and a [JavaScript](http://en.wikipedia.org/wiki/JavaScript) interface. The \"Zero\" signifies that the library is invisible and the user interface is left entirely up to you.\n\nThis is achieved by automatically floating the invisible movie on top of a [DOM](http://en.wikipedia.org/wiki/Document_Object_Model) element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mousedown effects.\n\nSuggestions welcome read over the [contributing](/CONTRIBUTING.md) guidelines.\n\n## Setup\n\nTo setup the project for local development start with these commands in your terminal.\n\n```sh\n$ git clone https://github.com/zeroclipboard/zeroclipboard.git\n$ cd zeroclipboard/\n$ npm install -g grunt-cli\n$ npm install\n$ grunt\n```\n\n## Development\n\nBefore submitting a pull request you'll need to validate, build, and test your code. Run the default grunt task in your terminal.\n\n```sh\n$ grunt\n```\n\n## Testing\n\nIf you just want to run the tests, run grunt test.\n\n```sh\n$ grunt test\n```\n\n## Limitations\n\n### User Interaction Required\n\nDue to browser and Flash security restrictions, this clipboard injection can _**ONLY**_ occur when\nthe user clicks on the invisible Flash movie. A simulated `click` event from JavaScript will not\nsuffice as this would enable [clipboard poisoning](http://www.computerworld.com/s/article/9117268/Adobe_patches_Flash_clickjacking_and_clipboard_poisoning_bugs).\n\n### Other Limitations\n\nFor a complete list of limitations, see [docs/instructions.md#limitations](docs/instructions.md#limitations).\n\nOn that page, you will also find an [explanation of why ZeroClipboard will _NOT_ work by default on code playground sites](docs/instructions.md#starter-snippets-for-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.\n\n\n## Simple Example\n\n```html\n\u003chtml\u003e\n  \u003cbody\u003e\n    \u003cbutton id=\"copy-button\" data-clipboard-text=\"Copy Me!\" title=\"Click to copy me.\"\u003eCopy to Clipboard\u003c/button\u003e\n    \u003cscript src=\"ZeroClipboard.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"main.js\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n```js\n// main.js\nvar client = new ZeroClipboard( document.getElementById(\"copy-button\") );\n\nclient.on( \"ready\", function( readyEvent ) {\n  // alert( \"ZeroClipboard SWF is ready!\" );\n\n  client.on( \"aftercopy\", function( event ) {\n    // `this` === `client`\n    // `event.target` === the element that was clicked\n    event.target.style.display = \"none\";\n    alert(\"Copied text to clipboard: \" + event.data[\"text/plain\"] );\n  } );\n} );\n```\n\nSee [docs/instructions.md](docs/instructions.md) for more advanced options in using the library on your site.\nSee [docs/api/ZeroClipboard.md](docs/api/ZeroClipboard.md) for the complete API documentation.\n\nHere is a working [test page](http://zeroclipboard.github.io/#demo) where you can try out ZeroClipboard in your browser.\n\n\n## Testing ZeroClipboard Locally\n\nTo test the page [demo page](http://zeroclipboard.github.io/#demo) locally, clone the [website repo](https://github.com/zeroclipboard/zeroclipboard.github.io).\n\n## Support\n\nThis library is fully compatible with Flash Player 11.0.0 and above, which requires\nthat the clipboard copy operation be initiated by a user click event inside the\nFlash movie. This is achieved by automatically floating the invisible movie on top\nof a [DOM](http://en.wikipedia.org/wiki/Document_Object_Model) element of your\nchoice. Standard mouse events are even propagated out to your DOM element, so you\ncan still have rollover and mousedown effects with just a _little_ extra effort.\n\nZeroClipboard `v2.x` is expected to work in IE9+ and all of the evergreen browsers.\nAlthough support for IE7 \u0026 IE8 was officially dropped in `v2.0.0`, it was actually\nstill _technically_ supported through `v2.0.2`.\n\n## Releases\n\nStarting with version [1.1.7](https://github.com/zeroclipboard/zeroclipboard/releases/tag/v1.1.7), ZeroClipboard uses [semantic versioning](http://semver.org/).\n\nsee [releases](https://github.com/zeroclipboard/zeroclipboard/releases)\n\n## Related\n\n* [jquery.zeroclipboard](https://github.com/zeroclipboard/jquery.zeroclipboard)\n* [zeroclipboard-rails](https://github.com/zeroclipboard/zeroclipboard-rails)\n\n## License\n\nMIT \u0026copy; [James M. Greene](http://greene.io/) [Jon Rohan](http://jonrohan.codes)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroclipboard%2Fzeroclipboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroclipboard%2Fzeroclipboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroclipboard%2Fzeroclipboard/lists"}