From 28d840636ca14eeadf93ced6efda527326759e52 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Tue, 3 Mar 2026 18:02:07 +0100 Subject: [PATCH] jellyfin: copy logo link to clipboard on mobile app with toast WebView doesn't allow opening external browser, so on mobile app the logo link copies URL to clipboard and shows a toast notification. --- static/other/jellyfin.css | 21 +++++++++++++++++++++ static/other/jellyfin.js | 15 +++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/static/other/jellyfin.css b/static/other/jellyfin.css index 5e7c7fc..75d7fb7 100644 --- a/static/other/jellyfin.css +++ b/static/other/jellyfin.css @@ -244,6 +244,27 @@ progress[value]::-moz-progress-bar { filter: brightness(0) saturate(100%) invert(61%) sepia(52%) saturate(212%) hue-rotate(169deg) brightness(92%) contrast(94%); } +/* Toast notification */ +.bocken-toast { + position: fixed; + bottom: 2rem; + left: 50%; + transform: translateX(-50%); + background: rgba(20, 20, 20, 0.9); + color: white; + padding: 0.6rem 1.2rem; + border-radius: 100px; + font-size: 0.85rem; + z-index: 9999; + border: 1px solid rgba(255, 255, 255, 0.1); + box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4); + opacity: 1; + transition: opacity 400ms; +} +.bocken-toast-hide { + opacity: 0; +} + /* ═══════════════════════════════════════════ VIDEO DETAIL PAGE ═══════════════════════════════════════════ */ diff --git a/static/other/jellyfin.js b/static/other/jellyfin.js index f0b8ef4..5468f68 100644 --- a/static/other/jellyfin.js +++ b/static/other/jellyfin.js @@ -143,10 +143,25 @@ if (!logo || logo.dataset.bockenLinked) return; logo.dataset.bockenLinked = '1'; + var isMobileApp = /wv\)|Jellyfin Mobile/.test(navigator.userAgent); + var link = document.createElement('a'); link.href = 'https://bocken.org'; link.className = 'bocken-logo-link'; link.title = 'bocken.org'; + if (isMobileApp) { + link.addEventListener('click', function (e) { + e.preventDefault(); + navigator.clipboard.writeText('https://bocken.org').then(function () { + var toast = document.createElement('div'); + toast.className = 'bocken-toast'; + toast.textContent = 'Link copied — open in browser'; + document.body.appendChild(toast); + setTimeout(function () { toast.classList.add('bocken-toast-hide'); }, 2000); + setTimeout(function () { toast.remove(); }, 2500); + }); + }); + } logo.parentNode.insertBefore(link, logo); link.appendChild(logo); }