@numiko/external-links
    Preparing search index...

    Class ExternalLinks

    Index

    Constructors

    • Parameters

      • links: NodeListOf<HTMLAnchorElement> | HTMLAnchorElement[] = []
      • options: {} = {}

      Returns ExternalLinks

    Properties

    links: NodeListOf<HTMLAnchorElement> | HTMLAnchorElement[]
    options: ExternalLinksOptions

    Methods

    • Add attributes to links links - The links to process

      Parameters

      • links: NodeListOf<HTMLAnchorElement> | HTMLAnchorElement[]

      Returns void

    • Test whether a link is external

      Parameters

      • link: HTMLAnchorElement

      Returns boolean

    • Test whether a URL matches a given domain url - The URL to test [domain=window.location.host] - The domain to match against. Defaults to the current host. trueif the URL's domain matches the given domain,false` otherwise

      Parameters

      • url: string
      • domain: string = window.location.host

      Returns boolean