FS#32 - we need C access to the DOM (webkit feature)
Attached to Project:
Uzbl
Opened by Dieter Plaetinck (Dieter_be) - 2009-06-07 02:27:14 PM
Last edited by Dieter Plaetinck (Dieter_be) - 2009-06-07 08:39:28 PM
Opened by Dieter Plaetinck (Dieter_be) - 2009-06-07 02:27:14 PM
Last edited by Dieter Plaetinck (Dieter_be) - 2009-06-07 08:39:28 PM
|
Detailswebkit should give us C access to the DOM, so we don't need JS (you cannot get data back from js into C)
use cases: - better form filler - better link following / link yanking into clipboard/external scripts without actually visiting, opening in new window etc - change to insert mode when using JS to go to input fields and such - probably more |
This task depends upon
The header files (/usr/include/webkit-1.0/JavaScriptCore/) are a bit commented.
Interesting sample code
http://trac.webkit.org/browser/trunk/JavaScriptCore/API/tests (C)
http://git.xfce.org/kalikiana/midori/tree/midori/sokoke.c#n54 (C, for userscripts, they are just wrapped inside a DOMContentLoaded function and eval'd)
http://developer.apple.com/samplecode/JSPong/listing6.html (objective C)
http://code.google.com/p/greasekit/source/browse/trunk/CMController.m (objective C)
I've seen how to call a js function and get a value back, but not how to define a js function that calls a C one. And polling is not the best alternative.
http://github.com/dequis/uzbl/commit/fedfe2c06b3e01d5dede2cbab395a0ab48bb94e9
I have also a GM_xmlhttprequest()-compatible function (which includes: js object processing/creation, callbacks, context handling, and some other stuff), but i'm still cleaning a few bugs and it's not in git.