Skip to content

🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev

669 B
Raw Blame
(() => {
  const base = new URL(JSON.parse(document.getElementById("__config").textContent).base, location);
  if (!base.pathname.endsWith("/")) base.pathname += "/";
  const links = [...document.querySelectorAll(".md-select a[hreflang]")].map(link => [link, link.href]);
  const update = () => links.forEach(([link, root]) => {
    link.href = new URL(location.pathname.slice(base.pathname.length) + location.search + location.hash, root).href;
    link.target = "_self";
  });
  update();
  location$.subscribe(update);
  addEventListener("hashchange", update);
  for (const event of ["click", "auxclick", "contextmenu"]) addEventListener(event, update, true);
})();