detached 29bdfb1

feat: add load-failed signal logging for content blocker debugging

Connect WebKit's load-failed signal to log when page loads fail,
including content blocker rejections. Error message details are
limited to the failing URI until bnema/puregotk#6 is resolved
(GError* exposed as raw uintptr in signal callbacks).
commit
29bdfb1e2911cbaa6d74c74fa3ef877e091a8bfa
author
brice · · 2026-03-27 06:30 UTC
parent
483aebe
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +16 -0
M internal/infrastructure/webkit/webview.go +16 -0
@@ -418,6 +418,7 @@ func (wv *WebView) connectSignals() {
418418 wv.connectURISignal()
419419 wv.connectFaviconSignal()
420420 wv.connectProgressSignal()
421+ wv.connectLoadFailedSignal()
421422 wv.connectDecidePolicySignal()
422423 wv.connectEnterFullscreenSignal()
423424 wv.connectLeaveFullscreenSignal()
@@ -464,6 +465,21 @@ func (wv *WebView) connectLoadChangedSignal() {
464465 wv.signalIDs = append(wv.signalIDs, uintptr(sigID))
465466 }
466467
468+func (wv *WebView) connectLoadFailedSignal() {
469+ loadFailedCb := func(_ webkit.WebView, event webkit.LoadEvent, failingURI string, _ uintptr) bool {
470+ // Note: error details are a raw uintptr (GError*) — see bnema/puregotk#6
471+ // for tracking proper *glib.Error conversion in signal callbacks.
472+ wv.logger.Warn().
473+ Str("component", "webview").
474+ Str("uri", failingURI).
475+ Int("load_event", int(event)).
476+ Msg("load failed")
477+ return false
478+ }
479+ sigID := wv.inner.ConnectLoadFailed(&loadFailedCb)
480+ wv.signalIDs = append(wv.signalIDs, uintptr(sigID))
481+}
482+
467483 func (wv *WebView) connectCloseSignal() {
468484 closeCb := func(_ webkit.WebView) {
469485 if wv.OnClose != nil {
@@ -418,6 +418,7 @@ func (wv *WebView) connectSignals() {
418 wv.connectURISignal()418 wv.connectURISignal()
419 wv.connectFaviconSignal()419 wv.connectFaviconSignal()
420 wv.connectProgressSignal()420 wv.connectProgressSignal()
421+ wv.connectLoadFailedSignal()
421 wv.connectDecidePolicySignal()422 wv.connectDecidePolicySignal()
422 wv.connectEnterFullscreenSignal()423 wv.connectEnterFullscreenSignal()
423 wv.connectLeaveFullscreenSignal()424 wv.connectLeaveFullscreenSignal()
@@ -464,6 +465,21 @@ func (wv *WebView) connectLoadChangedSignal() {
464 wv.signalIDs = append(wv.signalIDs, uintptr(sigID))465 wv.signalIDs = append(wv.signalIDs, uintptr(sigID))
465 }466 }
466 467
468+func (wv *WebView) connectLoadFailedSignal() {
469+ loadFailedCb := func(_ webkit.WebView, event webkit.LoadEvent, failingURI string, _ uintptr) bool {
470+ // Note: error details are a raw uintptr (GError*) — see bnema/puregotk#6
471+ // for tracking proper *glib.Error conversion in signal callbacks.
472+ wv.logger.Warn().
473+ Str("component", "webview").
474+ Str("uri", failingURI).
475+ Int("load_event", int(event)).
476+ Msg("load failed")
477+ return false
478+ }
479+ sigID := wv.inner.ConnectLoadFailed(&loadFailedCb)
480+ wv.signalIDs = append(wv.signalIDs, uintptr(sigID))
481+}
482+
467 func (wv *WebView) connectCloseSignal() {483 func (wv *WebView) connectCloseSignal() {
468 closeCb := func(_ webkit.WebView) {484 closeCb := func(_ webkit.WebView) {
469 if wv.OnClose != nil {485 if wv.OnClose != nil {

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