From eb6d076d4cc44e4b7b13dc6cbe3b7e749585762b Mon Sep 17 00:00:00 2001 From: M0RPH3US Date: Wed, 12 Feb 2025 20:41:04 +0530 Subject: [PATCH] Update README.md Temporary Fix for Navigation --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 761e003..2e7e55c 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,43 @@ Here I present my version of the same with some code improvements, loading optim 2. Search for `` 3. Just before the ` + (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 + })(); +