From 9ad6f12223c738eaff44294131d10a2a1fa02a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Yak=C4=B1=C5=9Ft=C4=B1r?= Date: Wed, 9 Sep 2026 07:06:23 +0300 Subject: [PATCH] fix(branding): lock APK download buttons strictly to official YakTube domain (v1.4.32) --- client.js | 23 +++++++++++++++++------ package.json | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/client.js b/client.js index 8f4114a..3abcedd 100644 --- a/client.js +++ b/client.js @@ -3481,7 +3481,7 @@ try { installBtn.id = 'yaktube-pwa-install-btn'; installBtn.className = 'yaktube-pwa-btn'; installBtn.setAttribute('type', 'button'); - installBtn.setAttribute('aria-label', 'YakTube Mobil Uygulamasını Yükle'); + installBtn.setAttribute('aria-label', getInstanceName() + ' Mobil Uygulamasını Yükle'); installBtn.style.cssText = 'background: linear-gradient(135deg, #ff8f37, #f97316); color: #000; border: none; padding: 6px 14px; border-radius: 20px; font-weight: 700; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; box-shadow: 0 4px 12px rgba(255,143,55,0.4);'; installBtn.innerHTML = '📲 Uygulamayı Yükle'; @@ -3492,7 +3492,7 @@ try { deferredInstallPrompt.userChoice.then(function (choiceResult) { if (choiceResult.outcome === 'accepted') { installBtn.remove(); - announce('YakTube uygulaması cihazınıza yükleniyor.'); + announce(getInstanceName() + ' uygulaması cihazınıza yükleniyor.'); } deferredInstallPrompt = null; }); @@ -3502,12 +3502,19 @@ try { headerButtons.prepend(installBtn); } - function isYakTubeInstance() { - return window.location.hostname.includes('yaktube.yakhub.com.tr') || getInstanceName() === 'YakTube'; + function isOfficialYakTubeServer() { + var host = (window.location.hostname || '').toLowerCase(); + // Sadece ve sadece resmi YakTube alan adında veya yerel test ortamında çalışsın + // Diğer PeerTube sunucularında yaktube.apk dosyası olmayacağı için ASLA gösterilmez + return host === 'yaktube.yakhub.com.tr' || host === '127.0.0.1' || host === 'localhost'; } function injectApkDownloadButton() { - if (!isYakTubeInstance()) return; + if (!isOfficialYakTubeServer()) { + var existBtnOther = document.getElementById('yaktube-apk-download-btn'); + if (existBtnOther) existBtnOther.remove(); + return; + } // 1. If inside APK: NEVER show APK button if (isInsideYakTubeApp) { var existBtnApp = document.getElementById('yaktube-apk-download-btn'); @@ -3552,7 +3559,11 @@ try { } function injectSidebarApkLink() { - if (!isYakTubeInstance()) return; + if (!isOfficialYakTubeServer()) { + var existLinkOther = document.getElementById('yaktube-sidebar-apk-link'); + if (existLinkOther) existLinkOther.remove(); + return; + } // If inside APK: NEVER show in sidebar if (isInsideYakTubeApp) { var existLink = document.getElementById('yaktube-sidebar-apk-link'); diff --git a/package.json b/package.json index 845b454..3afa476 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "peertube-plugin-yaktube-ondemand", - "version": "1.4.31", + "version": "1.4.32", "description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube", "main": "main.js", "library": "./main.js",