From 969efd2af7f1dc46fb912bf01beb1899a51fcafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Fri, 28 Mar 2025 15:32:05 -0700 Subject: [PATCH] fix(ui): update share feature to correctly select title element and handle empty title --- internal/ui/static/js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/ui/static/js/app.js b/internal/ui/static/js/app.js index bb6b997a..cc818063 100644 --- a/internal/ui/static/js/app.js +++ b/internal/ui/static/js/app.js @@ -721,7 +721,7 @@ function isPlayerPlaying(element) { */ function handleShare() { const link = document.querySelector(':is(a, button)[data-share-status]'); - const title = document.querySelector("body > main > section > header > h1 > a"); + const title = document.querySelector(".entry-header > h1 > a"); if (link.dataset.shareStatus === "shared") { checkShareAPI(title, link.href); } @@ -746,7 +746,7 @@ function checkShareAPI(title, url) { } try { navigator.share({ - title: title, + title: title ? title.textContent : url, url: url }); } catch (err) {