mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Update useCORS documentation (Fix #1323)
This commit is contained in:
parent
38749bc4b6
commit
a570f5df74
@ -21,6 +21,7 @@ These are all of the available configuration options.
|
|||||||
| proxy | `null` | Url to the [proxy](/proxy/) which is to be used for loading cross-origin images. If left empty, cross-origin images won't be loaded.
|
| proxy | `null` | Url to the [proxy](/proxy/) which is to be used for loading cross-origin images. If left empty, cross-origin images won't be loaded.
|
||||||
| removeContainer | `true` | Whether to cleanup the cloned DOM elements html2canvas creates temporarily
|
| removeContainer | `true` | Whether to cleanup the cloned DOM elements html2canvas creates temporarily
|
||||||
| scale | `window.devicePixelRatio` | The scale to use for rendering. Defaults to the browsers device pixel ratio.
|
| scale | `window.devicePixelRatio` | The scale to use for rendering. Defaults to the browsers device pixel ratio.
|
||||||
|
| useCORS | `false` | Whether to attempt to load images from a server using CORS
|
||||||
| width | `Element` width | The width of the `canvas`
|
| width | `Element` width | The width of the `canvas`
|
||||||
| height | `Element` height | The height of the `canvas`
|
| height | `Element` height | The height of the `canvas`
|
||||||
| x | `Element` x-offset | Crop canvas x-coordinate
|
| x | `Element` x-offset | Crop canvas x-coordinate
|
||||||
|
@ -182,6 +182,7 @@ export class DocumentCloner {
|
|||||||
removeContainer: this.options.removeContainer,
|
removeContainer: this.options.removeContainer,
|
||||||
scale: this.options.scale,
|
scale: this.options.scale,
|
||||||
foreignObjectRendering: this.options.foreignObjectRendering,
|
foreignObjectRendering: this.options.foreignObjectRendering,
|
||||||
|
useCORS: this.options.useCORS,
|
||||||
target: new CanvasRenderer(),
|
target: new CanvasRenderer(),
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
@ -20,6 +20,7 @@ export type Options = {
|
|||||||
removeContainer: ?boolean,
|
removeContainer: ?boolean,
|
||||||
scale: number,
|
scale: number,
|
||||||
target: RenderTarget<*>,
|
target: RenderTarget<*>,
|
||||||
|
useCORS: boolean,
|
||||||
width: number,
|
width: number,
|
||||||
height: number,
|
height: number,
|
||||||
x: number,
|
x: number,
|
||||||
@ -72,6 +73,7 @@ const html2canvas = (element: HTMLElement, conf: ?Options): Promise<*> => {
|
|||||||
foreignObjectRendering: false,
|
foreignObjectRendering: false,
|
||||||
scale: defaultView.devicePixelRatio || 1,
|
scale: defaultView.devicePixelRatio || 1,
|
||||||
target: new CanvasRenderer(config.canvas),
|
target: new CanvasRenderer(config.canvas),
|
||||||
|
useCORS: false,
|
||||||
x: left,
|
x: left,
|
||||||
y: top,
|
y: top,
|
||||||
width: Math.ceil(width),
|
width: Math.ceil(width),
|
||||||
|
Loading…
Reference in New Issue
Block a user