[Sugar-devel] Preview field in web activities

Gonzalo Odiard gonzalo at laptop.org
Mon Sep 9 07:55:41 EDT 2013


+1

On Mon, Sep 9, 2013 at 8:38 AM, Daniel Narvaez <dwnarvaez at gmail.com> wrote:
> I wonder about the general approach here... It's good that it can be done
> all in js, but rerendering the DOM like this feels a bit bad. It will
> probably not work well for some web sites and might have a performance hit.
> We have access to the webkit rendered so maybe we should just use that... If
> we decide or the js approach, we should at least test it pretty well to make
> sure it's good enough.
>
> On Monday, 9 September 2013, Suraj K S wrote:
>>
>> I'm able to capture the screen shot of the activity using
>> http://html2canvas.hertzen.com/
>>
>> It captures the screenshot and returns a canvas.
>>
>> Now to convert it to a png image I'm using:
>>
>> var previewImage = canvas.toDataURL("ImageWriter/png;base64");
>>
>> The problem with this is that it throws a
>>
>> SECURITY_ERR: DOM Exception 18
>>
>> After reading a bit on this error, got to know that when the canvas has an
>> element whose origin-clean flag is set to false, it would generate this
>> error.
>> Not able to understand why exactly this is happening in Sugar though.
>>
>> Is there a way around this?
>
>
>
> --
> Daniel Narvaez
>
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>


More information about the Sugar-devel mailing list