nl_tokens: Create a function that can check a URL s origin against a list of allowed / whitelisted origins . The current location s origin is implicitly trusted .
pl_tokens: function urlIsAllowedOriginFactory ( whitelistedOriginUrls ) { var parsedAllowedOriginUrls = [ originUrl ] . concat ( whitelistedOriginUrls . <mask> ( urlResolve ) ) ; /**
     * Check whether the specified URL (string or parsed URL object) has an origin that is allowed
     * based on a list of whitelisted-origin URLs. The current location's origin is implicitly
     * trusted.
     *
     * @param {string|Object} requestUrl - The URL to be checked (provided as a string that will be
     *     resolved or a parsed URL object).
     *
     * @returns {boolean} - Whether the specified URL is of an allowed origin.
     */ return function urlIsAllowedOrigin ( requestUrl ) { var parsedUrl = urlResolve ( requestUrl ) ; return parsedAllowedOriginUrls . some ( urlsAreSameOrigin . bind ( null , parsedUrl ) ) ; } ; }