I have managed to create and add a canvas element to a FramerJS prototype:
myCanvas = document.createElement "canvas"
myCanvas.setAttribute("width","750px")
myCanvas.setAttribute("height","500px")
myCanvas.setAttribute("style","border: 2px solid black; background: #CCC")
container = new Layer
height: 1334
width: 750
backgroundColor: "white"
html: myCanvas.outerHTML
ctx = myCanvas.getContext "2d"
ctx.fillStyle = "blue"
ctx.fillRect(0, 0, 50, 50)
If you print(ctx)
it shows a valid CanvasRenderingContext2D
as the output. The problem is, nothing happens on the prototype. It remains blank - like the fillRect
function was never called.
Need to confirm if this is do to lack of support or if I'm doing something wrong.