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(auth): preserve incompatible-browser DOM element for Angular loadUser and restore native auth links (v1.4.25)
This commit is contained in:
@@ -1,26 +1,37 @@
|
|||||||
|
|
||||||
// 100% Incompatible Browser Suppression & Error Guardian
|
// 100% Incompatible Browser Suppression & Error Guardian
|
||||||
|
// CRITICAL: PeerTube's Angular app (my-app ngOnInit) relies on document.getElementById('incompatible-browser')
|
||||||
|
// to exist so it can do .className += " browser-ok" before calling this.loadUser()!
|
||||||
|
// Removing it from DOM causes a null pointer crash that breaks user session initialization!
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
try {
|
try {
|
||||||
window.displayIncompatibleBrowser = function () {};
|
window.displayIncompatibleBrowser = function () {};
|
||||||
var neuterIncompatible = function () {
|
var neuterIncompatible = function () {
|
||||||
var el = document.getElementById('incompatible-browser');
|
var el = document.getElementById('incompatible-browser');
|
||||||
if (el) {
|
if (el) {
|
||||||
el.classList.add('browser-ok');
|
if (!el.classList.contains('browser-ok')) {
|
||||||
|
el.classList.add('browser-ok');
|
||||||
|
}
|
||||||
el.style.setProperty('display', 'none', 'important');
|
el.style.setProperty('display', 'none', 'important');
|
||||||
if (el.parentNode) el.parentNode.removeChild(el);
|
el.style.setProperty('visibility', 'hidden', 'important');
|
||||||
|
el.style.setProperty('height', '0px', 'important');
|
||||||
|
el.style.setProperty('width', '0px', 'important');
|
||||||
|
el.style.setProperty('opacity', '0', 'important');
|
||||||
|
el.style.setProperty('pointer-events', 'none', 'important');
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
var dummy = document.createElement('div');
|
||||||
|
dummy.id = 'incompatible-browser';
|
||||||
|
dummy.className = 'browser-ok';
|
||||||
|
dummy.style.display = 'none';
|
||||||
|
(document.body || document.documentElement).appendChild(dummy);
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
neuterIncompatible();
|
neuterIncompatible();
|
||||||
if (document.readyState === 'loading') {
|
if (document.readyState === 'loading') {
|
||||||
document.addEventListener('DOMContentLoaded', neuterIncompatible);
|
document.addEventListener('DOMContentLoaded', neuterIncompatible);
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
var incompObserver = new MutationObserver(function () {
|
|
||||||
neuterIncompatible();
|
|
||||||
});
|
|
||||||
incompObserver.observe(document.documentElement || document.body, { childList: true, subtree: true });
|
|
||||||
} catch (e) {}
|
|
||||||
setInterval(neuterIncompatible, 1000);
|
setInterval(neuterIncompatible, 1000);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
@@ -365,10 +376,7 @@ try {
|
|||||||
var uEmail = localStorage.getItem('email');
|
var uEmail = localStorage.getItem('email');
|
||||||
var displayName = localStorage.getItem('displayName') || uName || '';
|
var displayName = localStorage.getItem('displayName') || uName || '';
|
||||||
var emailStr = uEmail || '';
|
var emailStr = uEmail || '';
|
||||||
var isAuth =
|
var isAuth = !!token && !!uName;
|
||||||
(!!token && !!uName) ||
|
|
||||||
(liveWidget && liveWidget.querySelector('yaknet-account[authenticated="true"]')) ||
|
|
||||||
!!document.querySelector('yaknet-account[authenticated="true"]');
|
|
||||||
|
|
||||||
if (headerRight) {
|
if (headerRight) {
|
||||||
var liveWidget = headerRight.querySelector('#yaknet-header-account-widget');
|
var liveWidget = headerRight.querySelector('#yaknet-header-account-widget');
|
||||||
@@ -581,10 +589,7 @@ try {
|
|||||||
// Check auth status for login button rendering
|
// Check auth status for login button rendering
|
||||||
var tokenVal = localStorage.getItem('access_token');
|
var tokenVal = localStorage.getItem('access_token');
|
||||||
var userVal = localStorage.getItem('username');
|
var userVal = localStorage.getItem('username');
|
||||||
var isAlreadyAuth =
|
var isAlreadyAuth = !!tokenVal && !!userVal;
|
||||||
(!!tokenVal && !!userVal) ||
|
|
||||||
document.body.classList.contains('yaktube-user-logged-in') ||
|
|
||||||
!!document.querySelector('yaknet-account[authenticated="true"]');
|
|
||||||
|
|
||||||
if (!isAlreadyAuth) {
|
if (!isAlreadyAuth) {
|
||||||
// Replace all login buttons labels and titles ONLY for guests
|
// Replace all login buttons labels and titles ONLY for guests
|
||||||
@@ -615,17 +620,6 @@ try {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
// Guarantee all login links are hidden when user is logged in
|
|
||||||
document
|
|
||||||
.querySelectorAll(
|
|
||||||
'my-login-link, a[href*="/login"], .login-button, [class*="login-link"]'
|
|
||||||
)
|
|
||||||
.forEach(function (el) {
|
|
||||||
el.style.setProperty('display', 'none', 'important');
|
|
||||||
el.setAttribute('aria-hidden', 'true');
|
|
||||||
el.setAttribute('tabindex', '-1');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Aggressively remove generic Framasoft Open-in-App / Play Store banners
|
// Aggressively remove generic Framasoft Open-in-App / Play Store banners
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "peertube-plugin-yaktube-ondemand",
|
"name": "peertube-plugin-yaktube-ondemand",
|
||||||
"version": "1.4.24",
|
"version": "1.4.25",
|
||||||
"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",
|
||||||
|
|||||||
@@ -24,27 +24,6 @@ button[title*='Dismiss'],
|
|||||||
clip: rect(0, 0, 0, 0) !important;
|
clip: rect(0, 0, 0, 0) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Permanent suppression of native login links when user is authenticated */
|
|
||||||
body.yaktube-user-logged-in my-login-link,
|
|
||||||
body.yaktube-user-logged-in a[href*="/login"],
|
|
||||||
body.yaktube-user-logged-in .login-button,
|
|
||||||
body.yaktube-user-logged-in [class*="login-link"],
|
|
||||||
body.yaktube-user-logged-in .peertube-button-link[href*="/login"],
|
|
||||||
body.yaktube-user-logged-in a[title*="Giriş"],
|
|
||||||
body.yaktube-user-logged-in a[aria-label*="Giriş"] {
|
|
||||||
display: none !important;
|
|
||||||
visibility: hidden !important;
|
|
||||||
height: 0 !important;
|
|
||||||
width: 0 !important;
|
|
||||||
margin: 0 !important;
|
|
||||||
padding: 0 !important;
|
|
||||||
pointer-events: none !important;
|
|
||||||
opacity: 0 !important;
|
|
||||||
position: absolute !important;
|
|
||||||
z-index: -99999 !important;
|
|
||||||
clip: rect(0, 0, 0, 0) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Permanent Aggressive Suppression of Generic JoinPeerTube / Framasoft Open-in-App Banners */
|
/* Permanent Aggressive Suppression of Generic JoinPeerTube / Framasoft Open-in-App Banners */
|
||||||
my-open-app,
|
my-open-app,
|
||||||
my-open-in-app,
|
my-open-in-app,
|
||||||
|
|||||||
Reference in New Issue
Block a user