lua-users home
lua-l archive

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


On 9 February 2013 02:22, Rena <hyperhacker@gmail.com> 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?

You can do stuff like this also in lqt [1]. The whole QtWebkit [2]
module is available as a binding. I've used this to "cheat" in a
simple online game, where you buy stuff and get some rewards. After
loading the page, I calculated the reward/price for each item (using
DOM, not parsing) and rearanged the items, so that the most efficient
items were at the top.

[1] https://github.com/mkottman/lqt
[2] http://qt-project.org/doc/qt-4.8/qtwebkit.html

I am not sure if this works in the current Qt version (4.8, 5.0 was
not tested yet), since there are some threading issues, but it worked
stable in Qt 4.7. There are Windows binaries available for 4.7 and 4.8
if anyone wants to try it out, just mail me.