Skip to content

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

367 B
Raw Blame
import { withBasePath } from "@editor/constants/app";

/** The address setup offers for the server: this page's origin, or empty when
 *  the page isn't served over http(s). */
export function setupAddressPrefill(): string {
  if (!/^https?:$/.test(window.location.protocol)) return "";
  return `${window.location.origin}${withBasePath("/")}`.replace(/\/+$/, "");
}