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