UrlPattern

Represents a URL pattern to intercept. Described in network.UrlPatternPattern https://w3c.github.io/webdriver-bidi/#type-network-UrlPattern

Constructor

new UrlPattern()

Methods

hostname(hostname) → {UrlPattern}

Sets the hostname for the URL pattern.

Parameters:
NameTypeDescription
hostnamestring

The hostname to set.

Returns:
  • Returns the updated instance of the URL pattern for chaining.
Type: 
UrlPattern

pathname(pathname) → {UrlPattern}

Sets the pathname for the URL pattern.

Parameters:
NameTypeDescription
pathnamestring

The pathname to set.

Returns:
  • Returns the updated instance of the URL pattern for chaining.
Type: 
UrlPattern

port(port) → {UrlPattern}

Sets the port for the URL pattern.

Parameters:
NameTypeDescription
portnumber

The port number to set.

Throws:
  • Throws an error if the port is not a number.
Type
Error
Returns:
  • Returns the updated instance of the URL pattern for chaining.
Type: 
UrlPattern

protocol(protocol) → {UrlPattern}

Sets the protocol for the URL pattern.

Parameters:
NameTypeDescription
protocolstring

The protocol to set.

Returns:
  • Returns the updated instance of the URL pattern for chaining.
Type: 
UrlPattern

Sets the search parameter in the URL pattern.

Parameters:
NameTypeDescription
searchstring

The search parameter to be set.

Returns:
  • Returns the updated instance of the URL pattern for chaining.
Type: 
UrlPattern