Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
fix(a11y): domain-lock yaknet menu and suppress recursive self-links in yaknet-account
This commit is contained in:
@@ -151,6 +151,40 @@ try {
|
|||||||
document.head.appendChild(s);
|
document.head.appendChild(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Intercept and sanitize YakNet Account Web Component popup menu
|
||||||
|
function hookYakNetAccountComponent() {
|
||||||
|
if (typeof customElements === 'undefined') return;
|
||||||
|
customElements.whenDefined('yaknet-account').then(function () {
|
||||||
|
var YakNetAccount = customElements.get('yaknet-account');
|
||||||
|
if (!YakNetAccount || !YakNetAccount.prototype || YakNetAccount.prototype._yaktubeSanitizerHooked) return;
|
||||||
|
YakNetAccount.prototype._yaktubeSanitizerHooked = true;
|
||||||
|
var originalRender = YakNetAccount.prototype.render;
|
||||||
|
if (typeof originalRender === 'function') {
|
||||||
|
YakNetAccount.prototype.render = function () {
|
||||||
|
originalRender.call(this);
|
||||||
|
try {
|
||||||
|
if (this.shadowRoot) {
|
||||||
|
var isOfficial = isOfficialYakTubeServer();
|
||||||
|
// 1. In YakTube: Suppress redundant/recursive link to YakTube inside services list
|
||||||
|
var selfLinks = this.shadowRoot.querySelectorAll('a[href*="yaktube.yakhub.com.tr"]');
|
||||||
|
selfLinks.forEach(function (a) {
|
||||||
|
a.style.display = 'none';
|
||||||
|
});
|
||||||
|
// 2. In third-party PeerTube instances: Suppress entire external services grid & header to avoid community backlash
|
||||||
|
if (!isOfficial) {
|
||||||
|
var appsGrid = this.shadowRoot.querySelector('.yn-apps-grid');
|
||||||
|
if (appsGrid) appsGrid.style.display = 'none';
|
||||||
|
var sectionTitle = this.shadowRoot.querySelector('#yn-services-label, .yn-section-title');
|
||||||
|
if (sectionTitle) sectionTitle.style.display = 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}).catch(function () {});
|
||||||
|
}
|
||||||
|
hookYakNetAccountComponent();
|
||||||
|
|
||||||
// Silent background SSO Probe Engine
|
// Silent background SSO Probe Engine
|
||||||
function initSilentSSOProbe() {
|
function initSilentSSOProbe() {
|
||||||
var token = localStorage.getItem('access_token');
|
var token = localStorage.getItem('access_token');
|
||||||
@@ -440,7 +474,7 @@ try {
|
|||||||
btn.setAttribute('tabindex', '-1');
|
btn.setAttribute('tabindex', '-1');
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!liveWidget) {
|
if (!liveWidget && isOfficialYakTubeServer()) {
|
||||||
var widgetWrap = document.createElement('div');
|
var widgetWrap = document.createElement('div');
|
||||||
widgetWrap.id = 'yaknet-header-account-widget';
|
widgetWrap.id = 'yaknet-header-account-widget';
|
||||||
widgetWrap.className = 'yaknet-header-widget';
|
widgetWrap.className = 'yaknet-header-widget';
|
||||||
@@ -476,35 +510,45 @@ try {
|
|||||||
} else {
|
} else {
|
||||||
headerRight.prepend(widgetWrap);
|
headerRight.prepend(widgetWrap);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (liveWidget) {
|
||||||
var el = liveWidget.querySelector('yaknet-account');
|
if (!isOfficialYakTubeServer()) {
|
||||||
if (el) {
|
liveWidget.remove();
|
||||||
if (el.getAttribute('authenticated') !== 'true' || el.getAttribute('user-name') !== displayName) {
|
} else {
|
||||||
el.setAttribute('authenticated', 'true');
|
var el = liveWidget.querySelector('yaknet-account');
|
||||||
el.setAttribute('user-name', displayName);
|
if (el) {
|
||||||
el.setAttribute('user-email', emailStr);
|
if (el.getAttribute('authenticated') !== 'true' || el.getAttribute('user-name') !== displayName) {
|
||||||
if (typeof el.syncStateFromAttributes === 'function') {
|
el.setAttribute('authenticated', 'true');
|
||||||
el.syncStateFromAttributes();
|
el.setAttribute('user-name', displayName);
|
||||||
el.render();
|
el.setAttribute('user-email', emailStr);
|
||||||
|
if (typeof el.syncStateFromAttributes === 'function') {
|
||||||
|
el.syncStateFromAttributes();
|
||||||
|
el.render();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (el.shadowRoot) {
|
if (el.shadowRoot) {
|
||||||
var shadowLogoutBtn =
|
// Direct DOM safety: remove self-link on polling cycle too
|
||||||
el.shadowRoot.getElementById('logoutBtn') ||
|
var selfLinks = el.shadowRoot.querySelectorAll('a[href*="yaktube.yakhub.com.tr"]');
|
||||||
el.shadowRoot.querySelector('.yn-logout-btn') ||
|
selfLinks.forEach(function (a) {
|
||||||
el.shadowRoot.querySelector('button[title*="Çıkış"], button[aria-label*="Çıkış"]');
|
a.style.display = 'none';
|
||||||
if (shadowLogoutBtn && !shadowLogoutBtn.hasAttribute('data-yaktube-hooked')) {
|
});
|
||||||
shadowLogoutBtn.setAttribute('data-yaktube-hooked', 'true');
|
|
||||||
shadowLogoutBtn.addEventListener(
|
var shadowLogoutBtn =
|
||||||
'click',
|
el.shadowRoot.getElementById('logoutBtn') ||
|
||||||
function (ev) {
|
el.shadowRoot.querySelector('.yn-logout-btn') ||
|
||||||
ev.preventDefault();
|
el.shadowRoot.querySelector('button[title*="Çıkış"], button[aria-label*="Çıkış"]');
|
||||||
ev.stopPropagation();
|
if (shadowLogoutBtn && !shadowLogoutBtn.hasAttribute('data-yaktube-hooked')) {
|
||||||
performUnifiedLogout();
|
shadowLogoutBtn.setAttribute('data-yaktube-hooked', 'true');
|
||||||
},
|
shadowLogoutBtn.addEventListener(
|
||||||
true
|
'click',
|
||||||
);
|
function (ev) {
|
||||||
|
ev.preventDefault();
|
||||||
|
ev.stopPropagation();
|
||||||
|
performUnifiedLogout();
|
||||||
|
},
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "peertube-plugin-yaktube-ondemand",
|
"name": "peertube-plugin-yaktube-ondemand",
|
||||||
"version": "1.4.32",
|
"version": "1.4.33",
|
||||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"library": "./main.js",
|
"library": "./main.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user