Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

2.8 KB
Raw Blame
<!doctype html>
<html lang="en-US">
  <head>
    <meta charset="UTF-8" />
    <base href="%BASE_URL%" />
    <link rel="icon" href="modern-logo/favicon.ico" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, viewport-fit=cover"
    />
    <meta name="theme-color" content="#000000" />
    <meta
      name="description"
      content="A free, private PDF editor you can run on any infrastructure."
    />
    <link rel="apple-touch-icon" href="modern-logo/logo192.png" />
    <link rel="manifest" href="manifest.json" />
    <!-- en-US ships on every boot as primary language or fallback; preload it
      so the download runs with the JS instead of after. Relative so <base>
      keeps it right on subpath deploys, matching the i18next loadPath. -->
    <link
      rel="preload"
      href="locales/en-US/translation.toml"
      as="fetch"
      crossorigin
    />
    <!-- Returning visitors may run another language (stored pick at boot).
      Preload that file too; identical URLs dedupe to one fetch. -->
    <script>
      (function () {
        try {
          var lng = localStorage.getItem("i18nextLng");
          if (!lng || lng === "en-US" || !/^[A-Za-z-]{2,12}$/.test(lng)) return;
          var link = document.createElement("link");
          link.rel = "preload";
          link.as = "fetch";
          link.crossOrigin = "anonymous";
          link.href =
            "locales/" + encodeURIComponent(lng) + "/translation.toml";
          document.head.appendChild(link);
        } catch (e) {
          /* storage blocked: static en-US preload above still applies */
        }
      })();
    </script>

    <title>Stirling PDF - 30M+ Downloads</title>

    <!-- Apply theme before first paint (no FOUC); mirrors ThemeProvider, which then refines it. -->
    <script>
      (function () {
        try {
          var p = JSON.parse(
            localStorage.getItem("stirlingpdf_preferences") || "{}",
          );
          var mode = p.theme || "system";
          var scheme =
            mode === "light"
              ? "light"
              : mode === "dark"
                ? "dark"
                : window.matchMedia &&
                    window.matchMedia("(prefers-color-scheme: dark)").matches
                  ? "dark"
                  : "light";
          var r = document.documentElement;
          r.setAttribute("data-theme", scheme);
          r.setAttribute("data-app-theme", "custom");
          r.setAttribute("data-accent", "default");
          r.setAttribute("data-mantine-color-scheme", scheme);
        } catch (e) {
          /* first visit / unavailable storage: ThemeProvider handles it */
        }
      })();
    </script>
  </head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
    <script type="module" src="src/index.tsx"></script>
  </body>
</html>