# desktop/navigation.ts · screen/aggregate-mail

[View on GitCafe](https://git.cafe/screen/aggregate-mail/blob/5078cd8c96d227268394288e3eb4d4b97c1e815d/desktop/navigation.ts)

Repository: [screen/aggregate-mail](https://git.cafe/screen/aggregate-mail)

Visibility: public

Requested revision: 5078cd8c96d227268394288e3eb4d4b97c1e815d

Requested commit: 5078cd8c96d227268394288e3eb4d4b97c1e815d

Commit: 5078cd8c96d227268394288e3eb4d4b97c1e815d

Blob: 2fe7fcd0c5a5a623e817ad7fbc4072d25447ed85

Size: 498 bytes

[Immutable source](https://git.cafe/screen/aggregate-mail/blob/5078cd8c96d227268394288e3eb4d4b97c1e815d/desktop/navigation.ts?format=markdown)

```
export function isLocalNavigation(url: string, origin: string) {
  try {
    const parsed = new URL(url);
    return parsed.origin === origin && parsed.pathname === "/";
  } catch {
    return false;
  }
}
export function isExternalLink(url: string, origin: string) {
  try {
    const parsed = new URL(url);
    return parsed.origin === origin
      ? parsed.pathname === "/api/oauth/google"
      : parsed.protocol === "https:" || parsed.protocol === "http:";
  } catch {
    return false;
  }
}

```
