<div dir="ltr">I like that more than the webkit extension.<div><br></div><div>In 90% of the cases, javascript should not ask the preview, and be saved in automatic way by the python code,</div><div>just like the actual code. In the rare cases where the web activity want custom the preview, can get it from the url.</div>
<div><br></div><div>Gonzalo </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 20, 2013 at 6:47 PM, Daniel Narvaez <span dir="ltr"><<a href="mailto:dwnarvaez@gmail.com" target="_blank">dwnarvaez@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>What about using the custom protocol? Something like activity://.../api/screenshot.png could trigger a get_snapshot and return the image data.<br>
<br></div><div>It's an hack, and I would not suggest to go this way on Android for example, but if we don't feel like writing a webkit extension, it's certainly cleaner, easier and faster than going through apisocket.<br>
</div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On 20 September 2013 23:41, Daniel Narvaez <span dir="ltr"><<a href="mailto:dwnarvaez@gmail.com" target="_blank">dwnarvaez@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Very tricky...<br></div><div><br>The gtk3 API allows activities to override the preview and it seems like we should keep that feature here. I feel like to do that sanely the js code needs to be able to see the screenshot.<br>
<br></div><div>A clean implementation of a javascript screenshot API (both chrome and firefox has one for extensions fwiw) would require to write a webkit "extension". Those must be written in C unfortunately, epiphany has one I think so we could at least take inspiration. An extension might be useful to do other stuff in the future, for example the environment stuff could be implemented more cleanly that way.<br>
<br></div><div>Another approach I can think of is: javascript requests the screenshot on the apisocket, the shell gets it from the activity trough dbus. Though it requires two ipc steps and it doesn't even make much sense conceptually.<br>
</div></div><div><br></div><div>I'm not sure what we should here exactly, just dumping my brain.<br></div><div><br></div></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On 20 September 2013 22:28, Suraj K S <span dir="ltr"><<a href="mailto:suraj.gillespie@gmail.com" target="_blank">suraj.gillespie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm able to capture the screenshot of a web activity by making use of <a href="http://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#webkit-web-view-get-snapshot" target="_blank">http://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#webkit-web-view-get-snapshot</a>.<div>
(The image quality seems to be pretty good. In fact, way better than the current preview screenshots in python activities)</div><div><br><div>I make those calls here, <a href="https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/master/src/sugar3/activity/webactivity.py" target="_blank">https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/master/src/sugar3/activity/webactivity.py</a><br>
<div><br></div><div><br></div><div>The question is, do we need to pass it(base64 encoded image) to the js api?</div><div><br></div><div>Or would it suffice to just add it to the datastore object on the shell side (how)?</div>
<div> <br></div></div></div></div>
</blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>Daniel Narvaez<br>
</font></span></div>
</blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>Daniel Narvaez<br>
</font></span></div>
<br>_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br></blockquote></div><br></div>