-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault-browser-setup.html
More file actions
66 lines (54 loc) · 2.27 KB
/
default-browser-setup.html
File metadata and controls
66 lines (54 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Setting Chromium as the Default Web Browser</title>
<style>
body { font-family: sans-serif; max-width: 740px; margin: 2em auto; padding: 0 1em; line-height: 1.5; }
code, pre { background: #f4f4f4; padding: 0.15em 0.35em; border-radius: 3px; }
pre { padding: 0.8em; overflow-x: auto; }
h1 { border-bottom: 1px solid #ccc; padding-bottom: 0.3em; }
</style>
</head>
<body>
<h1>Setting Chromium as the Default Web Browser</h1>
<p>The <strong>Internet</strong> pane in System Preferences populates its
browser list from
<code>[NSWorkspace infoForScheme:@"http"]</code>
(see <code>Modules/Internet/InternetModule.m</code> line 41 in
<code>gershwin-systempreferences</code>). For Chromium installed in
<code>~/Applications</code> to appear there, two things must be true.</p>
<h2>1. Chromium's Info.plist declares the http/https URL schemes</h2>
<p>GNUstep discovers URL-scheme handlers via the application's
<code>Info.plist</code>. Either of the following forms works:</p>
<pre><key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Web site URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>http</string>
<string>https</string>
</array>
</dict>
</array></pre>
<p>or the GNUstep-native <code>NSTypes</code> form with an
<code>NSRole</code> entry and a scheme list including
<code>http</code> and <code>https</code>.</p>
<h2>2. The app is registered in the GNUstep services database</h2>
<p>After placing Chromium.app under <code>~/Applications</code>, run
<code>make_services</code> as <code>jmaloney</code> so the bundle gets
indexed:</p>
<pre>$ make_services</pre>
<p>Until this is done, <code>infoForScheme:</code> will not return
Chromium and it will not appear in the popup.</p>
<h2>3. Choose it in System Preferences → Internet</h2>
<p>Open System Preferences, select the Internet pane, and pick
<strong>Chromium</strong> from the default-browser popup. The pane calls
<code>setBestApp:inRole:forScheme:</code> for both
<code>http</code> and <code>https</code>
(<code>InternetModule.m</code> lines 67–69), persisting the
choice.</p>
</body>
</html>