I'm adding a canvas element to a panel in an extension I'm working
on. Unfortunately (using a try/catch block) I'm getting the following
in FB_TRACE:
"TypeError: canvas.getContext is not a function"
I'm using the following in my extension to add the canvas:
--------
var panel = context.getPanel("myPanel");
var parentNode = panel.panelNode;
var canvas = document.createElement('canvas');
canvas.setAttribute('id','theCanvas');
canvas.setAttribute('width',250);
canvas.setAttribute('height',700);
parentNode.appendChild(canvas);
--------
In myPanel I can see the canvas was added because I set the height
tall enough it would force a scrollbar. No problem there. In the
html panel I can see that the canvas element was added to panelNode-
myPanel. When inspecting in canvas element in the DOM panel though,
the canvas element does not have the canvas specific functions it's
supposed to have: getContext, toDataUrl, etc. Loo
The exact same code above works fine when I appendChild to the body in
a simple html file. But within the extension it's somehow not
inheriting it's canvas specific parent functions. Is there some kind
of race condition I'm unaware of?
--
You received this message because you are subscribed to the Google
Groups "Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
https://groups.google.com/forum/#!forum/firebug