Something went wrong. Try again.
My blog
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930const delay = (ms) => new Promise((res) => setTimeout(res, ms));
function highlightElement(xpath, url) { url2 = url.replace("index.html", ""); if (!(window.location.pathname == url2)) { window.location.pathname = url2; console.info( `Returned Early: ${window.location.pathname} does not equal ${url2}`, ); return; } const node = document.evaluate( xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null, );
el = node.singleNodeValue; const prevBorder = el.style.border; const prevRadius = el.style.borderRadius; el.style.border = "solid red"; // el.style.borderRadius = "100%"; el.scrollIntoView({ behavior: "smooth", block: "center" }); // delay(5000); // el.style.border = prevBorder; // el.style.borderRadius = prevRadius;}