globals.lua

1
-- Global variables for luakit
2
globals = {
3
    homepage         = "http://google.co.uk/",
4
    scroll_step      = 20,
5
    zoom_step        = 0.1,
6
    max_cmd_history  = 100,
7
    max_srch_history = 100,
8
 -- http_proxy       = "http://example.com:3128",
9
    download_dir     = luakit.get_special_dir("DOWNLOAD") or (os.getenv("HOME") .. "/Downloads"),
10
}
11
 
12
-- Make useragent
13
local rv, out, err = luakit.spawn_sync("uname -sm")
14
local webkit_version = string.format("WebKitGTK+/%d.%d.%d AppleWebKit/525.13", luakit.webkit_major_version,
15
    luakit.webkit_minor_version, luakit.webkit_micro_version)
16
local luakit_version = string.format("luakit/%s Safari/525.13.", luakit.version)
17
globals.useragent = string.format("Mozilla/5.0 (%s) %s %s", string.match(out, "([^\n]*)"), webkit_version, luakit_version)
18
-- Search common locations for a ca file which is used for ssl connection validation.
19
local ca_files = {luakit.data_dir .. "/ca-certificates.crt",
20
    "/etc/certs/ca-certificates.crt", "/etc/ssl/certs/ca-certificates.crt",}
21
for _, ca_file in ipairs(ca_files) do
22
    if os.exists(ca_file) then
23
        globals.ca_file = ca_file
24
        break
25
    end
26
end
27
 
28
-- Change to stop navigation sites with invalid or expired ssl certificates
29
globals.ssl_strict = false
30
 
31
-- Search engines
32
search_engines = {
33
    luakit      = "http://luakit.org/search/index/luakit?q={0}",
34
    google      = "http://google.com/search?q={0}",
35
    wikipedia   = "http://en.wikipedia.org/wiki/Special:Search?search={0}",
36
    debbugs     = "http://bugs.debian.org/{0}",
37
    imdb        = "http://imdb.com/find?s=all&q={0}",
38
    sourceforge = "http://sf.net/search/?words={0}",
39
}
40
 
41
-- Fake the cookie policy enum here
42
cookie_policy = { always = 0, never = 1, no_third_party = 2 }
43
 
44
-- Per-domain webview properties
45
domain_props = { --[[
46
    ["all"] = {
47
        ["enable-scripts"]          = false,
48
        ["enable-plugins"]          = false,
49
        ["enable-private-browsing"] = false,
50
        ["user-stylesheet-uri"]     = "",
51
        ["accept-policy"]           = cookie_policy.never,
52
    },
53
    ["youtube.com"] = {
54
        ["enable-scripts"] = true,
55
        ["enable-plugins"] = true,
56
    },
57
    ["lwn.net"] = {
58
       ["accept-policy"] = cookie_policy.no_third_party,
59
    },
60
    ["forums.archlinux.org"] = {
61
        ["user-stylesheet-uri"]     = luakit.data_dir .. "/styles/dark.css",
62
        ["enable-private-browsing"] = true,
63
    }, ]]
64
}
65
 
66
-- vim: et:sw=4:ts=8:sts=4:tw=80