lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Feb 12, 2013 at 2:58 PM, Pavel Holejsovsky
<pavel.holejsovsky@gmail.com> wrote:
> On Fri, 08 Feb 2013 20:22:35 -0500, Rena wrote:
>
>> I'm curious if there are WebKit bindings for Lua? I know about LuaKit,
>> but that appears to be more of a "build your own UI for a browser"
>> project, about the opposite of what I'm after. I'd like to load WebKit
>> as a module in a Lua script, feed it some HTML generated for the
>> purpose, and display it in a window, query positions and sizes of DOM
>> elements, basically use it as more of a UI toolkit than a web browser.
>> Has anyone done this before?
>
> Apart from already mentioned good possibilities there is also lgi.
> Recently I saw Craig's markdown viewer [1], - a very good and simple
> sample on how to use WebKit using lgi.
>
> Pavel
>
> [1] https://github.com/craigbarnes/mdview
>
>

Wow, that looks like exactly what I wanted! Thanks for pointing it
out, I had no idea that existed.

Right now I'm trying to figure out how to find the position and size
of a DOM element. What I want to do is position another application's
window so that it covers an element in the document. It looks like
there's a get_dom_document() method, but the object it returns isn't
documented.

Ultimately I'll want to communicate between my Lua code and the
Javascript running on the page too, but it doesn't look like there's
an API provided for that, or even to intercept resource loading (so JS
could request a "page" from some made-up protocol, and the page
contents be the response). The best I can see would be for my app to
function as a WebSocket server, or to use the status bar text as a
hacky way to pass strings. Is there a better method I've missed?

-- 
Sent from my Game Boy.