JavaScript is disabled on your browser.
Skip navigation links
org.htmlunit.javascript.host

Class URL

    • Constructor Detail

      • URL

        public URL()
    • Method Detail

      • jsConstructor

        public void jsConstructor(String url,
         Object base)
        Creates an instance.
        Parameters:
        url - a string representing an absolute or relative URL. If url is a relative URL, base is required, and will be used as the base URL. If url is an absolute URL, a given base will be ignored.
        base - a string representing the base URL to use in case url is a relative URL. If not specified, it defaults to ''.
      • createObjectURL

        public static String createObjectURL(Object fileOrBlob)
        The URL.createObjectURL() static method creates a DOMString containing a URL representing the object given in parameter. The URL lifetime is tied to the document in the window on which it was created. The new object URL represents the specified File object or Blob object.
        Parameters:
        fileOrBlob - Is a File object or a Blob object to create a object URL for.
        Returns:
        the url
      • revokeObjectURL

        public static void revokeObjectURL(org.htmlunit.corejs.javascript.Scriptable objectURL)
        Parameters:
        objectURL - String representing the object URL that was created by calling URL.createObjectURL().
      • getHash

        public String getHash()
        Returns:
        hash property of the URL containing a '#' followed by the fragment identifier of the URL.
      • getHost

        public String getHost()
        Returns:
        the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', followed by the port of the URL.
      • getHostname

        public String getHostname()
        Returns:
        the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', followed by the port of the URL.
      • getHref

        public String getHref()
        Returns:
        whole URL
      • getOrigin

        public Object getOrigin()
        Returns:
        the origin
      • getSearchParams

        public URLSearchParams getSearchParams()
        Returns:
        a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL.
      • getPassword

        public String getPassword()
        Returns:
        the password specified before the domain name.
      • getPathname

        public String getPathname()
        Returns:
        a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL.
      • getPort

        public String getPort()
        Returns:
        the port number of the URL. If the URL does not contain an explicit port number, it will be set to ''
      • getProtocol

        public String getProtocol()
        Returns:
        the protocol scheme of the URL, including the final ':'.
      • getSearch

        public String getSearch()
        Returns:
        the query string containing a '?' followed by the parameters of the URL
      • getUsername

        public String getUsername()
        Returns:
        the username specified before the domain name.
      • toJSON

        public String toJSON()
        Returns:
        a serialized version of the URL, although in practice it seems to have the same effect as URL.toString().
      • jsToString

        public String jsToString()
        Returns the text of the URL.
        Returns:
        the text
Skip navigation links

Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /