[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2029":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":33,"discoverSource":34},2029,"html2canvas","niklasvh\u002Fhtml2canvas","niklasvh","Screenshots with JavaScript","https:\u002F\u002Fhtml2canvas.hertzen.com\u002F",null,"TypeScript",31868,4876,493,975,0,2,6,27,8,45,"MIT License",false,"master",true,[27,28,29],"dom","javascript","screenshot","2026-06-12 02:00:36","html2canvas\n===========\n\n[Homepage](https:\u002F\u002Fhtml2canvas.hertzen.com) | [Downloads](https:\u002F\u002Fgithub.com\u002Fniklasvh\u002Fhtml2canvas\u002Freleases) | [Questions](https:\u002F\u002Fgithub.com\u002Fniklasvh\u002Fhtml2canvas\u002Fdiscussions\u002Fcategories\u002Fq-a)\n\n[![Gitter](https:\u002F\u002Fbadges.gitter.im\u002FJoin%20Chat.svg)](https:\u002F\u002Fgitter.im\u002Fniklasvh\u002Fhtml2canvas?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) \n![CI](https:\u002F\u002Fgithub.com\u002Fniklasvh\u002Fhtml2canvas\u002Fworkflows\u002FCI\u002Fbadge.svg?branch=master)\n[![NPM Downloads](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Fhtml2canvas.svg)](https:\u002F\u002Fwww.npmjs.org\u002Fpackage\u002Fhtml2canvas)\n[![NPM Version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fhtml2canvas.svg)](https:\u002F\u002Fwww.npmjs.org\u002Fpackage\u002Fhtml2canvas)\n\n#### JavaScript HTML renderer ####\n\n The script allows you to take \"screenshots\" of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.\n\n\n### How does it work? ###\nThe script renders the current page as a canvas image, by reading the DOM and the different styles applied to the elements.\n\nIt does **not require any rendering from the server**, as the whole image is created on the **client's browser**. However, as it is heavily dependent on the browser, this library is *not suitable* to be used in nodejs.\nIt doesn't magically circumvent any browser content policy restrictions either, so rendering cross-origin content will require a [proxy](https:\u002F\u002Fgithub.com\u002Fniklasvh\u002Fhtml2canvas\u002Fwiki\u002FProxies) to get the content to the [same origin](http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSame_origin_policy).\n\nThe script is still in a **very experimental state**, so I don't recommend using it in a production environment nor start building applications with it yet, as there will be still major changes made.\n\n### Browser compatibility ###\n\nThe library should work fine on the following browsers (with `Promise` polyfill):\n\n* Firefox 3.5+\n* Google Chrome\n* Opera 12+\n* IE9+\n* Safari 6+\n\nAs each CSS property needs to be manually built to be supported, there are a number of properties that are not yet supported.\n\n### Usage ###\n\nThe html2canvas library utilizes `Promise`s and expects them to be available in the global context. If you wish to\nsupport [older browsers](http:\u002F\u002Fcaniuse.com\u002F#search=promise) that do not natively support `Promise`s, please include a polyfill such as\n[es6-promise](https:\u002F\u002Fgithub.com\u002Fjakearchibald\u002Fes6-promise) before including `html2canvas`.\n\nTo render an `element` with html2canvas, simply call:\n` html2canvas(element[, options]);`\n\nThe function returns a [Promise](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FGlobal_Objects\u002FPromise) containing the `\u003Ccanvas>` element. Simply add a promise fulfillment handler to the promise using `then`:\n\n    html2canvas(document.body).then(function(canvas) {\n        document.body.appendChild(canvas);\n    });\n\n### Building ###\n\nYou can download ready builds [here](https:\u002F\u002Fgithub.com\u002Fniklasvh\u002Fhtml2canvas\u002Freleases).\n\nClone git repository:\n\n    $ git clone git:\u002F\u002Fgithub.com\u002Fniklasvh\u002Fhtml2canvas.git\n\nInstall dependencies:\n\n    $ npm install\n\nBuild browser bundle\n\n    $ npm run build\n\n### Examples ###\n\nFor more information and examples, please visit the [homepage](https:\u002F\u002Fhtml2canvas.hertzen.com) or try the [test console](https:\u002F\u002Fhtml2canvas.hertzen.com\u002Ftests\u002F).\n\n### Contributing ###\n\nIf you wish to contribute to the project, please send the pull requests to the develop branch. Before submitting any changes, try and test that the changes work with all the support browsers. If some CSS property isn't supported or is incomplete, please create appropriate tests for it as well before submitting any code changes.\n","html2canvas 是一个使用 JavaScript 实现网页截图的库。它通过读取 DOM 和应用到元素上的样式，在客户端浏览器上将当前页面或部分页面渲染为 canvas 图像，无需服务器端渲染支持。该库支持多种现代浏览器，但依赖于浏览器环境，不适合 Node.js 环境，并且对于跨域内容需要通过代理解决同源策略限制问题。适用于需要在前端实现网页或特定区域截屏的应用场景，如网页分享、预览生成等。尽管项目仍在实验阶段，不建议用于生产环境，但对于开发和测试用途来说是一个有价值的工具。","2026-06-11 02:47:39","top_all"]