Is there any way to enable drawWindow (via an about:config setting for
example) for a regular HTML page? I want to easily play with it.
Or, do I still have to create an extension to test it?
Thanks
--
Michael
You can enablePrivilege the relevant privileges (probably
UniversalBrowserRead). Google should have some info on doing that.
-Boris
Thanks.
netscape.security.PrivilegeManager.enablePrivilege();
I tried the privileges listed at
<http://www.mozilla.org/projects/security/components/signed-scripts.html#privs>,
but no single one or all of them make drawWindow allowed.
--
Michael
Either UniversalBrowserRead or UniversalXPConnect should allow it,
looking at the code. If it doesn't, you're doing something wrong in
terms of how you call enablePrivilege or in terms of how you set up your
profile (e.g. whether you set the
signed.applets.codebase_principal_support pref).
-Boris
I got it working with the attached.
There's a note in
<https://developer.mozilla.org/en/Drawing_Graphics_with_Canvas#Rendering_Web_Content_Into_A_Canvas>
about it not working when handling the load event. But, it's actually
pickier than that. It won't work inside any event handler function or even
a function you call by clicking on a button. It has to be called when it's
in the top scope or FF throws a security error. (At least thats how it
seems from a regular web page.)
I see the text is drawn funny (probably because it's stretched). But, it
looks right when viewing the canvas as an image.
That's all I wanted to do for the moment. Eventually though, I want to see
if I can save a whole web page (not just what's in the viewport) as a png.
Thanks.
--
Michael
Did you do the enablePrivilege call inside the same function that tries
to do drawWindow? If I remember correctly, the privilege flags are
per-function.
zw
> "Michael A. Puls II" <shado...@gmail.com> wrote:
>> There's a note in
>> <https://developer.mozilla.org/en/Drawing_Graphics_with_Canvas#Rendering_Web_Content_Into_A_Canvas>
>> about it not working when handling the load event. But, it's
>> actually pickier than that. It won't work inside any event handler
>> function or even a function you call by clicking on a button. It has
>> to be called when it's in the top scope or FF throws a security
>> error. (At least thats how it seems from a regular web page.)
>
> Did you do the enablePrivilege call inside the same function that tries
> to do drawWindow?
No.
> If I remember correctly, the privilege flags are
> per-function.
O.K. I must have missed that. Will try it.
Thanks
--
Michael
> Did you do the enablePrivilege call inside the same function that tries
> to do drawWindow?
That does the trick. Thanks.
--
Michael
Thanks Michael!