Uzbl

Tasklist

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
Task Type Bug Report
Category uzbl-core
Status Assigned
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version Development
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

webkit 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

Comment by dx (dx) - 2009-06-14 06:45:10 PM
There are JavaScriptCore bindings, but they are not documented in webkitgtk.org. It's not DOM but allows to get data back from JS.
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.
Comment by dx (dx) - 2009-06-20 03:15:39 AM
Disregard what I've said about not knowing how to define a function, everything is possible with JavaScriptCore.

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.
Comment by Ben Boeckel (mathstuf) - 2011-04-14 04:36:20 AM
The formfiller, link follower, and go_input scripts all do most of what one would expect from them. However, direct JS bindings would alleviate the need for the shell wrapper scripts that currently live around the actual scripts.

Loading...