Skip to main content

validateExternalUrl

FitFileViewer - API Documentation v29.8.0


FitFileViewer - API Documentation / main/security/externalUrlPolicy / validateExternalUrl

Function: validateExternalUrl()

validateExternalUrl(url: unknown): string

Defined in: main/security/externalUrlPolicy.js:23

Validate a URL intended for shell.openExternal.

Security properties:

  • Only allow http/https protocols.
  • Reject embedded credentials.
  • Reject non-string, empty, or malformed inputs.

Behavioral property:

  • Returns the caller-provided URL string trimmed, not canonicalized, to avoid surprise changes like appending a trailing slash.

Parameters​

url​

unknown

Returns​

string