detached a4081db

feat(webkit): add DNS prefetch capability to speed up future requests

commit
a4081db448c9ea0248f2ea90a09f3bd0757eceea
author
bnema · · 2025-10-23 22:06 UTC
committer
bnema · · 2025-10-24 17:33 UTC
parent
76e6e0a
signature
GPG Unverified2B82207D370127A0 The key is unknown
1 file · +13 -0
M pkg/webkit/network_session.go +13 -0
@@ -102,3 +102,16 @@ func InitPersistentSession(dataDir, cacheDir string) error {
102102 func GetGlobalNetworkSession() *webkit.NetworkSession {
103103 return globalNetworkSession
104104 }
105+
106+// PrefetchDNS prefetches DNS for the given hostname to speed up future requests.
107+// This is useful for preloading DNS for links that the user might click.
108+// Safe to call even if the hostname is invalid or session is not initialized.
109+func PrefetchDNS(hostname string) {
110+ if globalNetworkSession == nil {
111+ return // Session not initialized yet
112+ }
113+ if hostname == "" {
114+ return // Nothing to prefetch
115+ }
116+ globalNetworkSession.PrefetchDns(hostname)
117+}
@@ -102,3 +102,16 @@ func InitPersistentSession(dataDir, cacheDir string) error {
102 func GetGlobalNetworkSession() *webkit.NetworkSession {102 func GetGlobalNetworkSession() *webkit.NetworkSession {
103 return globalNetworkSession103 return globalNetworkSession
104 }104 }
105+
106+// PrefetchDNS prefetches DNS for the given hostname to speed up future requests.
107+// This is useful for preloading DNS for links that the user might click.
108+// Safe to call even if the hostname is invalid or session is not initialized.
109+func PrefetchDNS(hostname string) {
110+ if globalNetworkSession == nil {
111+ return // Session not initialized yet
112+ }
113+ if hostname == "" {
114+ return // Nothing to prefetch
115+ }
116+ globalNetworkSession.PrefetchDns(hostname)
117+}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close