Search completed in 1.24 seconds.
USVString - Web APIs
Candidate Recommendation Initial definition. ...
... Candidate Recommendation Initial definition. ...
... Candidate Recommendation Initial definition. ...
...And 2 more matches
Index - Web APIs
The json() method of the Body mixin takes a Response stream and reads it to completion. It returns a promise that resolves with the result of parsing the body text as JSON. 361 Body.text() API, BODY, Experimental, Fetch, Method, Reference, Text The text() method of the Body mixin takes a Response stream and reads it to completion. It returns a promise that resolves with a
USVString object (text). The response is always decoded using UTF-8. 362 Broadcast Channel API API, Broadcast Channel API, HTML API, Overview, Reference The Broadcast Channel API allows simple communication between browsing contexts (that is windows, tabs, frames, or iframes) with the same origin (usually pages from the same site). 363 BroadcastChannel API, Broadcast Cha...
...umericValue, Experimental, Houdini, Property, Reference, Type The type() method of the CSSNumericValue interface returns the type of CSSNumericValue, one of angle, flex, frequency, length, resolution, percent, percentHint, or time. 433 CSSOMString API, CSSOM, Reference CSSOMString is used to denote string data in CSSOM specifications and can refer to either DOMString or
USVString. When a specification says CSSOMString, it depends on the browser vendors to choose whether to use DOMString or
USVString. While browser implementations that use UTF-8 internally to represent strings in memory can use
USVString when the specification says CSSOMString, implementations that already represent strings as 16-bit sequences might choose to use DOMString instead. 434 CSSPageRu...
...CSSUnitValue object which returns a new CSSUnitValue object which represents values that contain a single unit type. For example, "42px" would be represented by a CSSNumericValue. 483 CSSUnitValue.unit API, CSS Typed Object Model API, CSSUnitValue, Experimental, Houdini, Property, Reference, unit The CSSUnitValue.unit read-only property of the CSSUnitValue interface returns a
USVString indicating the type of unit. 484 CSSUnitValue.value API, CSS Typed Object Model API, CSSUnitValue, Experimental, Houdini, Property, Reference, value The CSSUnitValue.value property of the CSSUnitValue interface returns a double indicating the number of units. 485 CSSUnparsedValue API, CSS Typed Object Model API, CSSUnparsedValue, Experimental, Houdini, Interfac...
...And 41 more matches
HTMLAnchorElement - Web APIs
ring representing a single character that switches input focus to the hyperlink. HTMLAnchorElement.download Is a DOMString indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, browser will adapt it. ...
...source is intended to be downloaded rather than displayed in the browser. The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, browser will adapt it. HTMLHyperlinkElementUtils.hash Is a
USVString representing the fragment identifier, including the leading hash mark ('#'), if any, in the referenced URL. HTMLHyperlinkElementUtils.host Is a
USVString representing the hostname and port (if it's not the default port) in the referenced URL. HTMLHyperlinkElementUtils.hostname Is a
USVString representing the hostname in the referenced URL. HTMLHyperlinkElementUtils.href Is a
USVString that is the result of parsing the href HTML attribute relative to the document, containing a valid URL of a linked resource. HTMLAnchorElement.hreflang Is a DO...
... HTML attribute relative to the document, containing a valid URL of a linked resource. HTMLAnchorElement.hreflang Is a DOMString that reflects the hreflang HTML attribute, indicating the language of the linked resource. HTMLAnchorElement.media Is a DOMString that reflects the media HTML attribute, indicating the intended media for the linked resource. ...
...And 5 more matches
HTMLAreaElement - Web APIs
s the coords HTML attribute, containing coordinates to define the hot-spot region. HTMLAreaElement.download Is a DOMString indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, browser will adapt it. ...
... resource is intended to be downloaded rather than displayed in the browser. The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, browser will adapt it. HTMLHyperlinkElementUtils.hash Is a
USVString containing the fragment identifier (including the leading hash mark (#)), if any, in the referenced URL. HTMLHyperlinkElementUtils.host Is a
USVString containing the hostname and port (if it's not the default port) in the referenced URL. HTMLHyperlinkElementUtils.hostname Is a
USVString containing the hostname in the referenced URL. HTMLHyperlinkElementUtils.href Is a
USVString containing that reflects the href HTML attribute, containing a valid URL of a linked resource. HTMLAreaElement.hreflang Is a DOMString containing that reflects the...
...a DOMString containing that reflects the hreflang HTML attribute, indicating the language of the linked resource. HTMLAreaElement.media Is a DOMString containing that reflects the media HTML attribute, indicating target media of the linked resource. HTMLAreaElement.noHref Is a Boolean flag indicating if the area is inactive (true) or active (false). ...
...And 4 more matches
URL - Web APIs
can access a URL object using the Window interface's Window.URL property. Be sure to check to see if any of your target browsers require this to be prefixed. Note: This feature is available in Web Workers. Constructor new URL() Creates and returns a URL object referencing the URL specified using an absolute URL string, or a relative URL string and a base URL string. ...
...o check to see if any of your target browsers require this to be prefixed. Note: This feature is available in Web Workers. Constructor new URL() Creates and returns a URL object referencing the URL specified using an absolute URL string, or a relative URL string and a base URL string. Properties hash A
USVString containing a '#' followed by the fragment identifier of the URL. ...
... new URL() Creates and returns a URL object referencing the URL specified using an absolute URL string, or a relative URL string and a base URL string. Properties hash A
USVString containing a '#' followed by the fragment identifier of the URL. host A
USVString containing the domain (that is the hostname) followed by (if a port was specified) a ':' and the port of the URL. hostname A
USVString containing the domain of the URL. href A stringifier that returns a
USVString containing the whole URL. origin Read only Returns a
USVString containing the origin of the URL, that is its scheme, its domain and its port. password A
USVString containing the password specified before the domain name. pathname A
USVString containing an initial '/' followed by the path of the URL. port A US...
...And 3 more matches
CredentialsContainer.create() - Web APIs
Syntax var promise = CredentialsContainer.create([options]) Parameters options An object of type CredentialCreationOptions that contains options for the requested new Credentials object. It must include one of the options "password", "federated", or "publicKey". The options are: password: Optional Either an HTMLFormElement, or a PasswordCredentialData object. ...
...) Parameters options An object of type CredentialCreationOptions that contains options for the requested new Credentials object. It must include one of the options "password", "federated", or "publicKey". The options are: password: Optional Either an HTMLFormElement, or a PasswordCredentialData object. TBD id: (required)
USVString Inherited from CredentialData. ...
...of type CredentialCreationOptions that contains options for the requested new Credentials object. It must include one of the options "password", "federated", or "publicKey". The options are: password: Optional Either an HTMLFormElement, or a PasswordCredentialData object. TBD id: (required)
USVString Inherited from CredentialData. ...
...And 2 more matches
HTMLHyperlinkElementUtils - Web APIs
ty methods and properties to work with HTMLAnchorElement and HTMLAreaElement. These utilities allow to deal with common features like URLs. There are no objects of this type, but several objects such as HTMLAnchorElement and HTMLAreaElement implement it. Properties Note: This interface doesn't inherit any property. ...
...n features like URLs. There are no objects of this type, but several objects such as HTMLAnchorElement and HTMLAreaElement implement it. Properties Note: This interface doesn't inherit any property. HTMLHyperlinkElementUtils.href This a stringifier property that returns a
USVString containing the whole URL, and allows the href to be updated. HTMLHyperlinkElementUtils.protocol This is a
USVString containing the protocol scheme of the URL, including the final ':'. HTMLHyperlinkElementUtils.host This is a
USVString containing the host, that is the hostname, and then, if the port of the URL is not empty (which can happen because it was not specified or because it was specified to be the default port of the URL's scheme), a ':', and the port of the URL. HTMLHyperlinkElementUtils.hostname ...
...g the protocol scheme of the URL, including the final ':'. HTMLHyperlinkElementUtils.host This is a
USVString containing the host, that is the hostname, and then, if the port of the URL is not empty (which can happen because it was not specified or because it was specified to be the default port of the URL's scheme), a ':', and the port of the URL. HTMLHyperlinkElementUtils.hostname This is a
USVString containing the domain of the URL. HTMLHyperlinkElementUtils.port This is a
USVString containing the port number of the URL. HTMLHyperlinkElementUtils.pathname This is a
USVString containing an initial '/' followed by the path of the URL. HTMLHyperlinkElementUtils.search This is a
USVString containing a '?' followed by the parameters of the URL. HTMLHyperlinkElementUtils.hash This is a USV...
...And 2 more matches
Location - Web APIs
{ node.addEventListener("click", function(e) { e.preventDefault(); e.stopPropagation(); window.location.hash = ''; }); }); Result Properties Location.ancestorOrigins Is a static DOMStringList containing, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given Location object. Location.href Is a stringifier that returns a
USVString containing the entire URL. If changed, the associated document navigates to the new page. It can be set from a different origin than the associated document. Location.protocol Is a
USVString containing the protocol scheme of the URL, including the final ':'. Location.host Is a
USVString containing the host, that is the hostname, a ':', and the port of the URL. Location.hostname Is a USVStri...
...ument navigates to the new page. It can be set from a different origin than the associated document. Location.protocol Is a
USVString containing the protocol scheme of the URL, including the final ':'. Location.host Is a
USVString containing the host, that is the hostname, a ':', and the port of the URL. Location.hostname Is a
USVString containing the domain of the URL. Location.port Is a
USVString containing the port number of the URL. Location.pathname Is a
USVString containing an initial '/' followed by the path of the URL. Location.search Is a
USVString containing a '?' followed by the parameters or "querystring" of the URL. ...
... Methods Location.assign() Loads the resource at the URL provided in parameter. Location.reload() Reloads the current URL, like the Refresh button. ...
...And 2 more matches
WebIDL bindings
They will be in the compartment of the passed-in JSContext. any return values become a JS::MutableHandle<JS::Value> out param appended to the argument lis...
... It is reflected in three different ways, depending o...
... It is reflected in three different ways, depending on use: A...
...Attr(const nsAString& value); void MyMethod(const Sequence<nsString>& arg1, const nsAString& arg2, const Optional<nsAString>& arg3, nsString& retval, ErrorResult& rv);
USVString USVString is reflected just like DOMString. UTF8String UTF8String is a string with guaranteed-valid UTF-8 contents. It is not an standard in the WebIDL spec, but its observables are the same as those of
USVString. It is a good fit for when the specification allows a
USVString, but you want to process the string as UTF-8 rather than UTF-16. It is reflected in three different ways, depending on use: Arguments become const nsACString&. Return values become an nsACString& out param appended to the argument list. This comes after all IDL arguments, but before the ErrorResult&, if any, for the method. In...
SecurityPolicyViolationEvent - Web APIs
The SecurityPolicyViolationEvent interface inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated. Constructor SecurityPolicyViolationEvent() Creates a new SecurityPolicyViolationEvent object instance. Properties SecurityPolicyViolationEvent.blockedURIRead only A
USVString representing the URI of the resource that was blocked because it violates a policy. SecurityPolicyViolationEvent.columnNumberRead only The column number in the document or worker at which the violation occurred. SecurityPolicyViolationEvent.dispositionRead only Indicates how the violated policy is configured to be treated by the user agent. This will be "enforce" or "report". SecurityPolicyViolationEvent.documentURIRead only ...
...t was blocked because it violates a policy. SecurityPolicyViolationEvent.columnNumberRead only The column number in the document or worker at which the violation occurred. SecurityPolicyViolationEvent.dispositionRead only Indicates how the violated policy is configured to be treated by the user agent. This will be "enforce" or "report". SecurityPolicyViolationEvent.documentURIRead only A
USVString representing the URI of the document or worker in which the violation was found. SecurityPolicyViolationEvent.effectiveDirectiveRead only A DOMString representing the directive whose enforcement uncovered the violation. SecurityPolicyViolationEvent.lineNumberRead only The line number in the document or worker at which the violation occurred. SecurityPolicyViolationEvent.originalPolicyRead ...
...nly A DOMString representing the directive whose enforcement uncovered the violation. SecurityPolicyViolationEvent.lineNumberRead only The line number in the document or worker at which the violation occurred. SecurityPolicyViolationEvent.originalPolicyRead only A DOMString containing the policy whose enforcement uncovered the violation. SecurityPolicyViolationEvent.referrerRead only A
USVString representing the referrer of the resources whose policy was violated. This will be a URL or null. SecurityPolicyViolationEvent.sampleRead only A DOMString representing a sample of the resource that caused the violation, usually the first 40 characters. This will only be populated if the resource is an inline script, event handler, or style -- external resources causing a violation will not gen...
... This will be a URL or null. SecurityPolicyViolationEvent.sampleRead only A DOMString representing a sample of the resource that caused the violation, usually the first 40 characters. This will only be populated if the resource is an inline script, event handler, or style -- external resources causing a violation will not generate a sample. SecurityPolicyViolationEvent.sourceFileRead only A
USVString representing the URI of the document or worker in which the violation was found. SecurityPolicyViolationEvent.statusCodeRead only A number representing the HTTP status code of the document or worker in which the violation occurred. SecurityPolicyViolationEvent.violatedDirectiveRead only A DOMString representing the directive whose enforcement uncovered the violation. Examples document.ad...
URLSearchParams() - Web APIs
Return value A URLSearchParams object instance. ...
... Return value A URLSearchParams object instance. ...
... Return value A URLSearchParams object instance. Examples The following example shows how to create a URLSearchParams object from a URL string. ...
... Return value A URLSearchParams object instance. Examples The following example shows how to create a URLSearchParams object from a URL string. ...
File.File() - Web APIs
options Optional An options object containing optional attributes for the file. Available options are as follows: type: A DOMString representing the MIME type of the content that will be put into the file. Defaults to a value of "". ...
... options Optional An options object containing optional attributes for the file. Available options are as follows: type: A DOMString representing the MIME type of the content that will be put into the file. Defaults to a value of "". ...
... options Optional An options object containing optional attributes for the file. Available options are as follows: type: A DOMString representing the MIME type of the content that will be put into the file. Defaults to a value of "". ...
HTMLImageElement - Web APIs
the browser has finished fetching the image, whether successful or not. That means this value is also true if the image has no src value indicating an image to load. HTMLImageElement.crossOrigin A DOMString specifying the CORS setting for this image element. See CORS settings attributes for further details. This may be null if CORS is not used. HTMLImageElement.currentSrc Read only Returns a
USVString representing the URL from which the currently displayed image was loaded. This may change as the image is adjusted due to changing conditions, as directed by any media queries which are in place. HTMLImageElement.decoding An optional DOMString representing a hint given to the browser on how it should decode the image. If this value is provided, it must be one of the possible permitted values: s...
...is article for details on the possible values of this string. HTMLImageElement.sizes A DOMString reflecting the sizes HTML attribute. This string specifies a list of comma-separated conditional sizes for the image; that is, for a given viewport size, a particular image size is to be used. Read the documentation on the sizes page for details on the format of this string. HTMLImageElement.src A
USVString that reflects the src HTML attribute, which contains the full URL of the image including base URI. You can load a different image into the element by changing the URL in the src attribute. HTMLImageElement.srcset A
USVString reflecting the srcset HTML attribute. This specifies a list of candidate images, separated by commas (',', U+002C COMMA). Each candidate image is a URL followed by a space,...
...rks with images despite its name) to specify the alignment. HTMLImageElement.border A DOMString which defines the width of the border surrounding the image. This is deprecated; use the CSS border property instead. HTMLImageElement.hspace An integer value which specifies the amount of space (in pixels) to leave empty on the left and right sides of the image. HTMLImageElement.longDesc A
USVString specifying the URL at which a long description of the image's contents may be found. This is used to turn the image into a hyperlink automatically. Modern HTML should instead simply place an <img> inside an <a> element defining the hyperlink. HTMLImageElement.lowSrc A
USVString specifying the URL of a low-quality (but faster to load) version of the same image. This was once used by browsers u...
Request() - Web APIs
A Request object, effectively creating a copy. Note the following behavioural updates to retain security while making the constructor less likely to throw exceptions: If this object exists on another origin to the constructor call, the Request.referrer is stripped out. ...
...ustom settings that you want to apply to the request. The possible options are: method: The request method, e.g., GET, POST. The default is GET. headers: Any headers you want to add to your request, contained within a Headers object or an object literal with ByteString values. body: Any body that you want to add to your request: this can be a Blob, BufferSource, FormData, URLSearchParams,
USVString, or ReadableStream object. Note that a request using the GET or HEAD method cannot have a body. mode: The mode you want to use for the request, e.g., cors, no-cors, same-origin, or navigate. The default is cors. credentials: The request credentials you want to use for the request: omit, same-origin, or include. The default is same-origin. cache: The cache mode you want to use for the reques...
... The mode you want to use for the request, e.g., cors, no-cors, same-origin, or navigate. The default is cors. credentials: The request credentials you want to use for the request: omit, same-origin, or include. The default is same-origin. cache: The cache mode you want to use for the request. redirect: The redirect mode to use: follow, error, or manual. The default is follow. referrer: A
USVString specifying no-referrer, client, or a URL. The default is about:client. integrity: Contains the subresource integrity value of the request (e.g., sha256-BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=). Errors Type Description TypeError Since Firefox 43, Request() will throw a TypeError if the URL has credentials, such as http://user:password@example.com. E...
WindowOrWorkerGlobalScope.fetch() - Web APIs
h() method is controlled by the connect-src directive of Content Security Policy rather than the directive of the resources it's retrieving. Note: The fetch() method's parameters are identical to those of the Request() constructor. Syntax const fetchResponsePromise = fetch(resource [, init]) Parameters resource This defines the resource that you wish to fetch. This can either be: A
USVString containing the direct URL of the resource you want to fetch. Some browsers accept the blob: and data: schemes. A Request object. init Optional An object containing any custom settings that you want to apply to the request. The possible options are: method The request method, e.g., GET, POST. Note that the Origin header is not set on Fetch requests with a method of HEAD or GET. ...
...Fetch requests with a method of HEAD or GET. (This behavior was corrected in Firefox 65 -- see bug 1508661). headers Any headers you want to add to your request, contained within a Headers object or an object literal with ByteString values. Note that some names are forbidden. body Any body that you want to add to your request: this can be a Blob, BufferSource, FormData, URLSearchParams,
USVString, or ReadableStream object. Note that a request using the GET or HEAD method cannot have a body. mode The mode you want to use for the request, e.g., cors, no-cors, or same-origin. credentials The request credentials you want to use for the request: omit, same-origin, or include. To automatically send cookies for the current domain, this option must be provided. Starting with Chrome 50, th...
...operty also takes a FederatedCredential instance or a PasswordCredential instance. cache The cache mode you want to use for the request. redirect The redirect mode to use: follow (automatically follow redirects), error (abort with an error if a redirect occurs), or manual (handle redirects manually). In Chrome the default is follow (before Chrome 47 it defaulted to manual). referrer A
USVString specifying the referrer of the request. This can be a same-origin URL, about:client, or an empty string. referrerPolicy Specifies the referrer policy to use for the request. May be one of no-referrer, no-referrer-when-downgrade, same-origin, origin, strict-origin, origin-when-cross-origin, strict-origin-when-cross-origin, or unsafe-url. integrity Contains the subresource integrity value o...
Body.text() - Web APIs
The text() method of the Body mixin takes a Response stream and reads it to completion. It returns a promise that resolves with a
USVString object (text). The response is always decoded using UTF-8. Syntax response.text().then(function (text) { // do something with the text response }); Parameters None. Return value A Promise that resolves with a
USVString. Example In our fetch text example (run fetch text live), we have an <article> element and three links (stored in the myLinks array.) First, we loop through all of these and give each one an onclick event handler so that the getData() function is run -- with the link's data-page identifier passed to it as an argument -- when one of the links is clicked. When getData() is run, we create a new request using the Request() constructor, th...
...Links array.) First, we loop through all of these and give each one an onclick event handler so that the getData() function is run -- with the link's data-page identifier passed to it as an argument -- when one of the links is clicked. When getData() is run, we create a new request using the Request() constructor, then use it to fetch a specific .txt file. When the fetch is successful, we read a
USVString (text) object out of the response using text(), then set the innerHTML of the <article> element equal to the text object. let myArticle = document.querySelector('article'); let myLinks = document.querySelectorAll('ul a'); for(let i = 0; i <= myLinks.length-1; i++) { myLinks[i].onclick = function(e) { e.preventDefault(); let linkData = e.target.getAttribute('data-page'); getData(li...
CSSOMString - Web APIs
CSSOMString is used to denote string data in CSSOM specifications and can refer to either DOMString or
USVString. When a specification says CSSOMString, it depends on the browser vendors to choose whether to use DOMString or
USVString. While browser implementations that use UTF-8 internally to represent strings in memory can use
USVString when the specification says CSSOMString, implementations that already represent strings as 16-bit sequences might choose to use DOMString instead. ...
...g, it depends on the browser vendors to choose whether to use DOMString or
USVString. While browser implementations that use UTF-8 internally to represent strings in memory can use
USVString when the specification says CSSOMString, implementations that already represent strings as 16-bit sequences might choose to use DOMString instead. Implementation differences Browser DOMString or
USVString for CSSOMString Firefox (Gecko)
USVString Chrome (Blink)
USVString Safari (WebKit)
USVString Edge (EdgeHTML) - Opera (Blink)
USVString Specifications Specification Status Comment CSS Object Model (CSSOM)The definition of 'CSSOMString' in that specification. Working Draft Initial definition. ...
CSSUnitValue.unit - Web APIs
Examples The following creates a CSSPositionValue from individual CSSUnitValue constructors, then queries the CSSUnitValue.unit. ...
... Examples The following creates a CSSPositionValue from individual CSSUnitValue constructors, then queries the CSSUnitValue.unit. ...
File.webkitRelativePath - Web APIs
Example In this example, a directory picker is presented which lets the user choose one or more directories. When the change event occurs, a list of all files contained within the selected directory hierarchies is generated and displayed. ...
... Example In this example, a directory picker is presented which lets the user choose one or more directories. When the change event occurs, a list of all files contained within the selected directory hierarchies is generated and displayed. ...
FileSystemEntry.fullPath - Web APIs
Example This example shows a function which is called with a file system; it then gets a FileSystemFileEntry for a file named data.json and returns its full path. ...
... Example This example shows a function which is called with a file system; it then gets a FileSystemFileEntry for a file named data.json and returns its full path. ...
FileSystemEntry.name - Web APIs
Example This example shows a function called isFileWithExtension() which returns true if the specified FileSystemEntry is both a file and the file's name ends with a given extension. ...
... Example This example shows a function called isFileWithExtension() which returns true if the specified FileSystemEntry is both a file and the file's name ends with a given extension. ...
FileSystemEntry - Web APIs
1024*1024 /*1MB*/, function(fs) { fs.root.getFile('log.txt', {}, function(fileEntry) { fileEntry.remove(function() { console.log('File removed.'); }, onError); }, onError); }, onError); Properties This interface provides the following properties. filesystem Read only A FileSystem object representing the file system in which the entry is located. fullPath Read only A
USVString object which provides the full, absolute path from the file system's root to the entry; it can also be thought of as a path which is relative to the root directory, prepended with a "/" character. isDirectory Read only A Boolean which is true if the entry represents a directory; otherwise, it's false. isFile Read only A Boolean which is true if the entry represents a file. If it's not a fil...
...th from the file system's root to the entry; it can also be thought of as a path which is relative to the root directory, prepended with a "/" character. isDirectory Read only A Boolean which is true if the entry represents a directory; otherwise, it's false. isFile Read only A Boolean which is true if the entry represents a file. If it's not a file, this value is false. name Read only A
USVString containing the name of the entry (the final part of the path, after the last "/" character). Methods This interface defines the following methods. copyTo() Copies the file or directory to a new location on the file system. getMetadata() Obtains metadata about the file, such as its modification date and size. getParent() Returns a FileSystemDirectoryEntry representing the entry's parent...
FormData.entries() - Web APIs
Note: This method is available in Web Workers. Syntax formData.entries(); Return value Returns an iterator. ...
... Note: This method is available in Web Workers. Syntax formData.entries(); Return value Returns an iterator. ...
Notification.Notification() - Web APIs
ion. It defaults to auto, which just adopts the browser's language setting behavior, but you can override that behaviour by setting values of ltr and rtl (although most browsers seem to ignore these settings.) lang: The notification's language, as specified using a DOMString representing a BCP 47 language tag. See the Sitepoint ISO 2 letter language codes page for a simple reference. badge: A
USVString containing the URL of the image used to represent the notification when there isn't enough space to display the notification itself. body: A DOMString representing the body text of the notification, which is displayed below the title. tag: A DOMString representing an identifying tag for the notification. icon: A
USVString containing the URL of an icon to be displayed in the notification. ...
...ng the URL of the image used to represent the notification when there isn't enough space to display the notification itself. body: A DOMString representing the body text of the notification, which is displayed below the title. tag: A DOMString representing an identifying tag for the notification. icon: A
USVString containing the URL of an icon to be displayed in the notification. image: a
USVString containing the URL of an image to be displayed in the notification. data: Arbitrary data that you want associated with the notification. This can be of any data type. vibrate: A vibration pattern for the device's vibration hardware to emit with the notification. renotify: A Boolean specifying whether the user should be notified after a new notification replaces an old one. The default is fa...
PasswordCredential.name - Web APIs
Syntax name =passwordCredential.name Value A
USVString containing a name. ...
... The name read-only property of the PasswordCredential interface returns a
USVSTring containing a human-readable public name for display in a credential chooser. Syntax name =passwordCredential.name Value A
USVString containing a name. Specifications Specification Status Comment Credential Management Level 1The definition of 'name' in that specification. Working Draft Initial definition. ...
PasswordCredential - Web APIs
ntext Creates a new PasswordCredential object. Properties Inherits properties from its ancestor, Credential. PasswordCredential.additionalData Secure context One of a FormData instance, a URLSearchParams instance, or null. The data in the objects will be added to the request body and sent to the remote endpoint with the credentials. PasswordCredential.iconURL Read only Secure context A
USVString containing a URL pointing to an image for an icon. This image is intended for display in a credential chooser. The URL must be accessible without authentication. PasswordCredential.idName Secure context A
USVString containing the name that will be used for the ID field when submitting the current object to a remote endpoint via fetch. This property defaults to 'username', but may be overridden...
...l chooser. The URL must be accessible without authentication. PasswordCredential.idName Secure context A
USVString containing the name that will be used for the ID field when submitting the current object to a remote endpoint via fetch. This property defaults to 'username', but may be overridden to match whatever the backend service expects. PasswordCredential.name Read only Secure context A
USVString containing a human-readable public name for display in a credential chooser. PasswordCredential.password Read only Secure context A
USVString containing the password of the credential. PasswordCredential.passwordName Secure context A
USVString representing the name that will be used for the password field when submitting the current object to a remote endpoint via fetch. This property defaul...
PublicKeyCredentialRequestOptions.extensions - Web APIs
ys and values. Here is the current (as of March 2019) list of potential extensions which may be used during the registration operation. Warning! As of June 2020, only appid is supported by Chrome and Edge. Firefox does not seem to support any extension. Also Chrome doesn't plan to support any other extension in future Extension identifier Type Description appid
USVString FIDO appID. An appID which was used with legacy FIDO JS APIs to identify the current relying party. txAuthSimple
USVString Simple transaction authorization. This text is displayed on a prompt of the authenticator before verifying the user or testing their presence. The client outputs a
USVString which is the text as it was displayed (line breaks may have been added). tx...
...This is used to display an image or some non-textual content on the authenticator before verifying the user or testing their presence. The contentType gives the MIME type of the resource to be displayed while content gives its actual content. ...
Request - Web APIs
with an ArrayBuffer representation of the request body. Body.blob() Returns a promise that resolves with a Blob representation of the request body. Body.formData() Returns a promise that resolves with a FormData representation of the request body. Body.json() Returns a promise that resolves with a JSON representation of the request body. Body.text() Returns a promise that resolves with an
USVString (text) representation of the request body. Note: The Body functions can be run only once; subsequent calls will resolve with empty strings/ArrayBuffers. Examples In the following snippet, we create a new request using the Request() constructor (for an image file in the same directory as the script), then return some property values of the request: const request = new Request('https://www.m...
... You could then fetch this api request by passing the Request object in as a parameter to a WindowOrWorkerGlobalScope.fetch() call, for example and get the response: fetch(request) .then(response => { if (response.status === 200) { return response.json(); } else { throw ne...
ServiceWorkerRegistration.showNotification() - Web APIs
s configuring the notification. It can have the following properties: actions: An array of actions to display in the notification. The members of the array should be an object literal. It may contain the following values: action: A DOMString identifying a user action to be displayed on the notification. title: A DOMString containing action text to be shown to the user. icon: A
USVString containing the URL of an icon to display with the action. Appropriate responses are built using event.action within the notificationclick event. badge: a
USVString containing the URL of an image to represent the notification when there is not enough space to display the notification itself such as for example, the Android Notification Bar. On Android devices, the badge should accommodate...
...evices, the badge should accommodate devices up to 4x resolution, about 96 by 96 px, and the image will be automatically masked. body: A string representing an extra content to display within the notification. data: Arbitrary data that you want to be associated with the notification. This can be of any data type. dir : The direction of the notification; it can be auto, ltr or rtl icon: a
USVString containing the URL of an image to be used as an icon by the notification. image: a
USVString containing the URL of an image to be displayed in the notification. lang: Specify the lang used within the notification. This string must be a valid BCP 47 language tag. renotify: A boolean that indicates whether to suppress vibrations and audible alerts when reusing a tag value. If options's renoti...
StorageEvent - Web APIs
The key attribute is null when the change is caused by the storage clear() method. Read only. newValue DOMString The new value of the key. The newValue is null when the change has been invoked by storage clear() method or the key has been ...
...the change has been invoked by storage clear() method or the key has been removed from the storage. Read only. oldValue DOMString The original value of the key. The oldValue is null when the key has been newly added and therefore doesn't have any previous value. Read only. storageArea Storage Represents the Storage object that was affected. Read only. url
USVString The URL of the document whose key changed. Read only. Methods initStorageEvent() Initializes the event in a manner analogous to the similarly-named initEvent() method in the DOM Events interfaces. Syntax storageEvent.initStorageEvent(type[, canBubble[, cancelable[, key[, oldValue[, newValue[, url[, storageArea]]]]]]]) Parameters typeArg The name of the event. canBubble Opti...
TextEncoder.prototype.encodeInto() - Web APIs
uint8Array Is a Uint8Array object instance to place the resulting UTF-8 encoded text into. Return value A TextEncoderEncodeIntoResult dictionary, which contains two members: read The number of UTF-16 units of code from the source that has been converted over to UTF-8. ...
... uint8Array Is a Uint8Array object instance to place the resulting UTF-8 encoded text into. Return value A TextEncoderEncodeIntoResult dictionary, which contains two members: read The number of UTF-16 units of code from the source that has been converted over to UTF-8. ...
URL.hash - Web APIs
Examples const url = new URL('/docs/Web/API/URL/href#Examples'); console.log(url.hash); // Logs: '#Examples' Specifications Specification Status Comment URLThe definition of 'URL.hash' in that specification. ...
... Examples const url = new URL('/docs/Web/API/URL/href#Examples'); console.log(url.hash); // Logs: '#Examples' Specifications Specification Status Comment URLThe definition of 'URL.hash' in that specification. ...
URL.password - Web APIs
Examples const url = new URL('https://anonymous:flabada@developer.mozilla.org/docs/Web/API/URL/password'); console.log(url.password) // Logs "flabada" Specifications Specification Status Comment URLThe definition of 'URL.password' in that specification. ...
... Examples const url = new URL('https://anonymous:flabada@developer.mozilla.org/docs/Web/API/URL/password'); console.log(url.password) // Logs "flabada" Specifications Specification Status Comment URLThe definition of 'URL.password' in that specification. ...
URL.pathname - Web APIs
Examples const url = new URL('/docs/Web/API/URL/pathname?q=value'); console.log(url.pathname); // Logs "/docs/Web/API/URL/pathname" Specifications Specification Status Comment URLThe definition of 'URL.pathname' in that specification. ...
... Examples const url = new URL('/docs/Web/API/URL/pathname?q=value'); console.log(url.pathname); // Logs "/docs/Web/API/URL/pathname" Specifications Specification Status Comment URLThe definition of 'URL.pathname' in that specification. ...
URL.pathname - Web APIs
Examples const url = new URL('/docs/Web/API/URL/pathname?q=value'); console.log(url.pathname); // Logs "/docs/Web/API/URL/pathname" Specifications Specification Status Comment URLThe definition of 'URL.pathname' in that specification. ...
... Examples const url = new URL('/docs/Web/API/URL/pathname?q=value'); console.log(url.pathname); // Logs "/docs/Web/API/URL/pathname" Specifications Specification Status Comment URLThe definition of 'URL.pathname' in that specification. ...
URL.port - Web APIs
Examples const url = new URL('https://mydomain.com:80/svn/Repos/'); console.log(url.port); // Logs '80' Specifications Specification Status Comment URLThe definition of 'URL.port' in that specification. ...
... Examples const url = new URL('https://mydomain.com:80/svn/Repos/'); console.log(url.port); // Logs '80' Specifications Specification Status Comment URLThe definition of 'URL.port' in that specification. ...
URL.protocol - Web APIs
Examples const url = new URL('/docs/Web/API/URL/protocol'); console.log(url.protocol); // Logs "https:" Specifications Specification Status Comment URLThe definition of 'protocol' in that specification. ...
... Examples const url = new URL('/docs/Web/API/URL/protocol'); console.log(url.protocol); // Logs "https:" Specifications Specification Status Comment URLThe definition of 'protocol' in that specification. ...
Blob() - Web APIs
The Blob() constructor returns a new Blob object. The content of the blob consists of the concatenation of the values given in the parameter array. Syntax var newBlob = new Blob(array, options); Parameters array An Array of ArrayBuffer, ArrayBufferView, Blob,
USVString objects, or a mix of any of such objects, that will be put inside the Blob.
USVString objects are encoded as UTF-8. options Optional An optional object of type BlobPropertyBag which may specify any of the following properties: type Optional The MIME type of the data that will be stored into the blob. The default value is the empty string, (""). endings Optional How to interpret newline characters (\n) within the contents, if the data is text. The default value, transparent, copies newline characters into the...
Blob - Web APIs
mise that resolves with an ArrayBuffer containing the entire contents of the Blob as binary data. Blob.prototype.slice() Returns a new Blob object containing the data in the specified range of bytes of the blob on which it's called. Blob.prototype.stream() Returns a ReadableStream that can be used to read the contents of the Blob. Blob.prototype.text() Returns a promise that resolves with a
USVString containing the entire contents of the Blob interpreted as UTF-8 text. Examples Creating a blob The Blob() constructor can create blobs from other objects. For example, to construct a blob from a JSON string: const obj = {hello: 'world'}; const blob = new Blob([JSON.stringify(obj, null, 2)], {type : 'application/json'}); Creating a URL representing the contents of a typed array The followin...
Body - Web APIs
ith a Blob. Body.formData() Takes a Response stream and reads it to completion. It returns a promise that resolves with a FormData object. Body.json() Takes a Response stream and reads it to completion. It returns a promise that resolves with the result of parsing the body text as JSON. Body.text() Takes a Response stream and reads it to completion. It returns a promise that resolves with a
USVString (text). The response is always decoded using UTF-8. Examples The example below uses a simple fetch call to grab an image and display it in an <img> tag. You'll notice that since we are requesting an image, we need to run Body.blob() (Response implements body) to give the response its correct MIME type. HTML Content <img class="my-image" src="https://udn.realityripple.com/samples/46/29059a2b3...
CSSUnitValue.CSSUnitValue() - Web APIs
The CSSUnitValue() constructor creates a new CSSUnitValue object which returns a new CSSUnitValue object which represents values that contain a single unit type. For example, "42px" would be represented by a CSSNumericValue. Syntax var CSSUnitValue = new CSSUnitValue() Parameters value Returns a double indicating the number of units. unit Returns a
USVString indicating the type of unit. Examples The following shows a method of creating a CSSPositionValue from individual CSSUnitValue constructors. let pos = new CSSPositionValue( new CSSUnitValue(5, "px"), new CSSUnitValue(10, "px")); Specifications Specification Status Comment CSS Typed OM Level 1The definition of 'CSSUnitValue' in that specification. Working Draft Initial definition. ...
CSSUnitValue - Web APIs
The CSSUnitValue interface of the CSS Typed Object Model API represents values that contain a single unit type. For example, "42px" would be represented by a CSSNumericValue. Constructor CSSStyleValue.CSSUnitValue() Creates a new CSSUnitValue object. Properties CSSUnitValue.value Returns a double indicating the number of units. CSSUnitValue.unit Returns a
USVString indicating the type of unit. Event handlers None. Methods None. Examples The following shows a method of creating a CSSPositionValue from individual CSSUnitValue constructors. let pos = new CSSPositionValue( new CSSUnitValue(5, "px"), new CSSUnitValue(10, "px")); Specifications Specification Status Comment CSS Typed OM Level 1The definition of 'CSSUnitValue' in that specification...
CSSUnparsedValue.CSSUnparsedValue() - Web APIs
The CSSUnparsedValue() constructor creates a new CSSUnparsedValue object which represents property values that reference custom properties. Syntax var CSSUnparsedValue = new CSSUnparsedValue(members) Parameters members An array whose values must be either a
USVString or a CSSVariableReferenceValue. Examples let value = new CSSUnparsedValue( ['4deg'] ), values = new CSSUnparsedValue( ['1em', '#445566', '-45px'] ); console.log( value ); // CSSUnparsedValue {0: "4deg", length: 1} console.log( values ); // CSSUnparsedValue {0: "1em", 1: "#445566", 2: "-45px", length: 3} Specifications Specification Status Comment CSS Typed OM Level 1The definition of 'CSSUnparsedValue' in that specification. Working Draft Initial definition. ...
CSSVariableReferenceValue.variable - Web APIs
The variable property of the CSSVariableReferenceValue interface returns the custom property name of the CSSVariableReferenceValue. Syntax var variable = cssVariableReferenceValue.variable; Value A
USVString beginning with -- (that is, a custom property name). Specifications Specification Status Comment CSS Typed OM Level 1The definition of 'variable' in that specification. Working Draft ...
Client.url - Web APIs
The url read-only property of the Client interface returns the URL of the current service worker client. Syntax var clientUrl = client.url; Value A
USVString. Example self.addEventListener('notificationclick', function(event) { console.log('On notification click: ', event.notification.tag); event.notification.close(); // This looks to see if the current is already open and // focuses if it is event.waitUntil(clients.matchAll({ type: 'window' }).then(function(clientList) { for (var i = 0; i < clientList.length; i++) { var client = clientList[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openWindow) return clients.openWindow('/'); })); }); Specifications Specification Status Comment...
Clients.openWindow() - Web APIs
he result of a notification click event. In Chrome for Android, the method may instead open the URL in an existing browsing context provided by a standalone web app previously added to the user's home screen. As of recently, this also works on Chrome for Windows. Syntax self.clients.openWindow(url).then(function(windowClient) { // Do something with your WindowClient }); Parameters url A
USVString representing the URL of the client you want to open in the window. Generally this value must be a URL from the same origin as the calling script. Return value A Promise that resolves to a WindowClient object if the URL is from the same origin as the service worker or a null value otherwise. Examples // Send notification to OS if applicable if (self.Notification.permission === 'granted') {...
Document.URL - Web APIs
string. Syntax const url = document.URL Example JavaScript document.getElementById("url").textContent = document.URL; HTML <p id="urlText"> URL:<br/> <span id="url">URL goes here</span> </p> Result Specifications Specification Status Comment DOMThe definition of 'Document.URL' in that specification. Living Standard Defines that the property is a
USVString instead of a DOMString. ...
EventSource() - Web APIs
configuration Optional Provides options to configure the new connection. The possible entries are: withCredentials, defaulting to false, indicating if CORS should be set to include credentials. ...
ExtendableMessageEvent.origin - Web APIs
Examples When the following code is used inside a service worker to respond to a push messages by sending the data received via PushMessageData to the main context via a channel message, the event object of onmessage will be a ExtendableMessageEvent. ...
FederatedCredential - Web APIs
The FederatedCredential constructor creates a new FederatedCredential object. In supporting browsers, an instance of this class may be passed the credential received from the init object for global fetch. Syntax var myCredential = new FederatedCredential(init) Parameters init Options are: provider: A
USVString; identifying the credential provider. Specifications Specification Status Comment Credential Management Level 1 Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid w...
FederatedCredential.provider - Web APIs
Example // TBD Specifications Specification Status Comments Credential Management Level 1 Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
FederatedCredential - Web APIs
nnect is an example of a federated identity provider framework. In browsers that support it, an instance of this interface may be passed in the credential member of the init object for global fetch. Constructor FederatedCredential() Creates a new FederatedCredential object. Properties Inherits properties from its ancestor, Credential. FederatedCredential.provider Read only Returns a
USVString containing a credential's federated identity provider. FederatedCredential.protocol Read only Returns a DOMString containing a credential's federated identity protocol. Event handlers None. Methods None. Examples var cred = new FederatedCredential({ id: id, name: name, provider: 'https://account.google.com', iconURL: iconUrl }); // Store it navigator.credentials.store(cred) .
File - Web APIs
face: Blob.prototype.slice([start[, end[, contentType]]]) Returns a new Blob object containing the data in the specified range of bytes of the source Blob. Blob.prototype.stream() Transforms the File into a ReadableStream that can be used to read the File contents. Blob.prototype.text() Transforms the File into a stream and reads it to completion. It returns a promise that resolves with a
USVString (text). Blob.prototype.arrayBuffer() Transforms the File into a stream and reads it to completion. It returns a promise that resolves with an ArrayBuffer. Specifications Specification Status Comment File APIThe definition of 'The File interface' in that specification. Working Draft Initial definition. ...
FileSystem.name - Web APIs
Example // tbd Specifications Specification Status Comment File and Directory Entries APIThe definition of 'name' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. ...
FileSystem - Web APIs
ectly ask for one representing a sandboxed file system created just for your web app directly by calling window.requestFileSystem(). If that call is successful, it executes a callback handler, which receives as a parameter a FileSystem object describing the file system. You can get it from a file system entry object, through its filesystem property. Properties FileSystem.name Read only A
USVString representing the file system's name. This name is unique among the entire list of exposed file systems. FileSystem.root Read only A FileSystemDirectoryEntry object which represents the file system's root directory. Through this object, you can gain access to all files and directories in the file system. Specifications Specification Status Comment File and Directo...
FileSystemDirectoryEntry.getDirectory() - Web APIs
The FileSystemDirectoryEntry interface's method getDirectory() returns a FileSystemDirectoryEntry object corresponding to a directory contained somewhere within the directory subtree rooted at the directory on which it's called. Syntax FileSystemDirectoryEntry.getDirectory([path][, options][, successCallback][, errorCallback]); Parameters path Optional A
USVString representing an absolute path or a path relative to the directory on which the method is called, describing which directory entry to return. Absolute paths may not be able to be used, for security reasons. options Optional An object based on the FileSystemFlags dictionary, which allows you to specify whether or not to create the entry if it's missing and if it's an error if the file already exists. These options are currently ...
FileSystemDirectoryEntry.getFile() - Web APIs
} The FileSystemDirectoryEntry interface's method getFile() returns a FileSystemFileEntry object corresponding to a file contained somewhere within the directory subtree rooted at the directory on which it's called. Syntax FileSystemDirectoryEntry.getFile([path][, options][, successCallback][, errorCallback]); Parameters path Optional A
USVString specifying the path, relative to the directory on which the method is called, describing which file's entry to return. options Optional An object based on the FileSystemFlags dictionary, which allows you to specify whether or not to create the entry if it's missing and if it's an error if the file already exists. These options are currently not useful in Web contexts. successCallback Optional A method to be called once the FileSystemFileEntry ...
FormData.append() - Web APIs
end() will append the new value onto the end of the existing set of values. Note: This method is available in Web Workers. Syntax There are two versions of this method: a two and a three parameter version: formData.append(name, value); formData.append(name, value, filename); Parameters name The name of the field whose data is contained in value. value The field's value. This can be a
USVString or Blob (including subclasses such as File). If none of these are specified the value is converted to a string. filename Optional The filename reported to the server (a
USVString), when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename. Note: If you specify a Blob as the data to appe...
FormData.get() - Web APIs
Return value A FormDataEntryValue containing the value. If the key doesn't exist, the method returns null. ...
FormData.getAll() - Web APIs
Returns An array of FormDataEntryValues whose key matches the value passed in the name parameter. If the key doesn't exist, the method returns an empty list. ...
FormData.keys() - Web APIs
Note: This method is available in Web Workers. Syntax formData.keys(); Return value Returns an iterator. ...
FormData.set() - Web APIs
Data.append will append the new value onto the end of the existing set of values. Note: This method is available in Web Workers. Syntax There are two versions of this method: a two and a three parameter version: formData.set(name, value); formData.set(name, value, filename); Parameters name The name of the field whose data is contained in value. value The field's value. This can be a
USVString or Blob (including subclasses such as File). If none of these are specified the value is converted to a string. filename Optional The filename reported to the server (a
USVString), when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename. Note: If you specify a Blob as the data to appe...
HTMLHyperlinkElementUtils.host - Web APIs
The HTMLHyperlinkElementUtils.host property is a
USVString containing the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', and the port of the URL. Syntax string = object.host; object.host = string; Examples var anchor = document.createElement("a"); anchor.href = "https://developer.mozilla.org/HTMLHyperlinkElementUtils.host" anchor.host == "developer.mozilla.org" anchor.href = "https://developer.mozilla.org:443/HTMLHyperlinkElementUtils.host" anchor.host == "developer.mozilla.org" // The port number is not included because 443 is the scheme's default port anchor.href = "https://developer.mozilla.org:4097/HTMLHyperlinkElementUtils.host" anchor.host == "developer.mozilla.org:4097" Specifications Specification Status Comment HTML Livi...
HTMLHyperlinkElementUtils.hostname - Web APIs
The HTMLHyperlinkElementUtils.hostname property is a
USVString containing the domain of the URL. Syntax string = object.hostname; object.hostname = string; Examples // Let's an <a id="myAnchor" href="https://developer.mozilla.org/docs/HTMLHyperlinkElementUtils.hostname"> element be in the document var anchor = document.getElementById("myAnchor"); var result = anchor.hostname; // Returns:'developer.mozilla.org' Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHyperlinkElementUtils.hostname' in that specification. Living Standard Initial definition. ...
HTMLHyperlinkElementUtils.href - Web APIs
The HTMLHyperlinkElementUtils.href property is a stringifier that returns a
USVString containing the whole URL, and allows the href to be updated. Syntax string = object.href; object.href = string; Examples // Lets imagine an <a id="myAnchor" href="https://developer.mozilla.org/HTMLHyperlinkElementUtils/href"> element is in the document var anchor = document.getElementById("myAnchor"); var result = anchor.href; // Returns: 'https://developer.mozilla.org/HTMLHyperlinkElementUtils/href' Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHyperlinkElementUtils.href' in that specification. Living Standard Initial definition. ...
HTMLHyperlinkElementUtils.pathname - Web APIs
The HTMLHyperlinkElementUtils.pathname property is a
USVString containing an initial '/' followed by the path of the URL (or the empty string if there is no path). Syntax string = object.pathname; object.pathname = string; Examples // Let's an <a id="myAnchor" href="https://developer.mozilla.org/docs/HTMLHyperlinkElementUtils.pathname"> element be in the document var anchor = document.getElementById("myAnchor"); var result = anchor.pathname; // Returns:'/docs/HTMLHyperlinkElementUtils.pathname' Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHyperlinkElementUtils.pathname' in that specification. Living Standard Initial definition. ...
HTMLHyperlinkElementUtils.port - Web APIs
If the URL does not contain an explicit port number, it will be set to ''. Syntax string = object.port; object.port = string; Examples // Let's an <a id="myAnchor" href="https://developer.mozilla.org:443/docs/HTMLHyperlinkElementUtils.port"> element be in the document var anchor = document.getElementByID("myAnchor"); var result = anchor.port; // Returns:'443' Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHyperlinkElementUtils.port' in that specification. ...
HTMLHyperlinkElementUtils.protocol - Web APIs
The HTMLHyperlinkElementUtils.protocol property is a
USVString representing the protocol scheme of the URL, including the final ':'. Syntax string = object.protocol; object.protocol = string; Examples // Let's an <a id="myAnchor" href="https://developer.mozilla.org/HTMLHyperlinkElementUtils.protocol"> element be in the document var anchor = document.getElementById("myAnchor"); var result = anchor.protocol; // Returns:'https:' Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHyperlinkElementUtils.protocol' in that specification. Living Standard Initial definition. ...
HTMLHyperlinkElementUtils.username - Web APIs
The HTMLHyperlinkElementUtils.username property is a
USVString containing the username specified before the domain name. Syntax string = object.username; object.username = string; Examples // Let's <a id="myAnchor" href="https://anonymous:flabada@developer.mozilla.org/docs/HTMLHyperlinkElementUtils.username"> be in the document var anchor = document.getElementByID("myAnchor"); var result = anchor.username; // Returns:'anonymous' Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHyperlinkElementUtils.username' in that specification. Living Standard Initial definition. ...
HTMLImageElement.currentSrc - Web APIs
This is useful when you provide multiple image options using the sizes and/or HTMLImageElement.srcset properties. currentSrc lets you determine which image from the set of provided images was selected by the browser. ...
HTMLImageElement.sizes - Web APIs
f a list of media conditions. This provides the ability to automatically select among different images--even images of different orientations or aspect ratios--as the document state changes to match different media conditions. Each condition is specified using the same conditional format used by media queries. Syntax let sizes = htmlImageElement.sizes; htmlImageElement.sizes = sizes; Value A
USVString containing a comma-separated list of source size descriptors followed by an optional fallback size. Each source size descriptor is comprised of a media condition, then at least one whitespace character, then the source size value to use for the image when the media condition evaluates to true. Media conditions Each source size descriptor consists of a media condition as defined by the media que...
HTMLImageElement.src - Web APIs
The HTMLImageElement property src, which reflects the HTML src attribute, specifies the image to display in the <img> element. Syntax htmlImageElement.src = newSource; let src = htmlImageElement.src; Value When providing only a single image, rather than a set of images from which the browser selects the best match for the viewport size and display pixel density, the src attribute is a
USVString specifying the URL of the desired image. This can be set either within the HTML itself using the src content attribute, or programmatically by setting the element's src property. If you use the srcset content attribute to provide multiple image options for different display pixel densities, the URL specified by the src attribute is used in one of two ways: as a fallback for browsers that don't suppo...
HTMLImageElement.srcset - Web APIs
hat candidate should be used instead of the image specified by the src property. The srcset property, along with the sizes property, are a crucial component in designing responsive web sites, as they can be used together to make pages that use appropriate images for the rendering situation. Syntax htmlImageElement.srcset = imageCandidateStrings; let srcset = htmlImageElement.srcset; Value A
USVString containing a comma-separated list of one or more image candidate strings to be used when determining which image resource to present inside the <img> element represented by the HTMLImageElement. Each image candidate string must begin with a valid URL referencing a non-interactive graphic resource. This is followed by a comma (,) character and then a condition descriptor that indicates the circum...
HTMLImageElement.useMap - Web APIs
The useMap property on the HTMLImageElement interface reflects the value of the HTML usemap attribute, which is a string providing the name of the client-side image map to apply to the image. Syntax htmlImageElement.useMap = imageMapAnchor; let imageMapAnchor = htmlImageElement.useMap; Value A
USVString providing the page-local URL (that is, a URL that begins with the hash or pound symbol, "#") of the <map> element which defines the image map to apply to the image. You can learn more about client-side image maps in our learning article Add a hitmap on top of an image. Usage notes The string value of useMap must be a valid anchor for a <map> element. In other words, this string should be the value of the appropriate <map>'s name attribute with a pound or hash symbol prepended to it. Consid...
HTMLMediaElement.src - Web APIs
ource to use in the element. Note: The best way to know the URL of the media resource currently in active use in this element is to look at the value of the currentSrc attribute, which also takes into account selection of a best or preferred media resource from a list provided in an HTMLSourceElement (which represents a <source> element). Syntax var mediaUrl = HTMLMediaElement.src; Value A
USVString object containing the URL of a media resource to use in the element; this property reflects the value of the HTML element's src attribute. Example var obj = document.createElement('video'); console.log(obj.src); // "" Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLMediaElement.src' in that specification. Living Standard No...
Location: hash - Web APIs
The fragment is not percent-decoded. If the URL does not have a fragment identifier, this property contains an empty string, "". ...
Location: host - Web APIs
The host property of the Location interface is a
USVString containing the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', and the port of the URL. Syntax string = object.host; object.host = string; Examples var anchor = document.createElement("a"); anchor.href = "https://developer.mozilla.org/Location.host" anchor.host == "developer.mozilla.org" anchor.href = "https://developer.mozilla.org:443/Location.host" anchor.host == "developer.mozilla.org" // The port number is not included because 443 is the scheme's default port anchor.href = "https://developer.mozilla.org:4097/Location.host" anchor.host == "developer.mozilla.org:4097" Specifications Specification Status Comment HTML Living StandardThe definition of 'host' in that specifi...
Location: hostname - Web APIs
The hostname property of the Location interface is a
USVString containing the domain of the URL. Syntax string = object.hostname; object.hostname = string; Examples // Let's an <a id="myAnchor" href="https://developer.mozilla.org/docs/Location.hostname"> element be in the document var anchor = document.getElementById("myAnchor"); var result = anchor.hostname; // Returns:'developer.mozilla.org' Specifications Specification Status Comment HTML Living StandardThe definition of 'hostname' in that specification. Living Standard Initial definition. ...
Location: href - Web APIs
Setting the value of href navigates to the provided URL. If you want redirection, use Location.replace(). ...
Location: origin - Web APIs
E.g "blob:https://mozilla.org" will have "https://mozilla.org". Note: This feature is available in Web Workers. ...
Location: pathname - Web APIs
The pathname property of the Location interface is a
USVString containing an initial '/' followed by the path of the URL (or the empty string if there is no path). Syntax string = object.pathname; object.pathname = string; Examples // Let's an <a id="myAnchor" href="https://developer.mozilla.org/docs/Location.pathname"> element be in the document var anchor = document.getElementById("myAnchor"); var result = anchor.pathname; // Returns:'/docs/Location.pathname' Specifications Specification Status Comment HTML Living StandardThe definition of 'pathname' in that specification. Living Standard Initial definition. ...
Location: port - Web APIs
If the URL does not contain an explicit port number, it will be set to ''. Syntax string = object.port; object.port = string; Examples // Let's an <a id="myAnchor" href="https://developer.mozilla.org:443/docs/Location.port"> element be in the document var anchor = document.getElementByID("myAnchor"); var result = anchor.port; // Returns:'443' Specifications Specification Status Comment HTML Living StandardThe definition of 'Location.port' in that specification. ...
Location: protocol - Web APIs
The protocol property of the Location interface is a
USVString representing the protocol scheme of the URL, including the final ':'. Syntax string = object.protocol; object.protocol = string; Examples // Let's an <a id="myAnchor" href="https://developer.mozilla.org/Location.protocol"> element be in the document var anchor = document.getElementById("myAnchor"); var result = anchor.protocol; // Returns:'https:' Specifications Specification Status Comment HTML Living StandardThe definition of 'protocol' in that specification. Living Standard Initial definition. ...
Location: search - Web APIs
Modern browsers provide URLSearchParams and URL.searchParams to make it easy to parse out the parameters from the querystring. ...
Location: username - Web APIs
The username property of the Location interface is a
USVString containing the username specified before the domain name. Syntax string = object.username; object.username = string; Examples // Let's <a id="myAnchor" href="https://anonymous:flabada@developer.mozilla.org/docs/Location.username"> be in the document var anchor = document.getElementByID("myAnchor"); var result = anchor.username; // Returns:'anonymous' ...
MerchantValidationEvent.validationURL - Web APIs
The MerchantValidationEvent property validationURL is a read-only string value providing the URL from which to fetch the payment handler-specific data needed to validate the merchant. This data should be passed into the complete() method to let the user agent complete the transaction. Syntax validationURL = merchantValidationEvent.validationURL; Value A read-only
USVString giving the URL from which to load payment handler specific data needed to complete the merchant verification process. Once this has been loaded, it should be passed into complete(), either directly or using a promise. See Merchant validation in Payment processing concepts for more information on the merchant validation process. Specifications Specification Status Comment Payment Request APIThe d...
MerchantValidationEvent - Web APIs
hantValidationEvent.methodName Secure context A DOMString providing a unique payment method identifier for the payment handler that's requiring validation. This may be either one of the standard payment method identifier strings or a URL that both identifies and handles requests for the payment handler, such as https://apple.com/apple-pay. MerchantValidationEvent.validationURL Secure context A
USVString specifying a URL from which the site or app can fetch payment handler specific validation information. Once this data is retrieved, the data (or a promise resolving to the validation data) should be passed into complete() to validate that the payment request is coming from an authorized merchant. Methods MerchantValidationEvent.complete() Secure context Pass the data retrieved from the URL ...
MessageEvent.MessageEvent() - Web APIs
ent object instance. Syntax var messageEvent = new MessageEvent(type, init); Parameters type The type of MessageEvent that will be created. This can be one of XXX init Optional A dictionary object that can contain the following properties: data: The data you want contained in the MessageEvent. This can be of any data type, and will default to null if not specified. origin: A
USVString representing the origin of the message emitter. This defaults to an empty string ("") if not specified. lastEventId: A DOMString representing a unique ID for the event. This defaults to an empty string ("") if not specified. source: An MessageEventSource (which can be a WindowProxy, MessagePort, or ServiceWorker object) representing the message emitter. This defaults to null if not set. por...
MessageEvent.origin - Web APIs
The origin read-only property of the MessageEvent interface is a
USVString representing the origin of the message emitter. Syntax var origin = messageEvent.origin; Value A
USVString representing the origin. Example myWorker.onmessage = function(e) { result.textContent = e.data; console.log('Message received from worker'); console.log(e.origin); }; Specifications Specification Status Comment HTML Living StandardThe definition of 'MessageEvent: origin' in that specification. Living Standard ...
MessageEvent - Web APIs
"#4D4E53" text-anchor="middle" alignment-baseline="middle">MessageEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor MessageEvent() Creates a new MessageEvent. Properties This interface also inherits properties from its parent, Event. MessageEvent.data Read only The data sent by the message emitter. MessageEvent.origin Read only A
USVString representing the origin of the message emitter. MessageEvent.lastEventId Read only A DOMString representing a unique ID for the event. MessageEvent.source Read only A MessageEventSource (which can be a WindowProxy, MessagePort, or ServiceWorker object) representing the message emitter. MessageEvent.ports Read only An array of MessagePort objects representing the ports associated with the...
NDEFRecord.encoding - Web APIs
The encoding property ofthe NDEFRecord interface is
USVString containing the name of the encoding used to encode NDEF payload if it contains textual data. Syntax NDEFRecord.encoding Value A
USVString which can be one of the following: "utf-8", "utf-16", "utf-16le" or "utf-16be". Specifications Specification Status Comment Web NFC, NDEFRecord.encoding Draft Initial definition. ...
NDEFRecord.id - Web APIs
The id property ofthe NDEFRecord interface is
USVString containing the record identifier. This identifier is created by the generator of the record which is solely responsible for enforcing record identifier uniqueness. Web NFC does not sign the NFC content, thus record consumer should not make any assumptions about integrity or authenticity of the identifier or any other part of the records. Syntax NDEFRecord.id Value A
USVString. Specifications Specification Status Comment Web NFC, NDEFRecord Draft Initial definition. ...
NDEFRecord.lang - Web APIs
The lang property ofthe NDEFRecord interface is
USVString containing the language tag of the record contents, if it is a vailable. The record might be missing a language tag, for example, if the recorded information is not locale-specific. Syntax NDEFRecord.lang Value A
USVString. Specifications Specification Status Comment Web NFC, NDEFRecord.lang Draft Initial definition. ...
NDEFRecord.mediaType - Web APIs
The mediaType property ofthe NDEFRecord interface is
USVString containing the MIME type of the record payload. Syntax NDEFRecord.mediaType Value A
USVString, corresponding to a MIME type of the record payload. Specifications Specification Status Comment Web NFC, NDEFRecord.mediaType Draft Initial definition. ...
NDEFRecord.recordType - Web APIs
"text" Represents a text NDEF record. "url" Represents an URI NDEF record. "smart-poster" Represents a "smart poster" NDEF record. "absolute-url" Represents an absolute URL NDEF record. "mime" Represents a MIME type NDEF record. "unknown" Represents an unknown NDEF record. local type name Represents a local type name, frequently used to specify NDEF record embedded within another record. ...
Navigator.share() - Web APIs
The navigator.share() method of the Web Share API invokes the native sharing mechanism of the device. Syntax var sharePromise = navigator.share(data); Parameters data An object containing data to share. At least one of the following fields must be specified. Available options are: url: A
USVString representing a URL to be shared. text: A
USVString representing text to be shared. title: A
USVString representing the title to be shared. files: A " FrozenArray" representing the array of file to be shared. Return value A Promise that will be fulfilled once a user has completed a share action (usually the user has chosen an application to share to). It will reject immediately if the data parameter is not correctly specified, and will also reject if the user cancels sharing...
Notification.badge - Web APIs
Note: This feature is available in Web Workers. The badge property of the Notification interface returns the URL of the image used to represent the notification when there is not enough space to display the notification itself. Syntax var url = Notification.badge Value A
USVString containing a URL. Specifications Specification Status Comment Notifications APIThe definition of 'badge' in that specification. Living Standard Initial definition. ...
Notification.icon - Web APIs
Note: This feature is available in Web Workers. The icon read-only property of the Notification interface contains the URL of an icon to be displayed as part of the notification, as specified in the icon option of the Notification() constructor. Syntax var icon = Notification.icon; Value A
USVString. Examples In our To-do list app (view the app running live), we use the Notification() constructor to fire a notification, passing it arguments to specify the body, icon and title we want. var notification = new Notification('To do list', { body: text, icon: img }); Specifications Specification Status Comment Notifications APIThe definition of 'icon' in that specification. Living Standard Living standard ...
Notification.image - Web APIs
Note: This feature is available in Web Workers. The image read-only property of the Notification interface contains the URL of an image to be displayed as part of the notification, as specified in the image option of the Notification() constructor. Syntax var image = Notification.image; Value A
USVString. Specifications Specification Status Comment Notifications APIThe definition of 'image' in that specification. Living Standard Living standard ...
PasswordCredential.iconURL - Web APIs
The iconURL read-only property of the PasswordCredential interface returns a
USVString containing a URL pointing to an image for an icon. This image is intended for display in a credential chooser. The URL must be accessible without authentication. Syntax url =passwordCredential.iconURL Value A
USVString containing a URL. Specifications Specification Status Comment Credential Management Level 1The definition of 'iconURL' in that specification. Working Draft Initial definition. ...
PasswordCredential.idName - Web APIs
The idName property of the PasswordCredential interface returns a
USVString, representing the name that will be used for the ID field, when submitting the current object to a remote endpoint via fetch. This property defaults to 'username', but may be set to match whatever your backend service expects. Syntax var idName = PasswordCredential.idName PasswordCredential.idName = "userID" Value A
USVString represents the name used for the ID field, when submitting the current object to a remote endpoint via fetch. Example // TBD Specifications Specification Status Comment Credential Management Level 1 Working Draft Initial definition. ...
PasswordCredential.password - Web APIs
The password read-only property of the PasswordCredential interface returns a
USVString containing the password of the credential. Syntax password =passwordCredential.password Value A
USVString containing a password. Specifications Specification Status Comment Credential Management Level 1The definition of 'password' in that specification. Working Draft Initial definition. ...
PasswordCredential.passwordName - Web APIs
The passwordName property of the PasswordCredential interface returns a
USVString, depicting the name used by the password field, when submitting the current object to a remote endpoint via fetch. This property defaults to 'password', but may be matched to anything your backend service expects. Syntax var passwordName = PasswordCredential.passwordName PasswordCredential.passwordName = "passcode" Value A
USVString representing the password field name, used when submitting the current object to a remote endpoint via fetch. Example // TBD Specifications Specification Status Comment Credential Management Level 1 Working Draft Initial definition. ...
PaymentRequestEvent.paymentRequestOrigin - Web APIs
The paymentRequestOrigin read-only property of the PaymentRequestEvent interface returns the origin where the PaymentRequest object was initialized. Syntax var a
UsvString = paymentRequestEvent.paymentRequestOrigin Value A
USVString. Specifications Specification Status Comment Payment Handler APIThe definition of 'paymentRequestOrigin' in that specification. Working Draft Initial definition. ...
PaymentRequestEvent.topOrigin - Web APIs
The topOrigin read-only property of the PaymentRequestEvent interface returns the top level payee origin where the PaymentRequest object was initialized. Syntax var a
UsvString = paymentRequestEvent.topOrigin Value A
USVString Specifications Specification Status Comment Payment Handler APIThe definition of 'topOrigin' in that specification. Working Draft Initial definition. ...
PublicKeyCredentialCreationOptions.user - Web APIs
he user account for which the credentials are generated (via navigator.credentials.create()). Syntax userAccount = publicKeyCredentialCreationOptions.user Properties displayName A DOMString which is human readable and intended for display. It may be the full name of the user (e.g. "John Doe"). This is not intended to store the login of the user (see name below). icon Optional An URL as a
USVString value which points to an image resource which can be the avatar image for the user. id A BufferSource uniquely identifying a given user. This an opaque identifier which can be used by the authenticator to link the user account with its corresponding credentials. This value will later be used when fetching the credentials in AuthenticatorAssertionResponse.userHandle. name A DOMString giving a ...
PublicKeyCredentialRequestOptions.rpId - Web APIs
The rpId property, of the PublicKeyCredentialRequestOptions dictionary, is an optional property which indicates the relying party's identifier as a
USVString. Its value can only be a suffix of the current origin's domain. For example, if you are browsing on foo.example.com, the rpId value may be "example.com" but not "bar.org" or "baz.example.com". This property is optional. If it is not explicitely provided, the user agent will use the value of the current origin's domain. Note: An analogous option exists for the creation operation (navigators.credentials.create()), see the id property of PublicKeyCredentialCreationOptions.rp. Syntax rpId = publicKeyCredentialRequestOptions.rpId Value A
USVString for the identifier of the relying party. Its value can only be a suffix of the current orig...
PublicKeyCredentialRequestOptions - Web APIs
be signed by the authenticator and the signature will be sent back as part of AuthenticatorAssertionResponse.signature. PublicKeyCredentialRequestOptions.timeout Optional A numerical hint, in milliseconds, which indicates the time the caller is willing to wait for the retrieval operation to complete. This hint may be overridden by the browser. PublicKeyCredentialRequestOptions.rpId Optional A
USVString which indicates the relying party's identifier (ex. "login.example.org"). If this option is not provided, the client will use the current origin's domain. PublicKeyCredentialRequestOptions.allowCredentials Optional An Array of credentials descriptor which restricts the acceptable existing credentials for retrieval. PublicKeyCredentialRequestOptions.userVerification Optional A string qualifyin...
PushMessageData.text() - Web APIs
Examples self.addEventListener('push', function(event) { var textObj = event.data.text(); // do something with your text }); Specifications Specification Status Comment Push APIThe definition of 'text()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. ...
PushSubscription.endpoint - Web APIs
The endpoint read-only property of the PushSubscription interface returns a
USVString containing the endpoint associated with the push subscription. The endpoint takes the form of a custom URL pointing to a push server, which can be used to send a push message to the particular service worker instance that subscribed to the push service. For this reason, it is a good idea to keep your endpoint a secret, so others do not hijack it and abuse the push functionality. Syntax var myEnd = pushSubscription.endpoint; Value A
USVString. Example navigator.serviceWorker.ready.then(function(reg) { reg.pushManager.subscribe({userVisibleOnly: true}).then(function(subscription) { console.log(subscription.endpoint); // At this point you would most likely send the subscription // endpoin...
PushSubscription - Web APIs
PushSubscription.expirationTime Read only A DOMHighResTimeStamp of the subscription expiration time associated with the push subscription, if there is one, or null otherwise. ...
RTCDataChannel.send() - Web APIs
to automatically fragment large messages, but not all browsers implement them, and those that do have various additional restrictions. This will get less complicated over time, but for now, if you have questions, see Understanding message size limits in Using WebRTC data channels. Syntax RTCDataChannel.send(data); Parameters data The data to transmit across the connection. This may be a
USVString, a Blob, an ArrayBuffer, or an ArrayBufferView. Return value undefined. Exceptions InvalidStateError Since the data channel uses a separate transport channel from the media content, it must establish its own connection; if it hasn't finished doing so (that is, its readyState is "connecting"), this error occurs without sending or buffering the data. NetworkError The specified data would ...
Request.url - Web APIs
The url read-only property of the Request interface contains the URL of the request. Syntax var myURL = request.url; Value A
USVString indicating the url of the request. Example In the following snippet, we create a new request using the Request.Request() constructor (for an image file in the same directory as the script), then save the url of the request in a variable: var myRequest = new Request('flowers.jpg'); var myURL = myRequest.url; // "http://mdn.github.io/fetch-examples/fetch-request/flowers.jpg" Specifications Specification Status Comment FetchThe definition of 'url' in that specification. Living Standard Initial definition ...
Response() - Web APIs
The Response() constructor creates a new Response object. Syntax var myResponse = new Response(body, init); Parameters body Optional An object defining a body for the response. This can be null (which is the default value), or one of: Blob BufferSource FormData ReadableStream URLSearchParams
USVString init Optional An options object containing any custom settings that you want to apply to the response, or an empty object (which is the default value). The possible options are: status: The status code for the reponse, e.g., 200. statusText: The status message associated with the status code, e.g., OK. headers: Any headers you want to add to your response, contained within a Headers object or object literal of ByteString key/value pairs (see HTTP headers for a refer...
Response.url - Web APIs
Example In our Fetch Response example (see Fetch Response live) we create a new Request object using the Request() constructor, passing it a JPG path. We then fetch this request using fetch(), extract a blob from the response using Body.blob, create an object URL out of it using URL.createObjectURL, and display this in an <img>. ...
Response - Web APIs
ith a Blob. Body.formData() Takes a Response stream and reads it to completion. It returns a promise that resolves with a FormData object. Body.json() Takes a Response stream and reads it to completion. It returns a promise that resolves with the result of parsing the body text as JSON. Body.text() Takes a Response stream and reads it to completion. It returns a promise that resolves with a
USVString (text). Examples In our basic fetch example (run example live) we use a simple fetch() call to grab an image and display it in an <img> element. The fetch() call returns a promise, which resolves to the Response object associated with the resource fetch operation. You'll notice that since we are requesting an image, we need to run Body.blob (Response implements Body) to give the response its ...
SecurityPolicyViolationEvent.blockedURI - Web APIs
The blockedURI read-only property of the SecurityPolicyViolationEvent interface is a
USVString representing the URI of the resource that was blocked because it violates a policy. Syntax let blockedURI = violationEventInstance.blockedURI; Value A
USVString representing the URI of the blocked resource. Example document.addEventListener("securitypolicyviolation", (e) => { console.log(e.blockedURI); }); Specifications Specification Status Comment Content Security Policy Level 3The definition of 'blockedURI' in that specification. Working Draft Initial definition ...
SecurityPolicyViolationEvent.documentURI - Web APIs
The documentURI read-only property of the SecurityPolicyViolationEvent interface is a
USVString representing the URI of the document or worker in which the violation was found. Syntax let documentURI = violationEventInstance.documentURI; Value A
USVString representing the URI of the document or worker in which the violation was found. Example document.addEventListener("securitypolicyviolation", (e) => { console.log(e.documentURI); }); Specifications Specification Status Comment Content Security Policy Level 3The definition of 'documentURI' in that specification. Working Draft Initial definition ...
SecurityPolicyViolationEvent.referrer - Web APIs
The referrer read-only property of the SecurityPolicyViolationEvent interface is a
USVString representing the referrer of the resources whose policy was violated. This will be a URL or null. Syntax let referrer = violationEventInstance.referrer; Value A
USVString representing the URL of the referrer of the violating resources. Example document.addEventListener("securitypolicyviolation", (e) => { console.log(e.referrer); }); Specifications Specification Status Comment Content Security Policy Level 3The definition of 'referrer' in that specification. Working Draft Initial definition ...
SecurityPolicyViolationEvent.sourceFile - Web APIs
The sourceFile read-only property of the SecurityPolicyViolationEvent interface is a
USVString representing the URI of the document or worker in which the violation was found. Syntax let source = violationEventInstance.sourceFile; Value A
USVString representing the URI of the document or worker in which the violation was found. Example document.addEventListener("securitypolicyviolation", (e) => { console.log(e.sourceFile); }); Specifications Specification Status Comment Content Security Policy Level 3The definition of 'sourceFile' in that specification. Working Draft Initial definition ...
ServiceWorker.scriptURL - Web APIs
Returns the ServiceWorker serialized script URL defined as part of ServiceWorkerRegistration. Must be on the same origin as the document that registers the ServiceWorker. Syntax someURL = ServiceWorker.scriptURL Value A
USVString (see the WebIDL definition of
USVString.) Examples TBD Specifications Specification Status Comment Service WorkersThe definition of 'scriptURL' in that specification. Working Draft Initial definition ...
ServiceWorkerContainer.register() - Web APIs
hat is narrower than the default. Syntax serviceWorkerContainer.register(scriptURL, options) .then(function(serviceWorkerRegistration) { ... }); Parameters scriptURL The URL of the service worker script. The registered service worker file needs to have a valid JavaScript MIME type. options Optional An object containing registration options. Currently available options are: scope: A
USVString representing a URL that defines a service worker's registration scope; that is, what range of URLs a service worker can control. This is usually a relative URL. It is relative to the base URL of the application. By default, the scope value for a service worker registration is set to the directory where the service worker script is located. See the Examples section for more information on how it w...
TextEncoder - Web APIs
t8Array(3) [226, 130, 172] Constructor TextEncoder() Returns a newly constructed TextEncoder that will generate a byte stream with UTF-8 encoding. Properties The TextEncoder interface doesn't inherit any property. TextEncoder.prototype.encodingRead only Always returns "utf-8". Methods The TextEncoder interface doesn't inherit any method. TextEncoder.prototype.encode() Takes a
USVString as input, and returns a Uint8Array containing UTF-8 encoded text. TextEncoder.prototype.encodeInto() Takes a
USVString to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding. This is potentially more performant than the older encode() method. Polyfill The below polyfill is compliant with the sta...
URL() - Web APIs
The URL() constructor returns a newly created URL object representing the URL defined by the parameters. If the given base URL or the resulting URL are not valid URLs, the JavaScript TypeError exception is thrown. Note: This feature is available in Web Workers. Syntax const url = new URL(url [, base]) Parameters url A
USVString 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 Optional A
USVString representing the base URL to use in case url is a relative URL. If not specified, it defaults to ''. Note: You can still use an existing URL object for the base, which stringifies itself to the object's href property. Exceptions Exception Explan...
URL.host - Web APIs
The host property of the URL interface is a
USVString containing the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', followed by the port of the URL. Note: This feature is available in Web Workers. Syntax const host = url.host url.host = newHost Value A
USVString. Examples let url = new URL('/docs/Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org" url = new URL('https://developer.mozilla.org:443/docs/Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org" // The port number is not included because 443 is the scheme's default port url = new URL('https://developer.mozilla.org:4097/docs/Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org:4097" Specifications Specification Status Comment ...
URL.hostname - Web APIs
Examples const url = new URL('/docs/Web/API/URL/hostname'); console.log(url.hostname); // Logs: 'developer.mozilla.org' Specifications Specification Status Comment URLThe definition of 'URL.hostname' in that specification. ...
URL.href - Web APIs
Examples const url = new URL('/docs/Web/API/URL/href'); console.log(url.href); // Logs: '/docs/Web/API/URL/href' Specifications Specification Status Comment URLThe definition of 'URL.href' in that specification. ...
URL.origin - Web APIs
The origin read-only property of the URL interface returns a
USVString containing the Unicode serialization of the origin of the represented URL. The exact structure varies depending on the type of URL: For http or https URLs, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified). For file: URLs, the value is browser dependant. for blob: URLs, the origin of the URL following blob: will be used, e.g "blob:https://mozilla.org" will be returned as "https://mozilla.org". Note: This feature is available in Web Workers. Syntax const originString = url.origin Value A
USVString. Examples const url = new URL("blob:https://mozilla.org:443/") console.log(url.origin); // Logs 'https://mozi...
URL.search - Web APIs
The search property of the URL interface is a search string, also called a query string, that is a
USVString containing a '?' followed by the parameters of the URL. Modern browsers provide the URL.searchParams property to make it easy to parse out the parameters from the query string. Note: This feature is available in Web Workers. Syntax const searchParams = object.search url.search = newSearchParams Value A
USVString. Examples const url = new URL('/docs/Web/API/URL/search?q=123'); console.log(url.search); // Logs "?q=123" Specifications Specification Status Comment URLThe definition of 'URL.search' in that specification. Living Standard Initial definition. ...
URL.search - Web APIs
The search property of the URL interface is a search string, also called a query string, that is a
USVString containing a '?' followed by the parameters of the URL. Modern browsers provide the URL.searchParams property to make it easy to parse out the parameters from the query string. Note: This feature is available in Web Workers. Syntax const searchParams = object.search url.search = newSearchParams Value A
USVString. Examples const url = new URL('/docs/Web/API/URL/search?q=123'); console.log(url.search); // Logs "?q=123" Specifications Specification Status Comment URLThe definition of 'URL.search' in that specification. Living Standard Initial definition. ...
URL.toJSON() - Web APIs
The toJSON() method of the URL interface returns a
USVString containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString(). Note: This feature is available in Web Workers. Syntax const href = url.toJSON() Return value A
USVString. Examples const url = new URL("/docs/Web/API/URL/toString"); url.toJSON(); // should return the URL as a string Specifications Specification Status Comment URLThe definition of 'toJSON()' in that specification. Living Standard Initial definition. ...
URL.toString() - Web APIs
Examples const url = new URL("/docs/Web/API/URL/toString"); url.toString(); // should return the URL as a string Specifications Specification Status Comment URLThe definition of 'stringifier' in that specification. ...
URL.username - Web APIs
Examples const url = new URL('https://anonymous:flabada@developer.mozilla.org/docs/Web/API/URL/username'); console.log(url.username) // Logs "anonymous" Specifications Specification Status Comment URLThe definition of 'username' in that specification. ...
URLSearchParams.get() - Web APIs
The get() method of the URLSearchParams interface returns the first value associated to the given search parameter. Note: This feature is available in Web Workers. Syntax URLSearchParams.get(name) Parameters name The name of the parameter to return. Return value A
USVString if the given search parameter is found; otherwise, null. Examples If the URL of your page is https://example.com/?name=Jonathan&age=18 you could parse out the 'name' and 'age' parameters using: let params = new URLSearchParams(document.location.search.substring(1)); let name = params.get("name"); // is the string "Jonathan" let age = parseInt(params.get("age"), 10); // is the number 18 Requesting a parameter that isn't present in the query string will return null: let address = params.get("address"); // null S...
URLSearchParams.getAll() - Web APIs
The getAll() method of the URLSearchParams interface returns all the values associated with a given search parameter as an array. Note: This feature is available in Web Workers. Syntax URLSearchParams.getAll(name) Parameters name The name of the parameter to return. Return value An array of
USVStrings. Examples let url = new URL('https://example.com?foo=1&bar=2'); let params = new URLSearchParams(url.search.slice(1)); //Add a second foo parameter. params.append('foo', 4); console.log(params.getAll('foo')) //Prints ["1","4"]. Specifications Specification Status Comment URLThe definition of 'getAll()' in that specification. Living Standard Initial definition. ...
WebSocket.send() - Web APIs
e server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. Syntax WebSocket.send("Hello server!"); Parameters data The data to send to the server. It may be one of the following types:
USVString A text string. The string is added to the buffer in UTF-8 format, and the value of bufferedAmount is increased by the number of bytes required to represent the UTF-8 string. ArrayBuffer You can send the underlying binary data used by a typed array object; its binary data contents are queued in the buffer, increasing the value of bufferedAmount by the requisite number of bytes. Blob Spec...
WindowOrWorkerGlobalScope.origin - Web APIs
Examples Executed from inside a worker script, the following snippet will log the worker's global scope's origin to the console each time it receives a message onmessage = function() { console.log(self.origin); }; If the origin is not a scheme/host/port tuple (say you are trying to run it locally, i.e. via file:// URL), origin will return the string "null". ...
Worker() - Web APIs
the specified URL. This script must obey the same-origin policy. Note: that there is a disagreement among browser manufacturers about whether a data URI is of the same origin or not. Though Gecko 10.0 (Firefox 10.0 / Thunderbird 10.0 / SeaMonkey 2.7) and later accept data URIs, that's not the case in all other browsers. Syntax var myWorker = new Worker(aURL, options); Parameters aURL A
USVString representing the URL of the script the worker will execute. It must obey the same-origin policy. options Optional An object containing option properties that can be set when creating the object instance. Available properties are as follows: type: A DOMString specifying the type of worker to create. The value can be classic or module. If not specified, the default used is classic. credenti...
XMLHttpRequest.send() - Web APIs
been set using the setRequestHeader(), an Accept header with the type "*/*" (any type) is sent. Syntax XMLHttpRequest.send(body) Parameters body Optional A body of data to be sent in the XHR request. This can be: A Document, in which case it is serialized before being sent. An XMLHttpRequestBodyInit, which per the Fetch spec can be a Blob, BufferSource, FormData, URLSearchParams, or
USVString object. null If no value is specified for the body, a default value of null is used. The best way to send binary content (e.g. in file uploads) is by using an ArrayBufferView or Blob in conjunction with the send() method. Return value undefined. Exceptions Exception Description InvalidStateError send() has already been invoked for the request, and/or the req...
Web APIs
ackEvent Transferable TransformStream TransitionEvent TreeWalker TypeInfo U UIEvent ULongRange URL URLSearchParams URLUtilsReadOnly USB USBAlternateInterface USBConfiguration USBDevice USBEndpoint USBInTransferResult USBInterface USBIsochronousInTransferPacket USBIsochronousInTransferResult USBIsochronousOutTransferPacket USBIsochronousOutTransferResult USBOutTransferResult
USVString UserDataHandler UserProximityEvent V VTTCue VTTRegion ValidityState VideoConfiguration VideoPlaybackQuality VideoTrack VideoTrackList VisualViewport W WEBGL_color_buffer_float WEBGL_compressed_texture_astc WEBGL_compressed_texture_atc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_pvrtc WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_sr...
WebAssembly.Global() constructor - JavaScript
) constructor creates a new Global object representing a global variable instance, accessible from both JavaScript and importable/exportable across one or more WebAssembly.Module instances. This allows dynamic linking of multiple modules. Syntax new WebAssembly.Global(descriptor, value); Parameters descriptor A GlobalDescriptor dictionary object, which contains two properties: value: A
USVString representing the data type of the global. This can be one of i32, i64, f32, and f64. mutable: A boolean value that determines whether the global is mutable or not. By default, this is false. value The value the variable contains. This can be any value, as long as its type matches the variable's data type. If no value is specified, a typed 0 value is used, as specified by the DefaultValue ...