CupThread React Native & Expo SDK - v0.1.0
    Preparing search index...

    Function openSafeLinkUrl

    • Sanitizes an untrusted URL against the shared http(s) allowlist and hands it to open only when it passes.

      Profile website links share the same allowlist as markdown links (see sanitizeSafeLinkUrl): remote tel:, sms:, intent:, and custom deep-link schemes never reach the platform URL opener.

      Parameters

      • url: string

        Raw URL string from untrusted content.

      • open: (safeUrl: string) => unknown

        Platform opener, e.g. (safe) => Linking.openURL(safe).catch(() => {}).

      Returns boolean

      true when the URL was safe and handed to open, false otherwise.

      openSafeLinkUrl('https://cupthread.com', (safe) => Linking.openURL(safe)); // opens
      openSafeLinkUrl('tel:+18005550199', (safe) => Linking.openURL(safe)); // no-op