User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3
Build Identifier: Thunderbird 2.x
working on an extension that needs to use canvas i realized that it's disabled in the standard distributions. after lot's of searching it turns out the only way to enable the canvas seems to have "enable-canvas" in the build options. building tbird yourself is not an option to most "normal" tbird users (my target group), so i suggest to add a way (code & preference) for developers and/or users to enable the canvas (and maybe even SVG) elements (XUL, html:canvas) on the fly.
Steps to Reproduce:
Doing it as a run-time pref wouldn't make any sense: we'd have to build and ship it, when the only reason I know of that it's disabled is to save the code bloat. But unless I failed to actually get it enabled when I was testing, for a Windows installer that code bloat looks like 11,472 bytes, which is insanely tiny for something that enables so much extension fun. I'll test again, and see how big it is in Mac and Linux, but that seems like a wonderful bargain for the size to me.
Created attachment 277501 [details] [diff] [review]
Turn it on
Well, I don't have a convenient test to be sure it's enabled, but I certainly think this should do, and it bloats the Win exe by around 11KB, the Linux tar.bz2 by around 15KB, and the poor Mac dmg by around 25KB. Still quite cheap.
When this gets turned on for Thunderbird, I think it would be really cool to prove that it works, by having someone copy what Firefox does when you visit a phishing site (http://www.mozilla.org/projects/bonecho/anti-phishing/its-a-trap.html) with a canvas element that dims the content area. In Firefox, that code happens roughly in here:
we can skip the warning overlay part and focus on just dimming the content pane...
Florian, if you happen to feel like doing a super-simple extension that just verifies that canvas is enabled and working, that would be fantastic, since a canvas overlay dimming the content area in Thunderbird probably won't work on the trunk, just like Firefox trunk is stuck with their phishing overlay hiding behind their content browser right now.
I installed Thunderbrowse <http://thunderbrowse.com/> into version 3.0a1pre (2007082304) and then tried several SVG demos including <http://www.december.com/html/demo/hellosvg.html> but none of the <svg> elements were displayed.
Was there some reason you expected enabling canvas to enable SVG?
But, if I were inclined to verify my own bugs, I'd be tempted to verify it based on installing Thunderbrowse, enabling script, and seeing that http://developer.mozilla.org/samples/raycaster/RayCaster.html runs, since I doubt it'd be possible to have it working in content but not chrome.
Created attachment 277942 [details]
super simple canvas enabled extension for thunderbird
(In reply to comment #4)
> Florian, if you happen to feel like doing a super-simple extension that just
> verifies that canvas is enabled and working, that would be fantastic, since a
> canvas overlay dimming the content area in Thunderbird probably won't work on
> the trunk, just like Firefox trunk is stuck with their phishing overlay hiding
> behind their content browser right now.
since the bug got closed can i assume canvas is gonna be enabled by default in the future? if yes that's super great news to me!
simple canvas check extension attached. adds a status message: "html:canvas [enabled]" .. or ".. [not enabled]". if canvas is enabled it adds a html:canvas to the messageviewer showing a little green animation. let me know if it works for you ..
dimming? i never said anything about dimming ...
(In reply to comment #6)
> Was there some reason you expected enabling canvas to enable SVG?
> But, if I were inclined to verify my own bugs, I'd be tempted to verify it
> based on installing Thunderbrowse, enabling script, and seeing that
> http://developer.mozilla.org/samples/raycaster/RayCaster.html runs, since I
> doubt it'd be possible to have it working in content but not chrome.
I don't think Thunderbrowse offers anything more than the method I choose.
Compose a message with:
iframe style="margin-left: 5%;" marginheight="0" marginwidth="0"
width="800" frameborder="0" height="600"></iframe>
The canvas appears but the keys do not function.
Warning: Key event not available on GTK2: key="a" modifiers="accel, shift"
Source File: chrome://messenger/content/messageWindow.xul
But since my real goal was enabling canvas in chrome for extensions, rather than in how good a browser we could make our email client, I'll take Florian's extension, which works beautifully, thank you, as verification enough.
Created attachment 278100 [details]
canvas test extension, nicer.
added a new version of my "super simple" test extension. it's a little nicer and has better mouse / key / resize event handling.
Forgive me for sounding naive, but will this bug's fix land in TB126.96.36.199? I'm working on an extension that would very happily use this ability of canvas-in-chrome, if it were there. I'm trying to add a "thread arcs" visualization to the expandedHeaderView (see http://www.visophyte.org/examples/visterity/20071008-clicky/conv876.xml for an example, and http://www.research.ibm.com/remail/threadarcs.html for the source). Could be fun, certainly a fun use of the drawing elements... (BTW -- I wouldn't mind using SVG elements either -- and SVG might actually make the visualization work better, since it could be more easily interactive.)
> Forgive me for sounding naive, but will this bug's fix land in TB188.8.131.52?