export function isTrustedRendererDocument(raw: string, expectedRaw: string): boolean {
  try {
    const actual = new URL(raw);
    const expected = new URL(expectedRaw);
    if (actual.protocol !== "file:" || expected.protocol !== "file:") return false;
    if (actual.username || actual.password || actual.search) return false;
    actual.hash = "";
    expected.hash = "";
    return actual.toString() === expected.toString();
  } catch {
    return false;
  }
}
