capricorn86 / happy-dom

A JavaScript implementation of a web browser without its graphical user interface
MIT License
3.14k stars 189 forks source link

Getting canvas.toDataURL is always undefined #1350

Open XiaoDaiGua-Ray opened 4 months ago

XiaoDaiGua-Ray commented 4 months ago

Describe the bug When I manually create a canvas element, trying to call the toDataURL method is always undefined.

To Reproduce

  1. create canvas element
  2. calling canvas.toDataURL method
  3. result is undefined

Expected behavior The method should be obtained correctly.

Screenshots

image

Device: