mirror of
https://github.com/IAmParadox27/jellyfin-plugin-media-bar.git
synced 2026-11-13 00:54:00 +01:00
Update README.md
Temporary Fix for Navigation
This commit is contained in:
1 parent
8c55e30aad
commit
eb6d076d4c
1 file changed
+37
@@ -43,6 +43,43 @@ Here I present my version of the same with some code improvements, loading optim
|
||||
2. Search for `</body></html>`
|
||||
3. Just before the `</body`, plug the below code
|
||||
```
|
||||
<script>
|
||||
(function () {
|
||||
// List of CSS selectors for Home buttons
|
||||
const buttonSelectors = [
|
||||
".headerHomeButton.barsMenuButton",
|
||||
".css-17c09up",
|
||||
".mainDrawer-scrollContainer > a:nth-child(2)"
|
||||
];
|
||||
|
||||
// Polling interval to check for buttons
|
||||
const intervalId = setInterval(function () {
|
||||
buttonSelectors.forEach(selector => {
|
||||
// Try to find the button
|
||||
const homeButton = document.querySelector(selector);
|
||||
|
||||
// If the button is found
|
||||
if (homeButton) {
|
||||
// Attach the click event listener if not already added
|
||||
if (!homeButton.hasAttribute("data-home-handler")) {
|
||||
homeButton.addEventListener("click", function (event) {
|
||||
event.preventDefault(); // Prevent default behavior if necessary
|
||||
window.location.href = "/web/index.html#/home.html";
|
||||
});
|
||||
|
||||
// Mark the button as handled
|
||||
homeButton.setAttribute("data-home-handler", "true");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Stop polling if all buttons are found
|
||||
if (buttonSelectors.every(selector => document.querySelector(selector))) {
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
}, 100); // Check every 100ms
|
||||
})();
|
||||
</script>
|
||||
<link rel="preload" href="/web/avatars/slideshowpure.css" as="style" />
|
||||
<link rel="stylesheet" href="/web/avatars/slideshowpure.css" />
|
||||
<script defer src="/web/avatars/slideshowpure.js"></script>
|
||||
|
||||
Reference in new issue
Block a user