Sébastien Dailly | 11 Feb 14:00

Make elinks realy scriptable.

Hello, I'm a long time user of elinks, and recently, I tried to build a lua script to add to elinks the same
behavior than vimperator/pentadactyl hint mode :

You enter in the hint mode by pressing « f », all links in the page becomes highlighted and labelled, like
when you press « . » in elinks for showing links number. Then you begin to type some letters on your
keyboard : only the links with thoses char in the text become selected (the links number are updated for
counting only the selected links).

Ok, that's easy : I just have to fetch all links on the current document, and each time the user enter a key in
the message box, match the text with the link name for each link, and set the link as selected or not. I can do
this in lua !

Let's take a look in the lua api, there are some fonction described in the documentation, for interracting
with elinks core (open a message box…), but where is the api for the differents object (link, document) ?
It seems it as not been written…

Ok, let's take a look in the code. Omg ! the functions described in the documentation are the only existing
ones ! There is no way to get the document, no way to select a link, no way to jump to a link… This is what you
call a browser « highly customizable and can be extended via Lua or Guile scripts » ? Don't give me that
jazz !

So, as it seems that anything as to be done, let's think about what I expect from a true scriptable browser :

Control the browser and the navigation :

     * To be allowed to open a tab, close one
     * Set the current url, refresh the page
     * To be informed when the user select a link

Control the display :
(Continue reading)


Gmane