mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Compare commits
6 Commits
v1.0.0-alp
...
v1.0.0-alp
Author | SHA1 | Date | |
---|---|---|---|
f347953042 | |||
48b4c20e24 | |||
6341788edf | |||
0e273418c7 | |||
e6bbc1abb5 | |||
13bbc90048 |
@ -1,5 +1,9 @@
|
||||
### Changelog ###
|
||||
|
||||
#### v1.0.0-alpha.11 - 1.4.2018 ####
|
||||
* Fix IE11 member not found error
|
||||
* Support blob image resources in non-foreignObjectRendering mode
|
||||
|
||||
#### v1.0.0-alpha.10 - 15.2.2018 ####
|
||||
* Re-introduce `onclone` option (Fix #1434)
|
||||
* Add `ignoreElements` predicate function option
|
||||
|
@ -66,13 +66,6 @@ module.exports = function(config) {
|
||||
platform: 'iOS',
|
||||
version: '9.3',
|
||||
device: 'iPhone 6 Plus Simulator'
|
||||
},
|
||||
'sl_ios_8.4_safari': {
|
||||
base: 'SauceLabs',
|
||||
browserName: 'Safari',
|
||||
platform: 'iOS',
|
||||
version: '8.4',
|
||||
device: 'iPhone 5s Simulator'
|
||||
}
|
||||
};
|
||||
|
||||
|
2652
package-lock.json
generated
2652
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@
|
||||
"name": "html2canvas",
|
||||
"description": "Screenshots with JavaScript",
|
||||
"main": "dist/npm/index.js",
|
||||
"version": "1.0.0-alpha.10",
|
||||
"version": "1.0.0-alpha.11",
|
||||
"author": {
|
||||
"name": "Niklas von Hertzen",
|
||||
"email": "niklasvh@gmail.com",
|
||||
|
14
src/Clone.js
14
src/Clone.js
@ -230,9 +230,17 @@ export class DocumentCloner {
|
||||
}
|
||||
|
||||
if (node instanceof HTMLStyleElement && node.sheet && node.sheet.cssRules) {
|
||||
const css = [].slice
|
||||
.call(node.sheet.cssRules, 0)
|
||||
.reduce((css, rule) => css + rule.cssText, '');
|
||||
const css = [].slice.call(node.sheet.cssRules, 0).reduce((css, rule) => {
|
||||
try {
|
||||
if (rule && rule.cssText) {
|
||||
return css + rule.cssText;
|
||||
}
|
||||
return css;
|
||||
} catch (err) {
|
||||
this.logger.log('Unable to access cssText property', rule.name);
|
||||
return css;
|
||||
}
|
||||
}, '');
|
||||
const style = node.cloneNode(false);
|
||||
style.textContent = css;
|
||||
return style;
|
||||
|
@ -33,6 +33,10 @@ export default class ResourceLoader {
|
||||
if (this.hasResourceInCache(src)) {
|
||||
return src;
|
||||
}
|
||||
if (isBlobImage(src)) {
|
||||
this.cache[src] = loadImage(src, this.options.imageTimeout || 0);
|
||||
return src;
|
||||
}
|
||||
|
||||
if (!isSVG(src) || FEATURES.SUPPORT_SVG_DRAWING) {
|
||||
if (this.options.allowTaint === true || isInlineImage(src) || this.isSameOrigin(src)) {
|
||||
@ -215,6 +219,7 @@ const INLINE_IMG = /^data:image\/.*/i;
|
||||
|
||||
const isInlineImage = (src: string): boolean => INLINE_IMG.test(src);
|
||||
const isInlineBase64Image = (src: string): boolean => INLINE_BASE64.test(src);
|
||||
const isBlobImage = (src: string): boolean => src.substr(0, 4) === 'blob';
|
||||
|
||||
const isSVG = (src: string): boolean =>
|
||||
src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);
|
||||
|
Reference in New Issue
Block a user