-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoptions.html
133 lines (133 loc) · 7.75 KB
/
options.html
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
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>ViHN Options</title>
<head>
<link rel="stylesheet" type="text/css" href="main.css">
<style>
#options { list-style-type: none; }
#options input[type=checkbox] { width:20px; margin-left:-25px; margin-right:5px; padding:0; }
#options input[type=number] { width: 5em; text-align: right; }
#options>li { margin-bottom: 2em; }
/*
* NOTE:
* Chrome finally supports hyphens since 2021.
* However, CSS justification can still only do inter-character or inter-word, not both, so it looks terrible.
* hyphenate-limit-chars might help mitigate this but it is not supported by Firefox.
* Without justification, hyphens just add clutter, so no point in enabling them either.
*/
#options { padding-left: 25px; }
#options ul { padding-left: 15px; }
</style>
</head>
<body>
<p>
<strong>Note:</strong>
Changes will be reflected immediately;
no need to reload Hacker News pages.
</p>
<ul id="options">
<li>
<label>
<input type="checkbox" name="updateLocation"><strong>Update hash in URL after <input type="number" name="updateLocationDelay" min="0" step="0.1"> seconds</strong>
</label>
<p>
When navigating a thread or submission listing, the URL in the location bar is updated to point directly to that item.
For instance, the URL for comment <code>67890</code> in submission <code>12345</code> would be:
<pre><code>https://news.ycombinator.com/item?id=12345#67890</code></pre>
This makes it easy to resume reading a thread after reloading the page, or when transferring tabs from one device to another.
This does <strong>not</strong> cause a page reload.
<ul>
<li>With this option <strong>enabled</strong>, and…
<ul>
<li>…a delay of <strong>0 seconds</strong>, all items will appear in the history.</li>
<li>…a <strong>non-zero delay</strong>, items on which you stayed for that duration will appear in the history.</li>
</ul>
<li>With this option <strong>disabled</strong>, only the original URL of the page will appear in the history.</li>
</ul>
<p>
<strong>Note:</strong>
On Firefox, this adds an history entry for each item you visit.
This can resulting in a cluttered history, and interfere with the Back and Next buttons.
As a compromise, you can set a delay for the update to only happen after you have stayed on the item for a while.
This lets you navigate from one item to another without saving the intermediate steps to your history.
</p>
</li>
<li>
<label>
<input type="checkbox" name="updateLocationOnClose"><strong>Update hash in URL when closing tab</strong>
</label>
<p>
Independently from the previous option, ViHN can update the URL when closing the tab.
You might want this if you want to avoid cluttering your browser history, but want to resume after accidentally closing the tab.
</p>
<ul>
<li>With this option <strong>enabled</strong>, the URL will be updated when closing the tab.</li>
<li>With this option <strong>disabled</strong>, the URL will not be updated when closing the tab.</li>
</ul>
<p>
<strong>Note:</strong>
This might not work all the time.
For instance, if your browser crashes, or if your computer stops unexpectedly or fails to resume after suspending, the URL will not be updated.
If you want to be sure to avoid losing your place, you might want to use the previous option.
</p>
<li>
<label>
<input type="checkbox" name="smoothScrolling"><strong>Smooth scrolling</strong>
</label>
<p>
When navigating moving from an item to another, the viewport is automatically scrolled to make the item visible.
Smooth scrolling can help get a better understanding of where the viewport was scrolled to, but can cause dizziness.
</p>
<ul>
<li>With this option <strong>enabled</strong>, you will briefly see the page move.</li>
<li>With this option <strong>disabled</strong>, the view will jump immediately to the item, with no transition.</li>
</ul>
<p>
<strong>Note:</strong>
Smooth scrolling will only work if it is also globally enabled in your browser.
</p>
<p>
<strong>Note:</strong>
Smooth scrolling in Chrome behaves incoherently when the target is updated often.
This can cause an unexpected behavior when navigating quickly, e.g. pressing and holding <kbd>j</kbd>.
</p>
</li>
<li>
<label>
<input type="checkbox" name="persistentCollapse"><strong>Persistent collapsed threads</strong>
</label>
<p>
When collapsing or uncollapsing comment threads, the effect is performed locally immediately.
However, when logged in, a request is also sent to Hacker News.
This allows Hacker News to persist the state of threads you have collapsed when reloading the page.
</p>
<ul>
<li>With this option <strong>enabled</strong>, the threads you have collapsed will stay collapsed when visiting the page again.</li>
<li>With this option <strong>disabled</strong>, you will still be able to collapse threads when navigating the page, but not be kept when reloading the page.</li>
</ul>
<p>
<strong>Note:</strong>
Hacker News only remembers collapsed threads for a while. This extensions does not attempt to keep them longer.
</p>
</li>
<li>
<label>
<input type="checkbox" name="newestItems"><strong>“Newest Items” aside</strong>
</label>
<p>
ViHN adds an aside to quickly navigate the comments or stories depending on their age.
However, you might not be using this, or that feature might cause visual clutter, or even performance issues.
If the aside does not look right, or if it causes performance issues, this is a bug;
please <a href="https://github.com/qsantos/ViHN/issues/new/choose">report it</a> with your browser/screen resolution so that we can fix it.
</p>
<ul>
<li>With this option <strong>enabled</strong>, “Newest Items” will be shown towards the left of the screen if there is room, or overlaid when hitting <kbd>n</kbd>.</li>
<li>With this option <strong>disabled</strong>, “Newest Items” will never be shown.</li>
</ul>
</li>
</ul>
</body>
<script src="get-option.js"></script>
<script src="options.js"></script>
</html>