[Sugar-devel] HTML activities
dwnarvaez at gmail.com
Thu Jan 31 14:00:23 EST 2013
On 30 January 2013 20:36, C. Scott Ananian <cscott at laptop.org> wrote:
> If you wanted to be extreme about this, you'd write all your APIs in C, and
> use gobject bindings (or alternative implementations carefully written to
> export the same interfaces as gobject would use for the C API). But I think
> Java is actually a better API-description language for the platforms likely
> to be useful for this generation of Sugar. (Note that I've already
> probably just write a single implementation of the APIs in Java for both
> Android-native activities and Web activities on Android. You've got a
> number of different options for the Sugar implementation, but if you wrote
> that code in a plugin for desktop browsers running in gnome, which might be
> convenient for development and some deployments. Many interesting behaviors
> on the Sugar side are just dbus calls, and you ought to be able to trigger
I spent some time looking into this today and I couldn't find an
approach I'm fully happy with.
* webkitgtk-with-webkit1 allows access to the DOM, so we could
register an handler to listen for dispatchEvent calls. Unfortunately
add_event_listener has broken introspection so it's not working from
python. But the real problem is that this approach will not be
possible with webkit2.
InjectedBundle, because of the multi process architecture.
InjectedBundle seems a bit dubious, I've seen a mail by a core hacker
dissuggesting it to the qt guys because it was designed for testing.
Now both qt and gtk are using it at least internally so things might
be changed, but it's hard to say given that it's completely
undocumented. Anyway if we wanted to take this approach, we would
basically implement an extension library which would listen to
messages from the DOM and turn them into dbus calls. Probably we could
to be out of process so calling pygobject directly would not be an
* Both firefox and chrome extensions have good messaging mechanisms
between content and extension that we could use. We would have the
issue to turn a full browser into a chromeless sugar activity though.
* Another possible approach is what people are doing on iOS.
protocol, say message://datastore_save/json_encoded_arguments. native
Should be easy to code, feels a bit hacky.
More information about the Sugar-devel