Keep background apps alive, and notify from their unread count

The report was that a backgrounded site dies slowly and stops fetching.
It did, for three separate reasons, and the first two fixes each traded
one failure for another:

Hiding inactive views lets WebKit suspend them, so nothing is hidden any
more - every view keeps its size and stays in the window, and the active
one is ordered on top.

Telling a background page it was hidden then made Gmail throttle its own
syncing; its unread count sat unchanged for two and a half minutes. That
spoof is gone.

Neither was enough on its own: a background page keeps its timers but
loses the connection its updates arrive on, and WKWebView has no
equivalent of Electron's backgroundThrottling. Background apps are now
poked every 45s with the events a page uses to catch up after you return
to a tab - it fetches without losing a half-written reply.

Notifications now come from the unread count in the title rather than
the site's notification code, which Gmail will not run while it believes
you are looking at it. Measured: Gmail behind Odoo went 155 -> 157
untouched and raised "Gmail / 1 new".

Also adds a background-app probe to Settings, which is what turned this
from guesswork into measurement, and drops the nav's blocked-element
count and the hide-element button.
This commit is contained in:
2026-09-01 14:10:31 +02:00
parent 21a9f065f0
commit 8f989fb8f6
10 changed files with 343 additions and 65 deletions
+2 -1
View File
@@ -107,9 +107,10 @@ pub fn run() {
commands::notification_click,
commands::set_zoom,
commands::set_hidden,
commands::pick_hidden,
commands::test_notification,
commands::notification_status,
commands::probe_apps,
commands::app_reports,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");