public class URL extends HtmlUnitScriptable
URL
.org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
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) |
void |
setHost(String host) |
void |
setHostname(String hostname) |
void |
setHref(String href) |
void |
setPassword(String password) |
void |
setPathname(String path) |
void |
setPort(String port) |
void |
setProtocol(String protocol) |
void |
setSearch(List<NameValuePair> nameValuePairs) |
void |
setSearch(String search) |
void |
setUsername(String username) |
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, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, 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, 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, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
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
MalformedURLException
public String getHost()
public void setHost(String host) throws MalformedURLException
MalformedURLException
public String getHostname()
public void setHostname(String hostname) throws MalformedURLException
MalformedURLException
public String getHref()
public void setHref(String href) throws MalformedURLException
MalformedURLException
public Object getOrigin()
public URLSearchParams getSearchParams()
public String getPassword()
public void setPassword(String password) throws MalformedURLException
MalformedURLException
public String getPathname()
public void setPathname(String path) throws MalformedURLException
MalformedURLException
public String getPort()
public void setPort(String port) throws MalformedURLException
MalformedURLException
public String getProtocol()
public void setProtocol(String protocol) throws MalformedURLException
MalformedURLException
public String getSearch()
public void setSearch(String search) throws MalformedURLException
MalformedURLException
public void setSearch(List<NameValuePair> nameValuePairs) throws MalformedURLException
MalformedURLException
public String getUsername()
public void setUsername(String username) throws MalformedURLException
MalformedURLException
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–2024 Gargoyle Software Inc.. All rights reserved.