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