mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-07 00:44:49 +00:00
* feat(plugins): open external links and workspace browsers * fix(plugins): refuse invalid links and unavailable browser workspaces * docs(plugins): clarify external links and browser navigation
10 lines
277 B
TypeScript
10 lines
277 B
TypeScript
/** Shared allowlist for links passed to an OS opener or a workspace browser. */
|
|
export function isHttpUrl(url: string): boolean {
|
|
try {
|
|
const protocol = new URL(url).protocol;
|
|
return protocol === "http:" || protocol === "https:";
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|