From cabddc60908283b78f523a709b8a3a295d2b9fab Mon Sep 17 00:00:00 2001 From: Charlie Strauss Date: Mon, 31 Aug 2026 01:09:43 -0600 Subject: [PATCH] Inject nativeshell script at the profile level to fix first-load race On startup the WebEngineView first shows the bundled qrc find-webclient page and then navigates to the server web client. That cross-origin navigation moves the view to a new renderer process, and a user script registered on the view is not reliably delivered to it, so the first load of the web client comes up without window.NativeShell. jellyfin-web then falls back to its HTML video player: playback works, but the native mpv player, MPRIS, and client settings are silently unavailable until the page is reloaded. Registering the script on the profile instead makes injection apply to every load, including the first one. Verified on Linux (Qt 6.11.2, Wayland): before the change window.jmpInfo was undefined on every cold start until a reload; after it is present on the first load. --- src/ui/webview.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/webview.qml b/src/ui/webview.qml index e4ff05d..63458f5 100644 --- a/src/ui/webview.qml +++ b/src/ui/webview.qml @@ -275,7 +275,7 @@ Window worldId: WebEngineScript.MainWorld } - web.userScripts.collection = [ nativeshell ]; + web.profile.userScripts.collection = [ nativeshell ]; } onLoadingChanged: function(loadingInfo)