SecurityOrigin
Added in version 2.16.
- class SecurityOrigin(**kwargs)
- Constructors:
new(protocol:str, host:str, port:int) -> WebKit.SecurityOrigin
new_for_uri(uri:str) -> WebKit.SecurityOrigin
Constructors
- class SecurityOrigin
- classmethod new(protocol: str, host: str, port: int) SecurityOrigin
Create a new security origin from the provided protocol, host and port.
Added in version 2.16.
- Parameters:
protocol – The protocol for the new origin
host – The host for the new origin
port – The port number for the new origin, or 0 to indicate the default port for
protocol
- classmethod new_for_uri(uri: str) SecurityOrigin
Create a new security origin from the provided.
Create a new security origin from the provided URI. Components of
uri
other than protocol, host, and port do not affect the createdSecurityOrigin
.Added in version 2.16.
- Parameters:
uri – The URI for the new origin
Methods
- class SecurityOrigin
- get_host() str | None
Gets the hostname of
origin
.It is reasonable for this to be
None
if its protocol does not require a host component.Added in version 2.16.
- get_port() int
Gets the port of
origin
.This function will always return 0 if the port is the default port for the given protocol. For example, http://example.com has the same security origin as http://example.com:80, and this function will return 0 for a
SecurityOrigin
constructed from either URI.Added in version 2.16.