forked from Niek/chrome-features
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemplate.html
More file actions
235 lines (215 loc) · 9.65 KB
/
template.html
File metadata and controls
235 lines (215 loc) · 9.65 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Chrome features</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1/css/bulma.min.css">
<script src="https://cdn.jsdelivr.net/npm/list.js@2/dist/list.min.js"></script>
</head>
<body>
<section class="section">
<div class="container is-fluid">
<input class="input is-large" type="text" placeholder="Type to search settings..." id="search">
<hr>
</div>
<!-- Chrome Switches Section -->
<div class="container is-fluid">
<h1 class="title">Chrome switches</h1>
<p class="subtitle">
Command line switches for Chrome browser:
</p>
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Source</th>
</tr>
</thead>
<tbody class="list">
{% for switch in chrome_switches %}
<tr data-description="{{ switch.description if switch.description else '' }}">
<td class="name">--{{ switch.name }}</td>
<td>
{% if switch.description %}
<pre>{{ switch.description | safe }}</pre>
{% else %}
—
{% endif %}
</td>
<td>{{ switch.source }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- Chrome Features Section -->
<div class="container is-fluid">
<h1 class="title">Chrome features</h1>
<p class="subtitle">
Enable with <code>--enable-features</code>, disable with <code>--disable-features</code>:
</p>
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Enabled by default</th>
</tr>
</thead>
<tbody class="list">
{% for feature in chrome_features %}
<tr data-description="{{ feature.description if feature.description else '' }}">
<td class="name">{{ feature.name }}</td>
<td>
{% if feature.description %}
<pre>{{ feature.description | safe }}</pre>
{% else %}
—
{% endif %}
</td>
<td>{{ '✅' if feature.enabled_default else '❌' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- Blink Features Section -->
<div class="container is-fluid">
<h1 class="title">Blink features</h1>
<p class="subtitle">
Enable with <code>--enable-blink-features</code>, disable with <code>--disable-blink-features</code>:
</p>
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Enabled by default</th>
</tr>
</thead>
<tbody class="list">
{% for feature in blink_features %}
<tr data-description="{{ feature.description if feature.description else '' }}">
<td class="name">{{ feature.name }}</td>
<td>
{% if feature.description %}
<pre>{{ feature.description | safe }}</pre>
{% else %}
—
{% endif %}
</td>
<td>{{ '✅' if feature.enabled_default else '❌' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- Blink Settings Section -->
<div class="container is-fluid">
<h1 class="title">Blink settings</h1>
<p class="subtitle">
Modify with <code>--blink-settings</code>:
</p>
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<tr>
<th>Name</th>
<th>Default</th>
<th>Type</th>
</tr>
</thead>
<tbody class="list">
{% for setting in blink_settings %}
<tr>
<td class="name">{{ setting.name }}</td>
<td>{{ setting.initial if setting.initial is not none else '—' | safe }}</td>
<td>{{ setting.type if setting.type else '—' | safe }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- Preferences Section -->
<div class="container is-fluid">
<h1 class="title">Preferences</h1>
<p class="subtitle">
The following JSON preferences can be modified in the <code>Preferences</code> file in the profile:
</p>
<pre>{{ prefs | tojson(indent=2) }}</pre>
</div>
</section>
<footer class="footer">
<div class="content has-text-centered">
<p>
<strong>Updated</strong>: {{ current_date }}. For the source code, see the <a
href="https://github.com/Niek/chrome-features">GitHub repo</a>.
</p>
</div>
</footer>
<script>
// Wait until the DOM is fully loaded
document.addEventListener("DOMContentLoaded", function () {
// Initialize List.js for each table
var lists = [];
// Find all containers with tables and initialize List.js for each
const containers = document.querySelectorAll('.container.is-fluid');
containers.forEach((container, index) => {
const table = container.querySelector('table');
if (table) {
// Create a wrapper div for List.js if it doesn't exist
let listContainer = container;
const list = new List(listContainer, {
valueNames: ['name'],
listClass: 'list'
});
lists.push(list);
}
});
// Filter all tables based on the search input
const updateSearch = () => {
const search = document.querySelector('#search').value.toLowerCase().trim();
if (!search) {
// If no search term, show all items
lists.forEach(list => {
list.search();
});
} else {
lists.forEach(list => {
list.filter((item) => {
const nameElement = item.elm.querySelector('.name');
const name = nameElement ? nameElement.textContent.toLowerCase() : '';
const description = item.elm.getAttribute('data-description');
const descText = description ? description.toLowerCase() : '';
// Search in name (remove -- prefix for switches when searching)
const cleanName = name.startsWith('--') ? name.substring(2) : name;
const nameMatch = cleanName.includes(search) || name.includes(search);
// Search in description
const descMatch = descText.includes(search);
return nameMatch || descMatch;
});
});
}
// Update the URL with the search query using the history API
const url = new URL(document.location.toString());
if (search) {
url.searchParams.set('q', search);
} else {
url.searchParams.delete('q');
}
history.pushState({}, '', url.toString());
}
// Update the search when the input changes
document.querySelector('#search').addEventListener('input', updateSearch);
document.querySelector('#search').addEventListener('keyup', updateSearch);
// Update the search when the page is loaded
const url = new URL(document.location.toString());
if (url.searchParams.has('q')) {
document.querySelector('#search').value = url.searchParams.get('q');
updateSearch();
}
});
</script>
</body>
</html>