Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshot generation stops when encountering an unsupported background-image function #1865

Closed
2 tasks done
val1984 opened this issue May 31, 2019 · 0 comments · Fixed by #1873
Closed
2 tasks done

Comments

@val1984
Copy link
Contributor

val1984 commented May 31, 2019

  • You are using the latest version
  • You are testing using the non-minified version of html2canvas and checked any potential issues reported in the console

Bug reports:

When trying to generate a screenshot where an unsupported background-image function such as repeating-linear-gradient, screenshot generation does not complete and gives the following error:

Could not generate screenshot for help request Error: Attempting to parse an unsupported image function "repeating-linear-gradient"
    at parse (html2canvas.js:2834)
    at Array.map (<anonymous>)
    at Object.parse (html2canvas.js:2868)
    at parse (html2canvas.js:4114)
    at new CSSParsedDeclaration (html2canvas.js:3998)
    at new ElementContainer (html2canvas.js:4138)
    at createContainer (html2canvas.js:4485)
    at parseNodeTree (html2canvas.js:4438)
    at parseNodeTree (html2canvas.js:4451)
    at parseNodeTree (html2canvas.js:4451)

Whereas in 1.0.0-rc.1 and earlier, it didn't stop screenshot generation.
Example: http://jsfiddle.net/yh4L67bf/
The error is thrown from here:

throw new Error(`Attempting to parse an unsupported image function "${value.name}"`);

Specifications:

  • html2canvas version tested with: 1.0.0-rc.3
  • Browser & version: Google Chrome 74.0.3729.169
  • Operating system: Windows 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant