mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
KefinTweaks 1.0 Initial Release
This commit is contained in:
1 parent
76d29b6de9
commit
c74d7fb10c
45 files changed
+16374
-795
No files matched your search
@@ -26,18 +26,25 @@
|
||||
|
||||
LOG('Script loaded - JS Injector mode');
|
||||
|
||||
// Get configuration from global config
|
||||
const config = window.KefinTweaksConfig?.exclusiveElsewhere || {
|
||||
hideServerName: false // Default fallback
|
||||
};
|
||||
|
||||
const observer = new MutationObserver(() => {
|
||||
const elsewhereContainer = document.querySelector('.itemDetailPage:not(.hide) .streaming-lookup-container>div');
|
||||
if (elsewhereContainer && elsewhereContainer.children && elsewhereContainer.children.length > 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
const serverName = config.hideServerName ? '' : ApiClient.serverName();
|
||||
|
||||
const link = document.querySelector('.itemDetailPage:not(.hide) .streaming-lookup-container>div>div:first-child a');
|
||||
if (link && !link.classList.contains('exclusive')) {
|
||||
LOG('Modifying elsewhere link to show exclusive branding');
|
||||
link.innerHTML = "Only available on Jellyfin";
|
||||
link.innerHTML = `Only available on ${serverName}`;
|
||||
link.classList.add("exclusive");
|
||||
link.title = "Jellyfin Exclusive";
|
||||
link.title = "Exclusive";
|
||||
link.disable = true;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user