@lottev1991/html2canvas 1.6.5-custom

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # html2canvas
2
+
3
+ This project is a fork of [niklasvh/html2canvas](https://github.com/niklasvh/html2canvas). This fork in turn was based on [another fork](https://github.com/html2canvas/html2canvas).
4
+
5
+ [Downloads](https://github.com/lottev1991/html2canvas/releases) | [Questions](https://github.com/lottev1991/html2canvas/discussions/categories/q-a)
6
+
7
+ ![CI](https://github.com/lottev1991/html2canvas/workflows/CI/badge.svg?branch=master)
8
+ [![NPM Downloads](https://img.shields.io/npm/dm/@lottev1991/html2canvas.svg)](https://www.npmjs.org/package/@lottev1991/html2canvas)
9
+ [![NPM Version](https://img.shields.io/npm/v/@lottev1991/html2canvas.svg)](https://www.npmjs.org/package/@lottev1991/html2canvas)
10
+
11
+ #### JavaScript HTML renderer
12
+
13
+ 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.
14
+
15
+ ### How does it work?
16
+
17
+ The script renders the current page as a canvas image, by reading the DOM and the different styles applied to the elements.
18
+
19
+ It 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.
20
+ It doesn't magically circumvent any browser content policy restrictions either, so rendering cross-origin content will require a [proxy](https://github.com/niklasvh/html2canvas/wiki/Proxies) to get the content to the [same origin](http://en.wikipedia.org/wiki/Same_origin_policy).
21
+
22
+ The 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.
23
+
24
+ ### Browser compatibility
25
+
26
+ The library should work fine on the following browsers (with `Promise` polyfill):
27
+
28
+ - Firefox 3.5+
29
+ - Google Chrome
30
+ - Opera 12+
31
+ - IE9+
32
+ - Safari 6+
33
+
34
+ As each CSS property needs to be manually built to be supported, there are a number of properties that are not yet supported.
35
+
36
+ ### Install
37
+
38
+ ```shell
39
+ npm i @lottev1991/html2canvas
40
+ ```
41
+
42
+ ### Usage
43
+
44
+ The html2canvas library utilizes `Promise`s and expects them to be available in the global context. If you wish to
45
+ support [older browsers](http://caniuse.com/#search=promise) that do not natively support `Promise`s, please include a polyfill such as
46
+ [es6-promise](https://github.com/jakearchibald/es6-promise) before including `html2canvas`.
47
+
48
+ To render an `element` with html2canvas, simply call:
49
+ ` html2canvas(element[, options]);`
50
+
51
+ The function returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) containing the `<canvas>` element. Simply add a promise fulfillment handler to the promise using `then`:
52
+
53
+ ```js
54
+ html2canvas(document.body).then(function (canvas) {
55
+ document.body.appendChild(canvas);
56
+ });
57
+ ```
58
+
59
+ or
60
+
61
+ ```js
62
+ html2canvas(document.body).then((canvas) => {
63
+ document.body.appendChild(canvas);
64
+ });
65
+ ```
66
+
67
+ or
68
+
69
+ ```js
70
+ const canvas = await html2canvas(document.body);
71
+ document.body.appendChild(canvas);
72
+ ```
73
+
74
+ ### Building
75
+
76
+ You can download ready builds [here](https://github.com/lottev1991/html2canvas/releases).
77
+
78
+ Clone git repository:
79
+
80
+ ```shell
81
+ git clone git://github.com/lottev1991/html2canvas.git
82
+ ```
83
+
84
+ Install dependencies:
85
+
86
+ ```shell
87
+ npm install
88
+ ```
89
+
90
+ Build browser bundle
91
+
92
+ ```shell
93
+ npm run build
94
+ ```
95
+
96
+ ### Examples
97
+
98
+ For more information and examples, please visit the [homepage](https://html2canvas.github.io/html2canvas) or try the [test console](https://html2canvas.github.io/html2canvas/tests/).
99
+
100
+ ### Contributing
101
+
102
+ If 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.