Luakit Documentation   /   Modules   /   formfiller

Module formfiller

Provides functionality to auto-fill forms based on a Lua DSL

The formfiller provides support for filling out forms based on the contents of a forms file, which uses a domain-specific language to specify the content to fill forms with.

The following is an example for a formfiller definition:

on "example.com" {
    form "profile1" {
        method = "post",
        action = "/login",
        className = "someFormClass",
        id = "form_id",
        input {
            name = "username",
            type = "text",
            className = "someClass",
            id = "username_field",
            value = "myUsername",
        },
        input {
            name = "password",
            value = "myPassword",
        },
        input {
            name = "autologin",
            type = "checkbox",
            checked = true,
        },
        submit = true,
        autofill = false,
    },
}

As a basic precaution, autofill only works if the web page domain is present within the URI pattern.

There is a conversion script in the luakit repository that converts from the old formfiller format to the new one. For more information, see the converter script under extras/convert_formfiller.rb.

Files and Directories

Functions

formfiller.extend (extensions)

Extend the formfiller DSL with additional functions. This takes a table of functions. For example, to use the pass storage manager:

formfiller.extend({
    pass = function(s) return io.popen("pass " .. s):read() end
})

which will then be usable in the fields of form.lua:

input {
    name = "username",
    value = pass("emailpassword"),
}

Functions used to extend the DSL will be called only when needed: when matching for attributes used in matching, or once a form is applied, for attributes used in form application.

Parameters

  • extensions
    Type: table
    The table of functions extending the formfiller DSL.

Attribution

Copyright