[Sugar-devel] native HTML activity

NoiseEHC noiseehc at gmail.com
Thu Nov 7 16:36:44 EST 2013


Hi!

Just to prove that it can be done, I have hacked a little bit more on 
the native HTML activity which can be found here:
https://github.com/NoiseEHC/sugar-webkit-native

I tried to create virtual pages by using WebKit1's or Soap's url 
rewriting callbacks but it turns out that no matter what you do, the 
thing wants to use the data from the TCP stream... So I turned to 
starting a (Soap) HTTP server inside the native activity (on a random 
port) and it works. Now the activity runs from localhost (/activity and 
/web subfolders) and there is a virtual folder called /journal. It has 
only one hacked file, the /journal/journal.html, which has links to all 
the things in the journal. It queries the journal service via DBUS. I 
have to tell you that working with GVariant from C is a real PITA, so I 
did not implement the load/store of the real journal files, but it is 
clearly possible... (Beware, it leaks every possible resources, it is 
just a proof of concept.)

Now, I do not know what is the problem with WebKit1, it seems to work 
for me, and at least it does not crash on an XO-1.75 as WebKit2 does. On 
the other hand I cannot try it on my XO-1.75 as it is not possible 
anymore to install webkitgtk-devel on the machine as I told you last time...

This whole project has the following benefits:
- It is much-much faster than the python one. It does matter on an XO.
- It does not depend on the WebKitGTK python bindings to be maintained, 
it can use all WebKitGTK's features.
- It does not have a dependency on Node.js.
- It does not use WebSocket, which would require using WebKit2...

So now it is your decision whether you use it or not.

Thanks,
Andrew


More information about the Sugar-devel mailing list