public class URL extends HtmlUnitScriptable
URL
.org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_FOUND
Constructor and Description |
---|
URL() |
Modifier and Type | Method and Description |
---|---|
static String |
createObjectURL(Object fileOrBlob)
The URL.createObjectURL() static method creates a DOMString containing a URL
representing the object given in parameter.
|
Object |
getDefaultValue(Class<?> hint)
Calls for instance for implicit conversion to string.
|
String |
getHash() |
String |
getHost() |
String |
getHostname() |
String |
getHref() |
Object |
getOrigin() |
String |
getPassword() |
String |
getPathname() |
String |
getPort() |
String |
getProtocol() |
String |
getSearch() |
URLSearchParams |
getSearchParams() |
String |
getUsername() |
void |
jsConstructor(String url,
Object base)
Creates an instance.
|
String |
jsToString()
Returns the text of the URL.
|
static void |
revokeObjectURL(org.htmlunit.corejs.javascript.Scriptable objectURL) |
void |
setHash(String fragment)
Sets the
hash property. |
void |
setHost(String host)
Sets the
host property. |
void |
setHostname(String hostname)
Sets the
hostname property. |
void |
setHref(String href)
Sets the
href property. |
void |
setPassword(String password)
Sets the
password property. |
void |
setPathname(String path)
Sets the
path property. |
void |
setPort(String port)
Sets the
port property. |
void |
setProtocol(String protocol)
Sets the
protocol property. |
void |
setSearch(List<NameValuePair> nameValuePairs)
Sets the
search property based on NameValuePair 's. |
void |
setSearch(String search)
Sets the
search property. |
void |
setUsername(String username)
Sets the
username property. |
String |
toJSON() |
clone, equivalentValues, get, getBrowserVersion, getClassName, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getWindow, getWindow, getWindowFromTopCallScope, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChangeForSlot, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
createSlotMap
public void jsConstructor(String url, Object base)
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 ''.public static String createObjectURL(Object fileOrBlob)
fileOrBlob
- Is a File object or a Blob object to create a object URL for.public static void revokeObjectURL(org.htmlunit.corejs.javascript.Scriptable objectURL)
objectURL
- String representing the object URL that was
created by calling URL.createObjectURL().public String getHash()
public void setHash(String fragment) throws MalformedURLException
hash
property.fragment
- the hash
propertyMalformedURLException
public String getHost()
public void setHost(String host) throws MalformedURLException
host
property.host
- the host
propertyMalformedURLException
public String getHostname()
public void setHostname(String hostname) throws MalformedURLException
hostname
property.hostname
- the hostname
propertyMalformedURLException
public String getHref()
public void setHref(String href) throws MalformedURLException
href
property.href
- the href
propertyMalformedURLException
public Object getOrigin()
public URLSearchParams getSearchParams()
public String getPassword()
public void setPassword(String password) throws MalformedURLException
password
property.password
- the password
propertyMalformedURLException
public String getPathname()
public void setPathname(String path) throws MalformedURLException
path
property.path
- the path
propertyMalformedURLException
public String getPort()
public void setPort(String port) throws MalformedURLException
port
property.port
- the port
propertyMalformedURLException
public String getProtocol()
public void setProtocol(String protocol) throws MalformedURLException
protocol
property.protocol
- the protocol
propertyMalformedURLException
public String getSearch()
public void setSearch(String search) throws MalformedURLException
search
property.search
- the search
propertyMalformedURLException
public void setSearch(List<NameValuePair> nameValuePairs) throws MalformedURLException
search
property based on NameValuePair
's.nameValuePairs
- the pairsMalformedURLException
- in case of errorpublic String getUsername()
public void setUsername(String username) throws MalformedURLException
username
property.username
- the username
propertyMalformedURLException
public Object getDefaultValue(Class<?> hint)
getDefaultValue
in interface org.htmlunit.corejs.javascript.Scriptable
getDefaultValue
in class HtmlUnitScriptable
hint
- the type hintHtmlUnitScriptable.getDefaultValue(java.lang.Class)
public String toJSON()
public String jsToString()
Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.