{"id":20414454,"url":"https://github.com/x-extends/xe-clipboard","last_synced_at":"2025-03-05T03:28:12.111Z","repository":{"id":55144531,"uuid":"163500537","full_name":"x-extends/xe-clipboard","owner":"x-extends","description":"纯  js 实现复制文本到剪贴板，支持IE、Chrome、Firefox、Opera、Safari、IOS、Android ","archived":false,"fork":false,"pushed_at":"2024-05-15T12:56:24.000Z","size":57,"stargazers_count":50,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T16:50:11.407Z","etag":null,"topics":["clipboard"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/x-extends.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-29T10:05:29.000Z","updated_at":"2025-01-14T12:12:11.000Z","dependencies_parsed_at":"2024-05-16T02:25:40.511Z","dependency_job_id":null,"html_url":"https://github.com/x-extends/xe-clipboard","commit_stats":{"total_commits":89,"total_committers":3,"mean_commits":"29.666666666666668","dds":"0.022471910112359605","last_synced_commit":"339b4ab4b53f3a461e5289442f16d3ba49d1a1ae"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-extends%2Fxe-clipboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-extends%2Fxe-clipboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-extends%2Fxe-clipboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-extends%2Fxe-clipboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x-extends","download_url":"https://codeload.github.com/x-extends/xe-clipboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241959074,"owners_count":20049167,"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":["clipboard"],"created_at":"2024-11-15T06:10:04.998Z","updated_at":"2025-03-05T03:28:12.091Z","avatar_url":"https://github.com/x-extends.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xe-clipboard\n\n[![gitee star](https://gitee.com/x-extends/xe-clipboard/badge/star.svg?theme=dark)](https://gitee.com/x-extends/xe-clipboard/stargazers)\n[![npm version](https://img.shields.io/npm/v/xe-clipboard.svg?style=flat-square)](https://www.npmjs.com/package/xe-clipboard)\n[![npm downloads](https://img.shields.io/npm/dm/xe-clipboard.svg?style=flat-square)](http://npm-stat.com/charts.html?package=xe-clipboard)\n[![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)\n\n基于 [execCommand](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand) API 实现复制内容到剪贴板，支持主流的 H5 浏览器 IE, Chrome, Firefox, Opera, Safari, IOS, Android  \n压缩大小 \u003c 0.5KB  \n\n## Browser Support\n\n![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png)\n--- | --- | --- | --- | --- | --- |\n10+ ✔ | Latest ✔ | 42+ ✔ | 41+ ✔ | 29+ ✔ | 10+ ✔ |\n\n## Installing\n\n```shell\nnpm install xe-clipboard\n```\n\n```xml\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/xe-clipboard\"\u003e\u003c/script\u003e\n```\n\n## Example\n\n```html\n\u003cbutton id=\"btn1\"\u003eCopy\u003c/button\u003e\n```\n\n```javascript\ndocument.getElementById('btn1').addEventListener('click', function (evnt) {\n  // 由于浏览器的安全机制，操作剪贴板必须在事件之内才能有效\n  if (XEClipboard.copy('Copy this content to the clipboard.')) {\n    alert('Copy success.')\n  } else {\n    alert('The browser is not supported.')\n  }\n})\n```\n\n## Contributors\n\nThank you to everyone who contributed to this project.\n\n[![xe-clipboard](https://contrib.rocks/image?repo=x-extends/xe-clipboard)](https://github.com/x-extends/xe-clipboard/graphs/contributors)\n\n## License\n\n[MIT](LICENSE) © 2017-present, Xu Liangzhan\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-extends%2Fxe-clipboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx-extends%2Fxe-clipboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-extends%2Fxe-clipboard/lists"}