• Create a function that can check a URL's origin against a list of allowed/trusted origins. The current location's origin is implicitly trusted.

    Parameters

    • trustedOriginUrls: string[]

      A list of URLs (strings), whose origins are trusted.

    Returns Function

    • A function that receives a URL (string or parsed URL object) and returns whether it is of an allowed origin.