Search completed in 1.00 seconds.
RTCPeerConnection.setRemoteDescription() - Web APIs
the rtcpeerconnection method setremote
description() sets the specified session
description as the remote peer's current offer or answer. the
description specifies the properties of the remote end of the connection, including the media format. the method takes a single parameter—the session
description—and it returns a promise which is fulfilled once the
description has been changed, asynchronously. this is typically called after receiving an offer or answer from another peer over the signaling server. keep in mind that if setremote
description() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions). ...
...on—and it returns a promise which is fulfilled once the
description has been changed, asynchronously. this is typically called after receiving an offer or answer from another peer over the signaling server. keep in mind that if setremote
description() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions). because
descriptions will be exchanged until the two peers agree on a configuration, the
description submitted by calling setremote
description() does not immediately take effect. instead, the current connection configuration remains in place until negotiation is complete. only then does the agreed-upon configuration take effect. ...
...network conditions). because
descriptions will be exchanged until the two peers agree on a configuration, the
description submitted by calling setremote
description() does not immediately take effect. instead, the current connection configuration remains in place until negotiation is complete. only then does the agreed-upon configuration take effect. syntax apromise = rtcpeerconnection.setremote
description(session
description); parameters session
description an rtcsession
descriptioninit or rtcsession
description which specifies the remote peer's current offer or answer. ...
...And 18 more matches
RTCPeerConnection.setLocalDescription() - Web APIs
the rtcpeerconnection method setlocal
description() changes the local
description associated with the connection. this
description specifies the properties of the local end of the connection, including the media format. the method takes a single parameter—the session
description—and it returns a promise which is fulfilled once the
description has been changed, asynchronously. if setlocal
description() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions). because
descriptions will be exchanged until the two peers agree on a configuration, the
description submitted by calling setlocal
description() does not immediately take effect. instead, the current connection configuration remains in place until negotiation is com...
...ng network conditions). because
descriptions will be exchanged until the two peers agree on a configuration, the
description submitted by calling setlocal
description() does not immediately take effect. instead, the current connection configuration remains in place until negotiation is complete. only then does the agreed-upon configuration take effect. syntax apromise = rtcpeerconnection.setlocal
description(session
description); pc.setlocal
description(session
description, successcallback, errorcallback); parameters session
description optional an rtcsession
descriptioninit or rtcsession
description which specifies the configuration to be applied to the local end of the connection. ...
...hen does the agreed-upon configuration take effect. syntax apromise = rtcpeerconnection.setlocal
description(session
description); pc.setlocal
description(session
description, successcallback, errorcallback); parameters session
description optional an rtcsession
descriptioninit or rtcsession
description which specifies the configuration to be applied to the local end of the connection. if the
description is omitted, the webrtc runtime tries to automatically do the right thing. implicit
description if you don't explicity provide a session
description, the webrtc runtime will try to handle it correctly. if the signaling state is one of stable, have-local-offer, or have-remote-pranswer, the webrtc runtime automatically creates a new offer and sets that as the new local
description. otherwise, set...
...And 12 more matches
OpenSearch description format
the opensearch
description format lets a website describe a search engine for itself, so that a browser or other client application can use that search engine. opensearch is supported by (at least) firefox, edge, internet explorer, safari, and chrome. (see reference material for links to other browsers' documentation.) firefox also supports additional features not in the opensearch standard, such as search suggestions and the <searchform> element. this article focuses on creating opensearch-compatible search plugins that support these additional firefox features. opensearch
description files can be advertised as described in autodiscovery of search plugins, and can be installed programmatically as described in adding search engines from web pages. ...
...he opensearch standard, such as search suggestions and the <searchform> element. this article focuses on creating opensearch-compatible search plugins that support these additional firefox features. opensearch
description files can be advertised as described in autodiscovery of search plugins, and can be installed programmatically as described in adding search engines from web pages. opensearch
description file the xml file that describes a search engine follows the basic template below. sections in [square brackets] should be customized for the specific plugin you're writing. ...
... opensearch
description files can be advertised as described in autodiscovery of search plugins, and can be installed programmatically as described in adding search engines from web pages. opensearch
description file the xml file that describes a search engine follows the basic template below. sections in [square brackets] should be customized for the specific plugin you're writing. ...
...And 9 more matches
Localizing extension descriptions
each has at least one em:locale property marking the locale that the information should be used for and then all the various strings for the locale. ...
...each has at least one em:locale property marking the locale that the information should be used for and then all the various strings for the locale. ...
...each has at least one em:locale property marking the locale that the information should be used for and then all the various strings for the locale. ...
...And 8 more matches
RTCSessionDescription() - Web APIs
that dictionary has the following properties: type required. ...
...that dictionary has the following properties: type required. ...
...that dictionary has the following properties: type required. ...
...And 8 more matches
RTCSessionDescriptionCallback - Web APIs
return value the callback doesn't need to return anything, so the return value is undefined. ...
... return value the callback doesn't need to return anything, so the return value is undefined. ...
...back type is used to represent the callback function passed into the deprecated callback-based version of createoffer() or createanswer() when using them to create offers or answers. because this function type is part of the legacy webrtc api, you should avoid using it (and the callback-based forms of createoffer() and createanswer() that make use of it). ...
...And 8 more matches
RTCSessionDescription - Web APIs
the rtcsession
description interface describes one end of a connection—or potential connection—and how it's configured. each rtcsession
description consists of a
description type indicating which part of the offer/answer negotiation process it describes and of the sdp descriptor of the session. the process of negotiating a connection between two peers involves exchanging rtcsession
description objects back and forth, with each
description suggesting one combination of connection configuration options that the sender of the
description supports. once the two peers agree upon a configuration for the connection, negotiation is complete. properties the rtcsession
description interface doesn't inherit any properties. ...
... between two peers involves exchanging rtcsession
description objects back and forth, with each
description suggesting one combination of connection configuration options that the sender of the
description supports. once the two peers agree upon a configuration for the connection, negotiation is complete. properties the rtcsession
description interface doesn't inherit any properties. rtcsession
description.type read only an enum of type rtcsdptype describing the session
description's type. rtcsession
description.sdp read only a domstring containing the sdp describing the session. constants rtcsdptype this enum defines strings that describe the current state of the session
description, as used in the type property. ...
...rface doesn't inherit any properties. rtcsession
description.type read only an enum of type rtcsdptype describing the session
description's type. rtcsession
description.sdp read only a domstring containing the sdp describing the session. constants rtcsdptype this enum defines strings that describe the current state of the session
description, as used in the type property. the session
description's type will be specified using one of these values. value
description answer the sdp contained in the sdp property is the definitive choice in the exchange. in other words, this session
description describes the agreed-upon configuration, and is being sent to finalize negotiation. ...
...And 6 more matches
<dl>: The Description List element - HTML: Hypertext Markup Language
common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, and if the <dl> element's children include one name-value group, palpable content. ...
... tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. implicit aria role no corresponding role permitted aria roles group, list, none, presentation dom interface htmldlistelement attributes this element only includes the global attributes. ...
...ria roles group, list, none, presentation dom interface htmldlistelement attributes this element only includes the global attributes. examples single term and
description <dl> <dt>firefox</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers. ...
...And 4 more matches
Label and description - Archive of obsolete content
line breaking under normal conditions, a
description will not break long-running text and the text may be cropped or hidden. to cause the text to wrap: ensure the long-running text is a text node child of <
description/> or <label/> (i.e., do not specify the long-running text in the value attribute of these elements). the default style for these xul elements includes white-space: wrap;. this reduces all whitespace chunks (including newlines) to single spaces. text is permitted to wrap. <
description>i am your father's brother's nephew's cousin's former roommate. what's that make us? ...
...iption/> or <label/> (i.e., do not specify the long-running text in the value attribute of these elements). the default style for these xul elements includes white-space: wrap;. this reduces all whitespace chunks (including newlines) to single spaces. text is permitted to wrap. <
description>i am your father's brother's nephew's cousin's former roommate. what's that make us? absolutely nothing!</
description> with white-space: pre; all whitespace, including newlines, is rendered literally. ...
...reduces all whitespace chunks (including newlines) to single spaces. text is permitted to wrap. <
description>i am your father's brother's nephew's cousin's former roommate. what's that make us? absolutely nothing!</
description> with white-space: pre; all whitespace, including newlines, is rendered literally. text cannot wrap automatically but can still be achieved with <html:br/> if desired. <
description style="white-space: pre-wrap;">i am your father's brother's nephew's cousin's former roommate. what's that make us? absolutely nothing!</
description> with white-space: pre-wrap; all whitespace is rendered literally, but text is additionally permitted to wrap at spaces. note: prior to firefox 3, it was necessary to use -moz-pre-wrap instead of -pre-wrap. you may wish to use both for backward c...
...And 3 more matches
description - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to create a block of text. the text can be set either with the value attribute or by placing text inside the open and close
description tags. the value attribute is used to set text that appears in a single line. if text appears as a child of the
description, it will wrap to multiple lines. it may contain arbitrary markup, which can be styled as needed. more information is available in the xul tutorial. ...
...ill wrap to multiple lines. it may contain arbitrary markup, which can be styled as needed. more information is available in the xul tutorial. ...
...s needed. more information is available in the xul tutorial. attributes crop, disabled, tabindex value properties accessibletype, crop, disabled, tabindex, value style classes header, indent, monospace, plain, small-margin examples this is a long section of text that will word wrap when displayed <
description> this is a long section of text that will word wrap when displayed. ...
...And 3 more matches
NP_GetMIMEDescription - Archive of obsolete content
np_getmime
description returns a supported mime type list for your plugin. it works on unix (linux) and macos. on windows you have to define supported mimetypes in the dll resource file. each mime type
description should be separated by a semicolon (;). each mime type
description contains the mime type, an extensions list and a short
description. ...
...) and macos. on windows you have to define supported mimetypes in the dll resource file. each mime type
description should be separated by a semicolon (;). each mime type
description contains the mime type, an extensions list and a short
description. ...
... type
description should be separated by a semicolon (;). each mime type
description contains the mime type, an extensions list and a short
description. one mime type // example inside http://mxr.mozilla.org/mozilla-central/source/modules/plugin/sdk/samples/basic/unix/plugin.cpp #define mime_type_
description "application/basic-plugin:bsp:basic example plug-in for mozilla" const char* np_getmime
description(void) { return(mime_types_
description); } two mime types const char* np_getmime
description(void) { return "application/basic-example-plugin:xmp1:example 1;application/basic-example2-plugin:xmp2, xm2p:example 2"; } gnome integration if you use gnome vfs (gnome-vfs-2.0), you can get the mime type
description with a function. #include <libgnomevfs/gnome-vfs-mime-handlers.h> #include <libgno...
...And 3 more matches
RTCSessionDescription.sdp - Web APIs
the property rtcsession
description.sdp is a read-only domstring containing the sdp which describes the session. ...
... the property rtcsession
description.sdp is a read-only domstring containing the sdp which describes the session. ...
... the property rtcsession
description.sdp is a read-only domstring containing the sdp which describes the session. ...
...And 3 more matches
Symbol.prototype.description - JavaScript
the read-only
description property is a string returning the optional
description of symbol objects. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description symbol objects can be created with an optional
description which can be used for debugging but not to access the symbol itself. the symbol.prototype.
description property can be used to read that
description. it is different to symbol.prototype.tostring() as it does not contain the enclosing "symbol()" string. see the examples. ...
...ve-examples and send us a pull request.
description symbol objects can be created with an optional
description which can be used for debugging but not to access the symbol itself. the symbol.prototype.
description property can be used to read that
description. it is different to symbol.prototype.tostring() as it does not contain the enclosing "symbol()" string. see the examples. ...
... created with an optional
description which can be used for debugging but not to access the symbol itself. the symbol.prototype.
description property can be used to read that
description. it is different to symbol.prototype.tostring() as it does not contain the enclosing "symbol()" string. see the examples. ...
...And 3 more matches
RTCPeerConnection.currentLocalDescription - Web APIs
the read-only property rtcpeerconnection.currentlocal
description returns an rtcsession
description object describing the local end of the connection as it was most recently successfully negotiated since the last time the rtcpeerconnection finished negotiating and connecting to a remote peer. also included is a list of any ice candidates that may already have been generated by the ice agent since the offer or answer represented by the
description was first instantiated. to change the currentlocal
description, call rtcpeerconnection.setlocal
description(), which triggers a series of events which leads to this value being set. for details on what exactly happens and why the change isn't necessarily instantaneous, see pending and current
descriptions in webrtc connectivity. unlike rtcpeerconnection.loc...
...answer represented by the
description was first instantiated. to change the currentlocal
description, call rtcpeerconnection.setlocal
description(), which triggers a series of events which leads to this value being set. for details on what exactly happens and why the change isn't necessarily instantaneous, see pending and current
descriptions in webrtc connectivity. unlike rtcpeerconnection.local
description, this value represents the actual current state of the local end of the connection; local
description may specify a
description which the connection is currently in the process of switching over to. syntax session
description = rtcpeerconnection.currentlocal
description; return value the current
description of the local end of the connection, if one has been set. if none has been successfully s...
... connection; local
description may specify a
description which the connection is currently in the process of switching over to. syntax session
description = rtcpeerconnection.currentlocal
description; return value the current
description of the local end of the connection, if one has been set. if none has been successfully set, this value is null. example this example looks at the currentlocal
description and displays an alert containing the rtcsession
description object's type and sdp fields. ...
...rconnection.currentlocal
description; return value the current
description of the local end of the connection, if one has been set. if none has been successfully set, this value is null. example this example looks at the currentlocal
description and displays an alert containing the rtcsession
description object's type and sdp fields. var pc = new rtcpeerconnection(); … var sd = pc.currentlocal
description; if (sd) { alert("local session: type='" + sd.type + "'; sdp
description='" + sd.sdp + "'"); } else { alert("no local session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.currentlocal
description' in that specification. candidate recommendation ...
RTCPeerConnection.currentRemoteDescription - Web APIs
the read-only property rtcpeerconnection.currentremote
description returns an rtcsession
description object describing the remote end of the connection as it was most recently successfully negotiated since the last time the rtcpeerconnection finished negotiating and connecting to a remote peer. also included is a list of any ice candidates that may already have been generated by the ice agent since the offer or answer represented by the
description was first instantiated. to change the currentremote
description, call rtcpeerconnection.setremote
description(), which triggers a series of events which leads to this value being set. for details on what exactly happens and why the change isn't necessarily instantaneous, see pending and current
descriptions in webrtc connectivity. unlike rtcpeerconnection.
...wer represented by the
description was first instantiated. to change the currentremote
description, call rtcpeerconnection.setremote
description(), which triggers a series of events which leads to this value being set. for details on what exactly happens and why the change isn't necessarily instantaneous, see pending and current
descriptions in webrtc connectivity. unlike rtcpeerconnection.remote
description, this value represents the actual current state of the local end of the connection; remote
description may specify a
description which the connection is currently in the process of switching over to. syntax session
description = rtcpeerconnection.currentremote
description; return value the current
description of the remote end of the connection, if one has been set. if none has been successfull...
...nection; remote
description may specify a
description which the connection is currently in the process of switching over to. syntax session
description = rtcpeerconnection.currentremote
description; return value the current
description of the remote end of the connection, if one has been set. if none has been successfully set, this value is null. example this example looks at the currentremote
description and displays an alert containing the rtcsession
description object's type and sdp fields. ...
...nection.currentremote
description; return value the current
description of the remote end of the connection, if one has been set. if none has been successfully set, this value is null. example this example looks at the currentremote
description and displays an alert containing the rtcsession
description object's type and sdp fields. var pc = new rtcpeerconnection(); … var sd = pc.currentremote
description; if (sd) { alert("local session: type='" + sd.type + "'; sdp
description='" + sd.sdp + "'"); } else { alert("no local session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.currentremote
description' in that specification. candidate recommendation ...
Error.description - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the error.
description property returns or sets the descriptive string associated with a specific error. syntax object .
description [= stringexpression] parameters object required. any instance of an error object. stringexpression optional. a string expression containing a
description of the error. remarks the
description property contains the error message string associated with a specific error. use the value contained in this property to alert a user to an error. the
description and message properties provide the same functionality; the
descriptionproperty provides backward compatibility; the message property complies with the ecma standard. example the following example illus...
...escription property contains the error message string associated with a specific error. use the value contained in this property to alert a user to an error. the
description and message properties provide the same functionality; the
descriptionproperty provides backward compatibility; the message property complies with the ecma standard. example the following example illustrates the use of the
description property. ...
...ility; the message property complies with the ecma standard. example the following example illustrates the use of the
description property. try { // cause an error: x = y } catch(e) { // prints "[object error]": document.write(e) document.write (" "); // prints 5009: document.write((e.number & 0xffff)) document.write (" "); // prints "'y' is undefined": document.write(e.
description); document.write (" "); // prints "'y' is undefined": document.write(e.message) } requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards. also supported in store apps (windows 8 and windows ph...
RTCPeerConnection.pendingLocalDescription - Web APIs
the read-only property rtcpeerconnection.pendinglocal
description returns an rtcsession
description object describing a pending configuration change for the local end of the connection. this does not describe the connection as it currently stands, but as it may exist in the near future. use rtcpeerconnection.currentlocal
description or rtcpeerconnection.local
description to get the current state of the endpoint. for details on the difference, see pending and current
descriptions in webrtc connectivity. syntax session
description = rtcpeerconnection.pendinglocal
description; return value if a local
description change is in progress, this is an rtcsession
description describing the proposed configuration. otherwise, this returns null. ...
... state of the endpoint. for details on the difference, see pending and current
descriptions in webrtc connectivity. syntax session
description = rtcpeerconnection.pendinglocal
description; return value if a local
description change is in progress, this is an rtcsession
description describing the proposed configuration. otherwise, this returns null. example this example looks at the pendinglocal
description to determine whether or not there's a
description change being processed. ...
...peerconnection.pendinglocal
description; return value if a local
description change is in progress, this is an rtcsession
description describing the proposed configuration. otherwise, this returns null. example this example looks at the pendinglocal
description to determine whether or not there's a
description change being processed. var pc = new rtcpeerconnection(); … var sd = pc.pendinglocal
description; if (sd) { // there's a
description change underway! } else { // no
description change pending } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.pendinglocal
description' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.pendingRemoteDescription - Web APIs
the read-only property rtcpeerconnection.pendingremote
description returns an rtcsession
description object describing a pending configuration change for the remote end of the connection. this does not describe the connection as it currently stands, but as it may exist in the near future. use rtcpeerconnection.currentremote
description or rtcpeerconnection.remote
description to get the current session
description for the remote endpoint. for details on the difference, see pending and current
descriptions in webrtc connectivity. syntax session
description = rtcpeerconnection.pendingremote
description; return value if a remote
description change is in progress, this is an rtcsession
description describing the proposed configuration. otherwise, this returns null. example this example looks at the pendin...
...the remote endpoint. for details on the difference, see pending and current
descriptions in webrtc connectivity. syntax session
description = rtcpeerconnection.pendingremote
description; return value if a remote
description change is in progress, this is an rtcsession
description describing the proposed configuration. otherwise, this returns null. example this example looks at the pendingremote
description to determine whether or not there's a
description change being processed. ...
...connection.pendingremote
description; return value if a remote
description change is in progress, this is an rtcsession
description describing the proposed configuration. otherwise, this returns null. example this example looks at the pendingremote
description to determine whether or not there's a
description change being processed. var pc = new rtcpeerconnection(); … var sd = pc.pendingremote
description; if (sd) { // there's a
description change underway! } else { // no
description change pending } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.pendingremote
description' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.remoteDescription - Web APIs
the read-only property rtcpeerconnection.remote
description returns a rtcsession
description describing the session (which includes configuration and media information) for the remote end of the connection. if this hasn't been set yet, this is null. the returned value typically reflects a remote
description which has been received over the signaling server (as either an offer or an answer) and then put into effect by your code calling rtcpeerconnection.setremote
description() in response. syntax var session
description = peerconnection.remote
description; on a more fundamental level, the returned value is the value of rtcpeerconnection.pendingremote
description if that property isn't null; otherwise, the value of rtcpeerconnection.currentremote
description is returned. see pending and current descri...
...erconnection.remote
description; on a more fundamental level, the returned value is the value of rtcpeerconnection.pendingremote
description if that property isn't null; otherwise, the value of rtcpeerconnection.currentremote
description is returned. see pending and current
descriptions in webrtc connectivity for details on this algorithm and why it's used. example this example looks at the remote
description and displays an alert containing the rtcsession
description object's type and sdp fields. ...
...sn't null; otherwise, the value of rtcpeerconnection.currentremote
description is returned. see pending and current
descriptions in webrtc connectivity for details on this algorithm and why it's used. example this example looks at the remote
description and displays an alert containing the rtcsession
description object's type and sdp fields. var pc = new rtcpeerconnection(); … var sd = pc.remote
description; if (sd) { alert("remote session: type='" + sd.type + "'; sdp
description='" + sd.sdp + "'"); } else { alert("no remote session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.remote
description' in that specification. candidate recommendation init...
RTCSessionDescription.toJSON() - Web APIs
example // sd is a rtcsessiondescriptor alert(json.stringify(sd)); // this call the tojson() method behind the scene. ...
... example // sd is a rtcsessiondescriptor alert(json.stringify(sd)); // this call the tojson() method behind the scene. ...
...ype and sdp, are contained in the generated json. syntax var jsonvalue = sd.tojson(); the result value is a json object containing the following values: "type", containing the value of the rtcsession
description.type property and can be one of the following values: "offer", "answer", "pranswer" or null. "sdp", containing a domstring, or null, with the sdp message corresponding to rtcsession
description.sdp property. example // sd is a rtcsessiondescriptor alert(json.stringify(sd)); // this call the tojson() method behind the scene. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsession
description: tojson()' in that specification. candidate recommendation initial specification. ...
RDF: Resource Description Framework for metadata - Archive of obsolete content
the rdf family of specifications is maintained by the world wide web consortium (w3c). the rdf metadata model is based upon the idea of making statements about resources in the form of a subject-predicate-object expression, called a triple in rdf terminology. the subject is the resource, the "thing" being described. the predicate is a trait or aspect about that resource, and often expresses a relationship between the subject and the object. the object is the object of the relationship or value of that trait. documentation directions of the mozilla rdf engine this presentation shows new developments in the mozilla rdf engine. ...
...n the subject and the object. the object is the object of the relationship or value of that trait. documentation directions of the mozilla rdf engine this presentation shows new developments in the mozilla rdf engine. these include plans to expose the rdf api to public web content, as well as performance and correctness improvements. what is rdf tim bray's introduction to the resource
description framework, at xml.com. rdf datasource how-to a cookbook-style document describing how to create a native, client-side datasource that works with mozilla's rdf implementation. view all... community view mozilla forums... mailing list newsgroup rss feed rdf-dev mailing list tools rdf editors and tools rdf validator related topics xml categories interwiki ...
Description
« nsiaccessible page summary accessible
description -- long text associated with this node. ...
... « nsiaccessible page summary accessible
description -- long text associated with this node. ...
GetActionDescription
exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ns_error_invalid_arg indicates that the given index is our of range. ...
...exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ns_error_invalid_arg indicates that the given index is our of range. ...
RTCPeerConnection.localDescription - Web APIs
the read-only property rtcpeerconnection.local
description returns an rtcsession
description describing the session for the local end of the connection. if it has not yet been set, this is null. syntax var session
description = peerconnection.local
description; on a more fundamental level, the returned value is the value of rtcpeerconnection.pendinglocal
description if that property isn't null; otherwise, the value of rtcpeerconnection.currentlocal
description is returned. see pending and current
descriptions in webrtc connectivity for details on this algorithm and why it's used. example this example looks at the local
description and displays an alert containing the rtcsession
description object's type and sdp fields. ...
...y isn't null; otherwise, the value of rtcpeerconnection.currentlocal
description is returned. see pending and current
descriptions in webrtc connectivity for details on this algorithm and why it's used. example this example looks at the local
description and displays an alert containing the rtcsession
description object's type and sdp fields. var pc = new rtcpeerconnection(); … var sd = pc.local
description; if (sd) { alert("local session: type='" + sd.type + "'; sdp
description='" + sd.sdp + "'"); } else { alert("no local session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.local
description' in that specification. candidate recommendation initial...
RTCSessionDescription.type - Web APIs
the property rtcsession
description.type is a read-only value of type rtcsdptype which describes the
description's type. syntax var value = session
description.type; session
description.type = value; value the possible values are defined by an enum of type rtcsdptype. the allowed values are those of an enum of type rtcsdptype: "offer", the
description is the initial proposal in an offer/answer exchange. "answer", the
description is the definitive choice in an offer/answer exchange. "pranswer", the
description is a provisional answer and may be changed when the definitive choice will be given. "rollback", the
description rolls back to offer/answer state to the last stable state. ...
...tcsdptype: "offer", the
description is the initial proposal in an offer/answer exchange. "answer", the
description is the definitive choice in an offer/answer exchange. "pranswer", the
description is a provisional answer and may be changed when the definitive choice will be given. "rollback", the
description rolls back to offer/answer state to the last stable state. example // the remote
description has been set previously on pc, a rtcpeerconnection alert(pc.remote
description.type); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsession
description.type' in that specification. candidate recommendation initial specification. ...
<dt>: The Description Term element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. ...
... the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. ...
<dd>: The Description Details element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content flow content. tag omission the start tag is required. the end tag may be omitted if the <dd> element is immediately followed by another <dd> element or a <dt> element, or if there is no more content in the parent element. permitted parents <dl> or (in whatwg html) a <div> that is inside a <dl>. ...
description - Web app manifests
type string mandatory no the
description member is a string in which developers can explain what the application does.
description is directionality-capable, which means it can be displayed left to right or right to left based on the values of the dir and lang manifest members. examples simple
description in left-to-right language: "
description": "awesome application that will help you achieve your dreams."
description in arabic, which will be displayed right-to-left: "dir": "rtl", "lang": "ar", "
description": ".تطبيق رائع سيساعدك على تحقيق أحلامك" specification specification status comment feedback web app manifestthe definition of '
description' in that specification. working draft ...
nsIXPConnect
currentnativecallcontext nsaxpcnativecallcontextptr read only. deferreleasesuntilaftergarbagecollection prbool obsolete since gecko 1.9 pendingexception nsiexception constants constant value descr...
...ption collectgarbageonmainthreadonly prbool obsolete since gecko 1.9 currentjsstack nsistackframe read only. currentnativecallcontext nsaxpcnativecallcontextptr read only. deferreleasesuntilaftergarbagecollection prbool obsolete since gecko 1.9 pendingexception nsiexception constants constant value
description init_js_standard_classes 1 << 0 flag_system_global_object 1 << 1 omit_components_object 1 << 2 xpc_xow_clearscope 1 tells updatexows() to clear the scope of all of the xows it finds. obsolete since gecko 2.0 methods native code only!addjsholder root js objects held by aholder. void addjsholder( in voidptr aholder, in ...
... 2 xpc_xow_clearscope 1 tells updatexows() to clear the scope of all of the xows it finds. obsolete since gecko 2.0 methods native code only!addjsholder root js objects held by aholder. void addjsholder( in voidptr aholder, in nsscriptobjecttracerptr atracer ); parameters aholder the object that hold the js objects that should be rooted. atracer missing
description exceptions thrown missing exception missing
description clearallwrappednativesecuritypolicies() void clearallwrappednativesecuritypolicies(); parameters none. exceptions thrown missing exception missing
description native code only!createsandbox create a sandbox for evaluating code in isolation using evalinsandboxobject(). nsixpconnectjsobjectholder createsandbox( in jsco...
...And 73 more matches
sslfnc.html
parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code.
description nss_init opens the certn.db, keyn.db, and secmod.db files (wheren is a numeric digit) in the specified directory. nss_init isnot idempotent, so call it only once. nss_init opens the database files read-only. if you are performing operations that require write permission, for example s/mime operations such as adding a certificate, use nss_initreadwrite instead. before calling nss_init, you...
...parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code.
description nss_initreadwrite opens the certn.db, keyn.db, and secmod.db files (wheren is a numeric digit) with both read and write permission in the specified directory. nss_initreadwrite isnot idempotent, so call it only once. use nss_initreadwrite rather than nss_init if you are performing operations that require write permission, such as some s/mime operations. before calling nss_initreadwrite, yo...
...te and key database files be opened. syntax #include "nss.h" secstatus nss_nodb_init(char *reserved); parameter this function has the following parameter: reserved should be null.. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code.
description nss_nodb_init opens only the temporary database and the internal pkcs #112 module. unlike nss_init, nss_nodb_init allows applications that do not have access to storage for databases to run raw crypto, hashing, and certificate functions. nss_nodb_init isnot idempotent, so call it only once. before calling nss_nodb_init, your program must call pr_init. the policy flags for all cipher sui...
...And 55 more matches
imgIContainer
you can only be guaranteed that querying this will not throw if status_decode_complete is set on the imgirequest. read only. exceptions thrown ns_error_not_available if the animated state cannot be determined. animationmode unsigned short currentframe gfxasurface ...
....0 preferredalphachannelformat gfx_format read only. obsolete since gecko 1.9.2 type unsigned short the type of this image (one of the type_* values above). read only. width print32 the width of the container rectangle. in the case of any error, zero is returned, and an exception will be thrown. read only. constants constant value
description type_raster 0 enumerated values for the 'type' attribute (below). type_vector 1 flag_none 0x0 flags for imgicontainer operations. meanings: flag_none: lack of flags. flag_sync_decode: forces synchronous/non-progressive decode of all available data before the call returns. it is an error to pass this flag from a call stack that origin...
...ethods native code only!addrestoredata obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. void addrestoredata( [array, size_is(acount), const] in char data, in unsigned long acount ); parameters data missing
description acount missing
description exceptions thrown missing exception missing
description native code only!appendframe obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. adds to the end of the list of frames. v...
...And 45 more matches
nsIMsgIncomingServer
nsimsgincomingserver mailnews/base/public/nsimsgincomingserver.idlscriptable ??? add brief
description of interface ??? inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void clearallvalues(); void cleartemporaryreturnreceiptsfilter(); void closecachedconnections(); void configuretemporaryfilters(in nsimsgfilterlist filterlist); void configuretemporaryreturnreceiptsfilter(in nsimsgfilterlist filterlist); obsolete since gecko 1.8 void displayofflinemsg(in nsimsgwindow awindow); boolean equals(in nsimsgincomingserver server); void forgetpassword(); void forgetsessionpassword(); astring generateprettynameformigration(); boolean getboolattribute(in string name); boolean getboolvalue(in string att...
... biffminutes long biffstate unsigned long canbedefaultserver boolean read only. cancompactfoldersonserver boolean read only. cancreatefoldersonserver boolean candelete boolean can this server be removed from the account manager? for instance, local mail is not removable, but an imported folder is. canemptytrashonexit boolean read only.
... only. sockettype long spamfilterplugin nsimsgfilterplugin read only. spamsettings nsispamsettings spam settings. read only. supportsdiskspace boolean read only. type acstring protocol type, that is "pop3", "imap", "nntp", "none", and so on. used to construct urls. username acstring userid to log into the server. ...
...And 44 more matches
WebGL constants - Web APIs
nformation, examples, and resources on how to get started with webgl. table of contents standard webgl 1 constants standard webgl 2 constants webgl extension constants standard webgl 1 constants these constants are defined on the webglrenderingcontext interface. clearing buffers constants passed to webglrenderingcontext.clear() to clear buffer masks. constant name value
description depth_buffer_bit 0x00000100 passed to clear to clear the current depth buffer. stencil_buffer_bit 0x00000400 passed to clear to clear the current stencil buffer. color_buffer_bit 0x00004000 passed to clear to clear the current color buffer. rendering primitives constants passed to webglrenderingcontext.drawelements() or webglrenderingcontex...
...r. stencil_buffer_bit 0x00000400 passed to clear to clear the current stencil buffer. color_buffer_bit 0x00004000 passed to clear to clear the current color buffer. rendering primitives constants passed to webglrenderingcontext.drawelements() or webglrenderingcontext.drawarrays() to specify what kind of primitive to render. constant name value
description points 0x0000 passed to drawelements or drawarrays to draw single points. lines 0x0001 passed to drawelements or drawarrays to draw lines. each vertex connects to the one after it. line_loop 0x0002 passed to drawelements or drawarrays to draw lines. each set of two vertices is treated as a separate line segment. line_strip 0x0003 pas...
...iangle_fan 0x0006 passed to drawelements or drawarrays to draw a connected group of triangles. each vertex connects to the previous and the first vertex in the fan. blending modes constants passed to webglrenderingcontext.blendfunc() or webglrenderingcontext.blendfuncseparate() to specify the blending mode (for both, rbg and alpha, or separately). constant name value
description zero 0 passed to blendfunc or blendfuncseparate to turn off a component. one 1 passed to blendfunc or blendfuncseparate to turn on a component. src_color 0x0300 passed to blendfunc or blendfuncseparate to multiply a component by the source elements color. one_minus_src_color 0x0301 passed to blendfunc or blendfuncseparate to multiply...
...And 44 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
already has a value), we do nothing. otherwise, we set srcobject to the stream at index 0 in the streams array. the perfect negotiation logic now we get into the true perfect negotiation logic, which functions entirely independently from the rest of the application. ...
...ogic, which functions entirely independently from the rest of the application. handling the negotiationneeded event first, we implement the rtcpeerconnection event handler onnegotiationneeded to get a local
description and send it using the signaling channel to the remote peer. ...
...pendently from the rest of the application. handling the negotiationneeded event first, we implement the rtcpeerconnection event handler onnegotiationneeded to get a local
description and send it using the signaling channel to the remote peer. ...
...And 39 more matches
Index - Web APIs
ains one of the error code constants, or 0 if none match. this field is used for historical reasons. new dom exceptions don't use this anymore: they put this info in the domexception.name attribute. 708 domexception.message api, domexception, property, reference, message the message read-only property of the domexception interface returns a domstring representing a message or
description associated with the given error name. 709 domexception.name api, domexception, property, reference, name the name read-only property of the domexception interface returns a domstring that contains one of the strings associated with an error name. 710 domhighrestimestamp api, domhighrestimestamp, high resolution time, reference, time, type the domhighresti...
...mageelement.ismap api, html, html dom, htmlimageelement, image map, link, reference, ismap, server-side the htmlimageelement proeprty ismap is a boolean value which indicates that the image is to be used by a server-side image map. this may only be used on images located within an <a> element. 1724 htmlimageelement.longdesc api, dom, html, html dom, htmlimageelement, long
description, obsolete, property, reference,
description, img, longdesc the obsolete property longdesc on the htmlimageelement interface specifies the url of a text or html file which contains a long-form
description of the image. 1725 htmlimageelement.lowsrc api, html, html dom, htmlimageelement, image, obsolete, performance, property, quality, reference, img, lowsrc, speed the htm...
... api, html dom, htmltableelement, needsbrowsercompatibility, needsspectable, property, reference the htmltableelement.rules property indicates which cell borders to render in the table. 1928 htmltableelement.summary api, html dom, htmltableelement, needsbrowsercompatibility, needsspectable, property, reference the htmltableelement.summary property represents the table
description. 1929 htmltableelement.tbodies api, html dom, htmltableelement, property, read-only, reference the htmltableelement.tbodies read-only property returns a live htmlcollection of the bodies in a <table>. 1930 htmltableelement.tfoot api, html dom, htmltableelement, property, reference the htmltableelement.tfoot property represents the <tfoot> element of a <ta...
...And 31 more matches
nsIDBFolderInfo
nsidbfolderinfo - careful, pulled from the wrong (cvs) repo! mailnews/db/msgdb/public/nsidbfolderinfo.idlscriptable ??? add brief
description of interface ??? inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: ?????????????????????????????????????. to create an instance, use: implemented by: ????????????????????????????????????? as a service: var dbfolderinfo = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsidbfolderinfo); method overview long andflags(in long flags); void changeexpungedbytes(in long delta); void changenummessages(in long delta); void changenumunreadmessages(in long ...
...ing locale); native code only! obsolete since gecko 1.8 void setmailboxname(in nsstring newboxname); native code only! ...
... sortorder nsmsgviewsortordervalue sorttype nsmsgviewsorttypevalue version unsigned long viewflags nsmsgviewflagstypevalue viewtype nsmsgviewtypevalue methods andflags() long andflags( in long flags ); parameters flags missing
description return value missing
description exceptions thrown missing exception missing
description changeexpungedbytes() void changeexpungedbytes( in long delta ); parameters delta missing
description exceptions thrown missing exception missing
description changenummessages() void changenummessages( in long delta ); parameters delta miss...
...And 23 more matches
Key Values - Web APIs
| ime and composition keys | function keys | phone keys | multimedia keys | audio control keys | tv control keys | media controller keys | speech recognition keys | document keys | application selector keys | browser control keys | numeric keypad keys special values values of key which have special meanings other than identifying a specific key or character. keyboardevent.key value
description virtual keycode windows mac linux android "unidentified" the user agent wasn't able to map the event's virtual keycode to a specific key value. this can happen due to hardware or software constraints, or because of constraints around the platform on which the user agent is running. varies varies varies varies modifier keys mod...
...onstraints around the platform on which the user agent is running. varies varies varies varies modifier keys modifiers are special keys which are used to generate special characters or cause special actions when used in combination with other keys. examples include the shift and control keys, and lock keys such as caps lock and numlock. keyboardevent.key value
description virtual keycode windows mac linux android "alt" [5] the alt (alternative) key. vk_menu (0x12) vk_lmenu (0xa4) vk_rmenu (0xa5) kvk_option (0x3a) kvk_rightoption (0x3d) gdk_key_alt_l (0xffe9) gdk_key_alt_r (0xffea) qt::key_alt (0x01000023) keycode_alt_left (57) keycode_alt_right (58) "altgraph" [5] the altgr or altgrap...
...t add support for the symbol key until firefox 37. [4] firefox generates the key value "os" for the super and hyper keys, instead of "super" and "hyper". [5] chrome 67 and firefox 63 now correctly interpret the right alt key for keyboard layouts which map that key to altgr. see firefox bug bug 900750 and chrome bug 25503 for further details. whitespace keys keyboardevent.key value
description virtual keycode windows mac linux android "enter" the enter or ↵ key (sometimes labeled return). vk_return (0x0d) kvk_return (0x24) kvk_ansi_keypadenter (0x4c) kvk_powerbook_keypadenter (0x34) gdk_key_return (0xff0d) gdk_key_kp_enter (0xff8d) gdk_key_iso_enter (0xfe34) gdk_key_3270_enter (0xfd1e) qt::key_return (0x01000004) ...
...And 21 more matches
RTCPeerConnection - Web APIs
also included is a list of any ice candidates that may already have been generated by the ice ag...
...olean which indicates whether or not the remote peer can accept trickled ice candidates.connectionstate the read-only connectionstate property of the rtcpeerconnection interface indicates the current state of the peer connection by returning one of the string values specified by the enum rtcpeerconnectionstate.currentlocal
description read only the read-only property rtcpeerconnection.currentlocal
description returns an rtcsession
description object describing the local end of the connection as it was most recently successfully negotiated since the last time the rtcpeerconnection finished negotiating and connecting to a remote peer. also included is a list of any ice candidates that may already have been generated by the ice agent since the offer or answer represented by the
description was first inst...
...
description object describing the local end of the connection as it was most recently successfully negotiated since the last time the rtcpeerconnection finished negotiating and connecting to a remote peer. also included is a list of any ice candidates that may already have been generated by the ice agent since the offer or answer represented by the
description was first instantiated.currentremote
description read only the read-only property rtcpeerconnection.currentremote
description returns an rtcsession
description object describing the remote end of the connection as it was most recently successfully negotiated since the last time the rtcpeerconnection finished negotiating and connecting to a remote peer. also included is a list of any ice candidates that may already have been generated by the ice a...
...And 21 more matches
Building accessible custom components in XUL - Archive of obsolete content
box. however, if you are building custom controls in xul, you may need to use dhtml accessibility techniques to ensure that your custom controls are equally accessible. a super-simple spreadsheet download stage-1.zip install stage-1.xpi to build our xul spreadsheet, we'll use three built-in xul controls: a single grid element to contain the other elements and position them in rows and columns.
description elements for each row and column header. label elements for each cell in the spreadsheet. the xul markup is straightforward. we define the grid, then define the headers for each row (numbered 1 through 7), then define the column header and cells for each column. the label for each header and cell is defined in the value attribute. the flex attributes are simply for layout. note: the row and colu...
... column header. label elements for each cell in the spreadsheet. the xul markup is straightforward. we define the grid, then define the headers for each row (numbered 1 through 7), then define the column header and cells for each column. the label for each header and cell is defined in the value attribute. the flex attributes are simply for layout. ...
...ed by
description elements, and individual cells are denoted by label elements. this is not an accessibility requirement; as we'll see in the next section, the actual xul elements are irrelevant because we will define the role of each element in a separate attribute. ...
...And 20 more matches
Observer Notifications
pp-startup topic which can be done in the component's registration code, and then in that notification register with the observer service for the profile-after-change notification. see receiving startup notifications for more information about how this works. starting in firefox 3.5 components can simply register for the profile-after-change notification in nsicategorymanager. topic
description * everything. [nsobserverservice.cpp] topic
description xpcom-startup note: an extension can no longer be registered to receive this notification in firefox 4 and later. see xpcom changes in gecko 2.0 for details. called when xpcom is initialized. many things are not available for use at this point. to receive this notification you ha...
...cate that all initial browser windows have opened. note that while the window are open and the chrome loaded the tabs in the windows may still be being restored after this notification. note: this notification is specific to firefox and seamonkey 2.0 applications application shutdown these are the topics that you can observe on shutdown, in order of appearance. topic
description quit-application-requested something has requested that the application be shutdown. you can cancel the shutdown from here by setting asubject.data to true (asubject is the first parameter to your observer, the data value is an nsisupportsprbool). quit-application-granted all observers have agreed to the shutdown. quit-application the application is about to qu...
...e available here. web-workers-shutdown called inside xpcom-shutdown. this shuts down all web workers. xpcom-shutdown-threads shuts down the thread manager, causing all nsthreads to finish processing any events already queued and stop accepting new events. browser these topics indicate interesting things that happen that the browser alerts you to. topic
description browser:purge-session-history sent when the sanitizer runs to purge all history and other information. browser:purge-domain-data sent after domain-specific history and other information have been purged. the data value is a string form of the domain. browser-lastwindow-close-requested sent when the browser wishes to close the last open browser window. when this...
...And 19 more matches
Creating a Help Content Pack - Archive of obsolete content
original doc: http://www.mozilla.org/projects/help.../content_packs i hesitate to call it "original", tho, because i've basically rewritten the entire thing so that it's easier and faster to use to create help content. the previous document had a lot of places where ideas were simply introduced without explanation, and i've tried to go through things a bit more slowly with better
descriptions. this is still very much a work in progress, tho, and i need to complete the rest of it soon (where "complete" means "use what's there that's good, build on the stuff that's not as good, and add other useful information as necessary". this document describes how to integrate html help documentation into your application using the mozilla help viewer. documentation contained in the help viewer can be acc...
...a content pack is a packaged set of files that describe help content. content packs include help documents written in xhtml, a content pack descriptor file written in rdf, and a table of contents, index, and glossary (also written in rdf). you can create a content packs which inherit from existing mozilla help content packs. the contents of a content pack content packs consist of a general pack
description file, table of contents, index, search, glossary, and help documents. the help documents are written in xhtml, and the rest are written in rdf. the content pack descriptor file outlines the framework of the contents of the pack by pointing to the files describing the table of contents, index, and glossary rdf files. the table of contents and index files are simple tree-based outlines written in r...
...following text: <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#"> </rdf:rdf> if you're familiar with html or xml, you might recognize this as the container element for the whole document. it serves as a wrapper around the entire contents of the file, marking it as rdf. next, you'll need to insert a rdf:
description element into the file, inside the rdf:rdf element just created: <rdf:
description rdf:about="urn:root" nc:title="" nc:defaulttopic="" nc:base=""> </rdf:
description> fill in the attributes as follows: rdf:about must be urn:root or your pack won't work. this attribute marks the start point in the rdf graph described by the ...
...And 17 more matches
WebRTC connectivity - Web APIs
nformation we need to exchange is the offer and answer which just contains the sdp mentioned below. peer a who will be the initiator of the connection, will create an offer. they will then send this offer to peer b using the chosen signal channel. peer b will receive the offer from the signal channel and create an answer. they will then send this back to peer a along the signal channel. ...
...ed below. peer a who will be the initiator of the connection, will create an offer. they will then send this offer to peer b using the chosen signal channel. peer b will receive the offer from the signal channel and create an answer. they will then send this back to peer a along the signal channel. session
descriptions the configuration of an endpoint on a webrtc connection is called a session
description. the
description includes information about the kind of media being sent, its format, the transfer protocol being used, the endpoint's ip address and port, and other information needed to describe a media transfer endpoint. this information is exchanged and stored using session
description protocol (sdp); if you want details on the format of sdp data, you can find it in rfc 2327. when a user sta...
...the kind of media being sent, its format, the transfer protocol being used, the endpoint's ip address and port, and other information needed to describe a media transfer endpoint. this information is exchanged and stored using session
description protocol (sdp); if you want details on the format of sdp data, you can find it in rfc 2327. when a user starts a webrtc call to another user, a special
description is created called an offer. this
description includes all the information about the caller's proposed configuration for the call. the recipient then responds with an answer, which is a
description of their end of the call. in this way, both devices share with one another the information needed in order to exchange media data. this exchange is handled using interactive connectivity establishment (...
...And 17 more matches
StringView - Archive of obsolete content
for actually supported values see here. buffer read only arraybuffer the buffer to be shared between stringview.rawdata and stringview.bufferview view references. rawdata read only arraybufferview an arraybufferview containing the representation of the string as array of...
...ntation of the string as array of 8-bit, 16-bit, or 32-bit integers (depending on the chosen encoding). bufferview read only arraybufferview an arraybufferview containing the representation of the whole buffer as array of 8-bit, 16-bit, or 32-bit integers (depending on the chosen encoding). constructor syntax new stringview(input[, encoding[, startoffset[, length]]])
description create a new string-like object based upon an arraybuffer. arguments input (required) the argument the stringview is constructed from. it can be: another stringview a string a number an arraybuffer a typed array of uint8array, uint16array, or uint32array subclass any other kind of ordered object (like arrays, collections, etc.) if it is a number it will become the length of...
... arguments base64string (required) a base64-encoded string which will be decoded and copied into the new stringview object. encoding optional a string expressing the encoding type. for possible values see here. byteoffset optional a number expressing the start offset in bytes of the...
...And 16 more matches
source-editor.jsm
you can then use this value to detect when the contents of the text are different from your most recent save. in addition, when this value changes, the "dirtychanged" event is sent. editorelement element the element containing the editor. ...
...ment the element containing the editor. when using the default orion editor, this is a xul <xul:iframe> element. read only. lastfind object an object describing the result of the last find operation performed using the find(), findnext(), or findprevious() method. read only. this object has the following properties: property type
description str string the last string that was searched for. index number an integer value indicating the result of the most recent find operation; this is the index into the text at which str was found, or -1 if the string wasn't found. lastfound number the index of the previous location at which str wa...
... true if the search was case sensitive; otherwise false. readonly boolean set this value to true to make the editor read only, thereby preventing the user from making changes. set it to false to allow editing. constants preference name constants these constants define the names of preferences used by the source editor. constant value
description sourceeditor.prefs.component "devtools.editor.component" a string indicating the name of the source editor engine to use; this is "orion" by default. the source editor code module loads a module by the name "source-editor-<component>.jsm" and exposes its api as part of the sourceeditor object. sourceeditor.prefs.expand_tab "devtools.editor.expandtab" a boolean value ...
...And 16 more matches
ARIA annotations - Accessibility
ial comment related to a part of a document under review). below we'll introduce the new features associated with aria annotations, and have a look at some code examples that show them in action. note: you can find all the examples discussed in this article in a demo file at aria-annotations. aria annotations features the aria attributes providing these new abilities are as follows: aria-
description="" — provides a detailed
description of an html element, as opposed to the brief label provided by aria-label. role="insertion" and role="deletion" — semantically denote html elements whose contents represent an insertion to or deletion from the overall document. these are semantically equivalent to the html <ins> and <del> elements. note that these aren’t part of the new aria annotations ...
... use any of these yet, as screenreader support is currently not there. for the moment, you can see the annotations data being exposed with tools like firefox accessibility inspector. the annotations should just work once screenreader support is added. associating annotated elements with their details there are a number of different ways in which you can associate ui features with text labels or
descriptions for accessibility purposes. it is useful to know when to use each. you’ll see examples of most of these later on in the article, but briefly: aria-label="" can be set on an element to provide a brief descriptive label when it isn't appropriate to have the label actually appearing in the ui, for example a search input in a horizontal nav bar. aria-labelledby="" can be set on an element and ...
...ive label when it isn't appropriate to have the label actually appearing in the ui, for example a search input in a horizontal nav bar. aria-labelledby="" can be set on an element and given a value the same as the id of an element that contains a label for the element. this is useful when the element’s label is available in the ui, but for some reason a conventional <label> won’t work. aria-
description="" works the same as aria-label="", but is used when you want to give an element a more detailed
description, rather than a short label. aria-describedby="" works the same as aria-labelledby="", but is used when you want to associate the element with a more detailed
description, rather than a short label. aria-details="" works in the same way as aria-describedby="", except that it denotes more ...
...And 15 more matches
HTML elements reference - HTML: Hypertext Markup Language
ml elements, which are created using tags. they are grouped by function to help you find what you have in mind easily. an alphabetical list of all elements is provided in the sidebar on every element's page as well as this one. for more information about the basics of html elements and attributes, see the section on elements in the introduction to html article. main root element
description <html> the html <html> element represents the root (top-level element) of an html document, so it is also referred to as the root element. all other elements must be descendants of this element. document metadata metadata contains information about the page. this includes information about styles, scripts and data to help software (search engines, browsers, etc.) use an...
...ement. all other elements must be descendants of this element. document metadata metadata contains information about the page. this includes information about styles, scripts and data to help software (search engines, browsers, etc.) use and render the page. metadata for styles and scripts may be defined in the page or link to another file that has the information. element
description <base> the html <base> element specifies the base url to use for all relative urls in a document. <head> the html <head> element contains machine-readable information (metadata) about the document, like its title, scripts, and style sheets. <link> the html external resource link element (<link>) specifies relationships between the current document and...
... represented by other html meta-related elements, like <base>, <link>, <script>, <style> or <title>. <style> the html <style> element contains style information for a document, or part of a document. <title> the html title element (<title>) defines the document's title that is shown in a browser's title bar or a page's tab. sectioning root element
description <body> the html <body> element represents the content of an html document. there can be only one <body> element in a document. content sectioning content sectioning elements allow you to organize the document content into logical pieces. use the sectioning elements to create a broad outline for your page content, including header and footer navigation, and heading eleme...
...And 15 more matches
JXON - Archive of obsolete content
nst statement compatibility). note: if you are interested to address only some parts of an xml document (and are not starting in javascript/json for templating purposes), use xpath instead of converting the whole document into json. ...
...son for templating purposes), use xpath instead of converting the whole document into json. ...
...on="1.0"?> <!doctype catalog system "catalog.dtd"> <catalog> <product
description="cardigan sweater"> <catalog_item gender="men's"> <item_number>qwz5671</item_number> <price>39.95</price> <size
description="medium"> <color_swatch image="red_cardigan.jpg">red</color_swatch> <color_swatch image="burgundy_cardigan.jpg">burgundy</color_swatch> </size> <size
description="large"> <color_swatch image="red_cardigan.jpg">red</color_swatch> <color_swatch image="burgundy_cardigan.jpg">burgundy</color_swatch> </size> </catalog_item> <catalog_item gender="women's"> <item_number>rrx9856</item_number> <discount_until>dec 25, 1995</discount_until> <price>42.50</price> <size
description="medium"> <color_swatch image="black...
...And 13 more matches
PKCS #11 Module Specs
efix prefix for the cert database. keyprefix prefix for the key database. minpwlen minimum password length in bytes. manufacturerid override the default manufactureid value for the module returned in the ck_info, ck_slot_info, and ck_token_info structures with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). library
description override the default library
description value for the module returned in the ck_info structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). cryptotoken
description override the default label value for the internal crypto token returned in the ck_token_info structure with an internationalize string (utf8). this val...
...fo structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). cryptotoken
description override the default label value for the internal crypto token returned in the ck_token_info structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). dbtoken
description override the default label value for the internal db token returned in the ck_token_info structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). fipstoken
description override the default label value for the internal fips token returned in the ck_token_info structure with an internationalize string (utf8). this val...
...nfo structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). fipstoken
description override the default label value for the internal fips token returned in the ck_token_info structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). cryptoslot
description override the default slot
description value for the internal crypto token returned in the ck_slot_info structure with an internationalize string (utf8). this value will be truncated at 64 bytes (no null, partial utf8 characters dropped). ...
...And 13 more matches
Places utilities for JavaScript
e wanted. there are several predefined versions of this for common calls. these just take in the node, as the interface is already defined: asvisit(anode) asfullvisit(anode) ascontainer(anode) asquery(anode) annotations a few annotation names are defined here. load_in_sidebar_anno - this annotation is associated with bookmarks or items that should load in the sidebar automatically.
description_anno - this annotation stores
description information about a bookmark. post_data_anno - i need to clarify here, but i think this is the name of the annotation that stores information for keyword searches from a bookmark. lmanno_feeduri - need to clarify here too, but i think for each livemark, there is an bookmark which contains an annotation storing the associated feed uri. lmanno_siteuri - ...
... string atype, nsiuri aoverrideuri); array unwrapnodes(string blob, string atype); nsitransaction maketransaction(string data, string type, nsinavhistoryresultnode container, int index, boolean copy); nsinavhistoryresult getfoldercontents(int afolderid, boolean aexcludeitems, boolean aexpandqueries); boolean showaddbookmarkui(nsiuri auri, string atitle, string a
description, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showminimaladdbookmarkui(nsiuri auri, string atitle, string a
description, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showaddlivemarkui(nsiuri afeeduri, nsiuri asiteuri, string atitle, strin...
...nt adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showminimaladdbookmarkui(nsiuri auri, string atitle, string a
description, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showaddlivemarkui(nsiuri afeeduri, nsiuri asiteuri, string atitle, string a
description, int adefaultinsertionpoint, boolean ashowpicker); boolean showminimaladdlivemarkui(nsiuri afeeduri, nsiuri asiteuri, string atitle, string a
description, int adefaultinsertionpoint, boolean ashowpicker); boolean showminimaladdmultibookmarkui(array nsiuri aurilist); boolean showbookmarkproperties(int aid); boolean showfolderproperties(int aid); boolean ...
...And 13 more matches
nsIRadioInterfaceLayer
tid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type
description currentstate jsval read only. obsolete since gecko 13.0 microphonemuted bool radiostate jsval read only. speakerenabled bool constants call state constants constant value
description call_state_unknown 0 call_state_dialing 1 call_state_alerting 2 call_state_busy 3 call_state_connecting 4 call_state_connected 5 call_state_holding 6 call_state_held 7 ...
...void dial( in domstring number ); parameters number missing desc...
... call_state_incoming 11 datacall_state_unknown 0 datacall_state_connecting 1 datacall_state_connected 2 datacall_state_disconnecting 3 datacall_state_disconnected 4 call_state_ringing 2 obsolete since gecko 14.0 methods answercall() void answercall( in unsigned long callindex ); parameters callindex missing
description exceptions thrown missing exception missing
description deactivatedatacall() void deactivatedatacall( in domstring cid, in domstring reason ); parameters cid missing
description reason missing
description exceptions thrown missing exception missing
description dial() functionality for making and managing phone calls. void dial( in domstring number ); parameters number missing
description exceptions thrown missing exception missing desc...
...And 13 more matches
Index - Archive of obsolete content
code snippets, javascript, xpcom, about:, nsiaboutmodule no summary! 192 javascript debugger service code snippets no summary! 193 javascript timers javascript timers, needsbetterplace no summary! 194 javascript daemons management dom, guide, javascript, javascript timers, makebrowseragnostic no summary! 195 label and
description code snippets no summary! 196 lookupnamespaceuri no summary! 197 lookupprefix no summary! 198 miscellaneous add-ons, code, code snippets, extensions, snippets no summary! 199 modules no summary! 200 on page load add-ons, extensions no summary! 201 page loading code ...
... pack original doc: http://www.mozilla.org/projects/help.../content_packs i hesitate to call it "original", tho, because i've basically rewritten the entire thing so that it's easier and faster to use to create help content. the previous document had a lot of places where ideas were simply introduced without explanation, and i've tried to go through things a bit more slowly with better
descriptions. this is still very much a work in progress, tho, and i need to complete the rest of it soon (where "complete" means "use what's there that's good, build on the stuff that's not as good, and add other useful information as necessary". 485 helper apps (and a bit of save as) outdated_articles, uriloader 486 hidden prefs this page has been flagged by edi...
...ect information. 487 how to write and land nanojit patches obsolete adobe and mozilla share a copy of nanojit. this means that landing nanojit patches is a bit complicated, but experience has taught us that this is much better than having separate versions of nanojit. 488 io guide/directory keys "directory keys" are the keys for nsidirectoryservice, see
description. the actual keys are: 489 introducing the audio api extension deprecated the audio data api extension extends the html5 specification of the <audio> and <video> media elements by exposing audio metadata and raw audio data. this enables users to visualize audio data, to process this audio data and to create new audio data. 490 isp data administration, enterprise...
...And 12 more matches
Signaling and video calling - Web APIs
ways; what's demonstrated here is just one possible way to structure signaling messages. this example's server uses stringified json objects to communicate with its clients. this means our signaling messages will be in json format, with contents which specify what kind of messages they are as well as any additional information needed in order to handle the messages properly. exchanging session
descriptions when starting the signaling process, an offer is created by the user initiating the call. this offer includes a session
description, in sdp format, and needs to be delivered to the receiving user, which we'll call the callee. the callee responds to the offer with an answer message, also containing an sdp
description. our signaling server will use websocket to transmit offer messages with the ty...
...fer with an answer message, also containing an sdp
description. our signaling server will use websocket to transmit offer messages with the type "video-offer", and answer messages with the type "video-answer". these messages have the following fields: type the message type; either "video-offer" or "video-answer". name the sender's username. target the username of the person to receive the
description (if the caller is sending the message, this specifies the callee, and vice-versa). sdp the sdp (session
description protocol) string describing the local end of the connection from the perspective of the sender (or the remote end of the connection from the receiver's point of view). at this point, the two participants know which codecs and codec parameters are to be used for this call. they s...
...tiate the actual connection between them. every ice candidate describes a method that the sending peer is able to use to communicate. each peer sends candidates in the order they're discovered, and keeps sending candidates until it runs out of suggestions, even if media has already started streaming. an icecandidate event is sent to the rtcpeerconnection to complete the process of adding a local
description using pc.setlocal
description(offer). once the two peers agree upon a mutually-compatible candidate, that candidate's sdp is used by each peer to construct and open a connection, through which media then begins to flow. if they later agree on a better (usually higher-performance) candidate, the stream may change formats as needed. though not currently supported, a candidate received after media ...
...And 11 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
date manifest. it lists information about 2 different versions of the extension with id foobar@developer.mozilla.org. the versions included are 2.2 and 2.5, both of which specify compatibility with firefox versions 1.5 to 2.0.0.*. for version 2.2 an https update link is used while version 2.5 has a regular http link with a hash to verify the file retrieved. it is important to get the initial rdf:
description's about attribute correct. it varies depending on what type of add-on you are providing information for: for an extension or plugin bundle it must be urn:mozilla:extension:<id> for a theme it must be urn:mozilla:theme:<id> for any other type of add-on it must be urn:mozilla:item:<id> note: prior to gecko 2.0 (firefox 4.0), the ordering of the versions within the <rdf:seq> is significant. ...
...s significant. for later versions, the compatible add-on version with the greatest version string will be used by the client for automatic updates. the behavior depends on the version of the client application, of course. ...
...?xml version="1.0" encoding="utf-8"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <!-- this
description resource includes all the update and compatibility information for a single add-on with the id foobar@developer.mozilla.org. you can list multiple add-ons information in the same rdf file. ...
...And 10 more matches
NSS PKCS11 Functions
s value should be null. recurse is a boolean indicates whether or not the module should also launch additional pkcs #11 modules. this is only applicable if the loaded module is actually a moduledb rather than a pkcs #11 module (see pkcs11_module_specs). returns the function returns one of these values: if successful, a pointer to a secmodmodule. caller owns the reference if unsuccessful, null.
description secmod_loadusermodule loads a new pkcs #11 module into nss and connects it to the current nss trust infrastructure. once the the module has been successfully loaded, other nss calls will use it in the normal course of searching. modulespec specifies how the module should be loaded. more information about module spec is available at pkcs11_module_specs. nss parameters may be specified in module sp...
...tructure until unloaded with secmod_unloadusermodule. secmod_unloadusermodule unload a pkcs #11 module. syntax #include "secmod.h" extern secstatus secmod_unloadusermodule(secmodmodule *module); parameters this function has the following parameters: module is the module to be unloaded. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure.
description secmod_unloadusermodule detaches a module from the nss trust domain and unloads it. the module should have previously been loaded by secmod_loadusermodule. secmod_closeuserdb close an already opened user database. note: the database must be in the internal token, and must be one created with secmod_openuserdb(). once the database is closed, the slot will remain as an empty slot until it's used ag...
...a new database using the softoken. syntax #include "pk11pub.h" pk11slotinfo *secmod_openuserdb(const char *modulespec) parameters this function has the following parameters: modulespec is the same data that you would pass to softoken at initialization time under the 'tokens' options. returns the function returns one of these values: if successful, a pointer to a slot. if unsuccessful, null.
description open a new database using the softoken. the caller is responsible for making sure the module spec is correct and usable. the caller should ask for one new database per call if the caller wants to get meaningful information about the new database. modulespec is the same data that you would pass to softoken at initialization time under the 'tokens' options. for example, if you would normally specif...
...And 10 more matches
nsIMsgHeaderParser
nsimsgheaderparser defined in comm-central/ mailnews/ mime/ public/ nsimsgheaderparser.idl mailnews/mime/public/nsimsgheaderparser.idlscriptable ??? add brief
description of interface ??? inherits from: nsisupports last changed in gecko 1.9 (firefox 3) to create an instance, use: var msgheaderparser = components.classes["@mozilla.org/messenger/headerparser;1"] .createinstance(components.interfaces.nsimsgheaderparser); method overview string extractheaderaddressmailboxes(in string line); void extractheaderaddressname(in string line, out string name); void extractheaderaddressnames(in string line, out string usernames); astring makefulladdress(in astring aname, in astring aaddress); string makefulladdressstring(in...
...dresses, returns a comma-separated list of just the 'mailbox' portions. if any of the addresses doesn't have a mailbox, then the user name is used instead. autf8string extractheaderaddressmailboxes( in string line ); parameters line the header line to parse. return value a comma-separated list of just the mailbox parts of the addresses. exceptions thrown missing exception missing
description native code only!extractheaderaddressnames given a string which contains a list of header addresses, returns a comma-separated list of just the 'user name' portions. if any of the addresses doesn't have a name, then the mailbox is used instead. autf8string extractheaderaddressnames( in string line ); parameters line the header line to parse. return value a comma-separated list of ...
...header addresses, returns a comma-separated list of just the 'user name' portions. if any of the addresses doesn't have a name, then the mailbox is used instead. autf8string extractheaderaddressnames( in string line ); parameters line the header line to parse. return value a comma-separated list of just the name parts of the addresses. ...
...And 10 more matches
Localization - Archive of obsolete content
see limitations below. localized strings translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
...see limitations below. localized strings translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
...see limitations below. localized strings translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
...And 9 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
many browsers, such as internet explorer, also support pre-w3c apis and have never added extensive suppor...
... differences between mozilla and internet explorer first, i'll discuss the differences in the way html behaves between mozilla and internet explorer. tooltips legacy browsers introduced tooltips into html by showing them on links and using the value of the alt attribute as a tooltip's content. the latest w3c html specification created the title attribute, which is meant to contain a detailed
description of the link. modern browsers will use the title attribute to display tooltips, and mozilla only supports showing tooltips for that attribute and not the alt attribute. entities html markup can contain several entities, which the w3c web standards body has defined. you can reference entities through their numerical or character reference. for example, you can reference the non-breaking space cha...
...ent to a certain position and toggle its visibility (menus, animations). netscape 4 used the <layer> tag, which mozilla does not support, as an html element that can be positioned anywhere. in mozilla, you can position any element using the <div> tag, which internet explorer uses as well and which you'll find in the html specification. table 1. methods used to access elements method
description document.getelementbyid( aid ) returns a reference to the element with the specified id. document.getelementsbytagname( atagname ) returns an array of elements with the specified name in the document. traverse the dom mozilla supports the w3c dom apis for traversing the dom tree through javascript (see table 2). the apis exist for each node in the document and allo...
...And 9 more matches
Makefile - variables
csrcs a list of c source files to compile. defines additional preprocessor defines for c++ expand_mozlibname exports a list of exported header files and sources to install for external use. ...
... dependencies - subdirectories for make to traverse prior to building current. xpidl_module module name to use when generating .xpt files, default to module. xpidlsrcs internal: a list of .idl files to generate exported headers from. xpidl_name name of extension to build see also configure.sh variables
description build_project_arg command line/environment override configure_env_args command line/environment override directory variable dirs a list of subdirectories to build recursively. parallel_dirs a list of subdirectories to build recursively that may be built concurrently.
...a list of subdirectories to build recursively that may be built concurrently. static_dirs subdirectories containing static makefiles that are not autogenerated. test_dirs a list of directories containing test makefiles tool_dirs a list of directories to process makefile 'tool' targets in. moz_ variable
description moz_auto_deps moz_build_app moz_build_projects build multiple projects in the same sandbox. dest=$(moz_objdir)/$project moz_current_project moz_debug moz_enable_xremote moz_feeds moz_help_viewer ...
...And 9 more matches
Index
d-line proxy. it watches tcp connections and displays the data going by. if a connection is ssl, the data display includes interpreted ssl records and handshaking. 212 nss tools : cmsutil name cmsutil — performs basic cryptograpic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages. synopsis cmsutil [options] arguments
description the cmsutil command-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages. to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each command takes one option. each option may take ...
... references visible links 1. http://pki.fedoraproject.org/wiki/ 2. http://www.mozilla.org/projects/security/pki/nss/ 213 nss tools : crlutil name crlutil — list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. synopsis crlutil [options] arguments
description the certificate revocation list (crl) management tool, crlutil, is a command-line utility that can list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and man...
... copyright (c) 2010, red hat, inc. licensed under the gnu public license version 2. references visible links 1. http://pki.fedoraproject.org/wiki/ 2. http://www.mozilla.org/projects/security/pki/nss/ 214 nss tools : modutil name modutil — manage pkcs #11 module information within the security module database. synopsis modutil [options] arguments
description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default provide...
...And 9 more matches
nsIPrincipal
if there isn't one, this will return null. getting this attribute never throws. read only. certificateid string the fingerprint id of this principal's certificate. throws if there is no certificate associated with this principal. read only. obsolete since gecko 1.8 commonname ...
...se uri to which this principal pertains. this is generally the document uri. read only. note: this wasn't accessible by scripts prior to gecko 2.0. constants principal capability constants these values indicate the capabilities of a principal. the order is significant; if an operation is performed on a set of capabilities, the minimum is computed. ...
...n is performed on a set of capabilities, the minimum is computed. constant value
description enable_denied 1 enable_unknown 2 enable_with_user_permission 3 enable_granted 4 methods native code only!canenablecapability short canenablecapability( in string capability ); parameters capability missing
description return value missing
description exceptions thrown missing exception missing
description checkmayload() checks whether this principal is allowed to load the network resource located at the given uri under the same-origin policy. this means that codebase principals are only allowed to load resources from the same domain, the system principal is allowed to load anything, and null princip...
...And 9 more matches
Install Manifests - Archive of obsolete content
tible with, how it should be updated, and so on. the format of the install manifest is rdf/xml. the file must be called install.rdf and live at the top level of an add-on's xpi file. layout the basic layout of an install manifest is like so: <?xml version="1.0" encoding="utf-8"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <!-- properties --> </
description> </rdf> some properties are required, some are optional. some have simple string values, some are complex resources. required property reference your install manifest must specify these properties correctly otherwise your add-on may not install. id the id of the extension, which must be one of the following: gu...
...the id property (<em:id>) specified (for a comprehensive list of application ids and valid min/maxversions for them see valid application versions for add-on developers), from the minimum version (<em:minversion>) up to and including the maximum version (<em:maxversion>). however, while <em:maxversion> is a required property, it is ignored unless you also set <em:strictcompatibility> in the main <
description> of your install.rdf (i.e. not in <em:targetapplication>). these version strings are formatted in the same fashion as the version property and will be compared to the application version; this allows the extension author to specify which versions of firefox an extension has been tested with. id, minversion, and maxversion are all required. note: extensions compatible with firefox 3.5 should sp...
...ility updates. for firefox 3.0, a maxversion of 3.0.* should be used. extensions compatible only with firefox or thunderbird 2 should specify a maxversion of 2.0.0.*. the install manifest must specify at least one of these objects, and may specify more if the add-on targets multiple applications that support the add-on manager (e.g. firefox and thunderbird). ...
...And 8 more matches
Install script template - Archive of obsolete content
often var component_size = 10; // (xpi file) reserve a little extra so it is not required to update too often var software_name="cult3d mozilla viewer"; // plids (http://mozilla.org/projects/plugins/plugin-identifier.html) are coined by vendors. ...
...is not required to update too often var software_name="cult3d mozilla viewer"; // plids (http://mozilla.org/projects/plugins/plugin-identifier.html) are coined by vendors. ...
...dsecondaryfolderdll = secondaryfolder + plugin_file; var qualifiedsecondaryfolderxpt = secondaryfolder + component_file; // write plid keys (mozilla.org/projects/plugins/first-install-problem.html) // write plid keys to hklm var hklm_status = registerplid(hkey_local_machine, reg_moz_path, plid, qualifiedsecondaryfolderdll, qualifiedsecondaryfolderxpt, plugin_
description, company_name, software_name, version, mimetype, suffix, suffix_
description); logcomment("moz first install installation: registerplid("+hkey_local_machine+") returned, status "+hklm_status); if (hklm_status == false) { // write plid keys (mozilla.org/projects/plugins/first-install-problem.html) // write plid keys to hkcu var hkcu_status = registerplid(hkey_current_user, reg...
...And 8 more matches
AddonManager
autoupdatedefault boolean whether add-ons should auto-update by default (overrideable per add-on). corresponds to the extensions.autoupdatedefault preference. callbacks installcallback() a callback that is passed a single addoninstall void installcallback( in addoninstall install ) parame...
...don the addon passed back from the asynchronous request. if an error occurred (such as an add-on not being found), null is passed back instead. addonlistcallback() a callback that is passed an array of addons void addonlistcallback( in addon addons[] ) parameters addons the array of addons passed back from the asynchronous request constants addoninstall states constant
description state_available an install that is waiting to be started. state_downloading an install that is in the process of being downloaded. state_checking an install that is checking for updated information. state_downloaded an install that has finished downloading and is ready to install. state_download_failed an install that failed to download.
..._download_failed an install that failed to download. state_installing an install that is in the process of being installed. state_installed an install that has successfully been installed. state_install_failed an install that has failed to install. state_cancelled an install that has been canceled. addoninstall errors constant
description error_network_failure a network error occurred. error_incorrect_hash the downloaded file did not match the expected hash. error_corrupt_file the file appears to be corrupt. error_file_access there was an error accessing the filesystem. error_signedstate_required the addon must be signed and isn't. update check reasons co...
...And 8 more matches
nsIContentViewer
can return null. read only. istabmodalpromptallowed boolean read only. prescontext nsprescontextptr ...
.... return value the container view, or null if this content viewer is the root of a view manager hierarchy. note: if this container is the root of a view manager hierarchy (that is, this method returns null), and mparentwidget is also null, then this document should not even be displayed. native code only!getbounds void getbounds( in nsintrectref abounds ); parameters abounds missing
description getdocument() returns the dom document object (as an nsidocument without addrefing. [noscript,notxpcom] nsidocumentptr getdocument(); parameters none. return value the dom document object. hide() void hide(); parameters none. native code only!init initializes the content viewer. void init( in nsiwidgetptr aparentwidget, [const] in nsintrectref abounds ); parameters aparentwidget ...
...ument() returns the dom document object (as an nsidocument without addrefing. [noscript,notxpcom] nsidocumentptr getdocument(); parameters none. return value the dom document object. hide() void hide(); parameters none. native code only!init initializes the content viewer. ...
...And 8 more matches
ARIA live regions - Accessibility
to works as long as you add the attribute before the changes occur — either in the original markup, or dynamically using javascript. simple live regions dynamic content which updates without a page reload is generally either a region or a widget. simple content changes which are not interactive should be marked as live regions. below is a list of each related aria live region property with a
description. aria-live: the aria-live=politeness_setting is used to set the priority with which screen reader should treat updates to live regions - the possible settings are: off, polite or assertive. the default setting is off. this attribute is by far the most important. aria-controls: the aria-controls=[idlist] is used to associate a control with the regions that it controls. regions are identifie...
...it is named after the roman deity mercury, the messenger to t...
...it is named after the roman deity mercury, the messenger to the gods.' }, venus: { title: "ve...
...And 8 more matches
Define terms with HTML - Learn web development
the clear blue sky of a subtle sadness, melancholy. ...
... the clear blue sky of a subtle sadness, melancholy. ...
...y mark up keywords when you're defining them. prerequisites: you need to be familiar with how to create a basic html document. objective: learn how to introduce new keywords and how to build
description lists. when you need a term defined, you probably go straight to a dictionary or glossary. dictionaries and glossaries formally associate keywords with one or more
descriptions, as in this case: blue (adjective) of a color like the sky in a sunny day. the clear blue sky of a subtle sadness, melancholy. ...
...And 7 more matches
WebRequest.jsm
quest onbeforesendheaders onsendheaders onheadersreceived onresponsestarted oncompleted each of these objects defines two functions: addlistener(callback, filter, opt_extrainfospec) removelistener(callback) adding listeners use addlistener to add a listener to a particular event. it takes one mandatory argument and two optional arguments, as detailed below. name type
description callback function the callback argument is a function to be called when the event is triggered. it's passed an object whose structure will vary depending on the event you're listening to: see the event-specific documentation for details. filter object the optional filter argument is used to restrict the requests for which the listener callback will ...
...r an event, call removelistener on the event in question, passing it the listener to remove. filtering the filter argument is the second argument to addlistener(). if you don't pass filter, then the listener is invoked for every web request the browser makes that triggers that particular event. filter is an object that may contain up to two properties: urls and types. name type
description urls matchpattern only invoke the listener for urls that match one of the patterns. types array of strings. an array of resource types. only invoke the listener for resource types that match one of the types given. to specify match patterns, first import the "matchpattern.jsm" module, then construct a matchpattern. the matchpattern constructor accepts: ...
...so documents two data structures that vary from one event to another: the opt_extrainfospec argument to addlistener() the properties of the argument passed to the listener. onbeforerequest this event is triggered when a request is about to be made, and before headers are available. this is a good place to listen if you want to cancel the request. opt_extrainfospec values name
description "blocking" make the browser wait until the listener returns. use this if you want to cancel the request. see some examples of canceling requests. listener argument name type
description url string target of the request. windowid number the id of the window making the request, as an outerwindowid. parentwindowid n...
...And 7 more matches
ARIA Test Cases - Accessibility
expected at behavior: when focus falls on a button, a screen reader speaks the text of the button plus alternative text of any images within the button (the accessible name of the button). the word "button" is also spoken before or after the accessible name. markup used: notes: results: at firefox ie ...
...sults: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - -
description description for groupbox and for button (al) note: the
description role is no longer necessary as long as aria-describedby is used; however, this test case is still useful for testing aria-describedby. expected at behavior: when any control is focused inside the groupbox, where focus was previously outside of the groupbox, the
description for the entire groupbox should be read by a scree...
... (al) note: the
description role is no longer necessary as long as aria-describedby is used; however, this test case is still useful for testing aria-describedby. expected at behavior: when any control is focused inside the groupbox, where focus was previously outside of the groupbox, the
description for the entire groupbox should be read by a screen reader. when the button is focused, the
description of the button should be read after the button's label and role are read by the screen reader. regression testers should test both tabbing forward and back, to make sure that the groupbox
description and button
description are both read when the button is the first item focused in the groupbox. (al) alternatively,
description are not read automatically but may be accessible from a hotkey. howeve...
...And 7 more matches
Perceivable - Accessibility
how to conform to the criteria practical resource 1.1.1 provide text equivalents (a) all images that convey meaningful content should be given suitable alternative text. text alternatives. complex images or charts should have an accessible alternative provided, either on the same page or via a link. use a regular link instead of a longdesc attribute. a text
description may work, or an accessible data table (see html table advanced features and accessibility). see other text alternative mechanisms for the argument against longdesc. multimedia content (i.e., audio or video) should at least have a descriptive identification available, such as a caption or similar. see text alternatives for static caption options, and audio transcripts, video t...
... if you have to include an image via an <img> element, give it a blank alt (alt=""). otherwise, screenreaders may try to read out the filepath, etc. if you are including background video or audio that autoplays, make it as unobtrusive as possible. don't make it look/sound like content, and provide a control to turn it off. ideally, don't include it at all. note: also see the wcag
description for guideline 1.1: text alternatives. guideline 1.2 — providing text alternatives for time-based media time-based media refers to multimedia with a duration, such as audio and video. note that if the audio/video serves as an alternative to existing text content, you don't need to provide another text alternative. success criteria how to conform to the criteria practical resou...
...ote that if the audio/video serves as an alternative to existing text content, you don't need to provide another text alternative. success criteria how to conform to the criteria practical resource 1.2.1 provide alternatives for pre-recorded audio-only and video-only content (a) a transcript should be provided for prerecorded audio-only media, and a transcript or audio
description should be provided for prerecorded video-only media (i.e., silent video). see audio transcripts for transcript information. no audio
description tutorial is available yet. 1.2.2 provide captions for web-based video (a) you should provide captions for video presented on the web (e.g., html5 video). this is for the benefit of people who can't hear the audio part of the video. see ...
...And 7 more matches
Image file type and format guide - Web media technologies
image file type details the following sections provide a brief overview of each of the image file types supported by web browsers. in the tables below, the term bits per component refers to the number of...
...erfaces. mime type image/apng file extension(s) .apng specification wiki.mozilla.org/apng_specification browser compatibility chrome 59, edge 12, firefox 3, opera 46, safari 8 maximum dimensions 2,147,483,647×2,147,483,647 pixels supported color modes color mode bits per component (d)
description greyscale 1, 2, 4, 8, and 16 each pixel consists of a single d-bit value indicating the brightness of the greyscale pixel. true color 8 and 16 each pixel is represented by three d-bit values indicating the level of the red, green, and blue color components. indexed color 1, 2, 4, and 8 ...
... true color 8 and 16 each pixel is represented by three values representing the red, green, and blue color components; each is d bits. indexed color 2, 4, and 8 each pixel is represented by a value w...
...And 7 more matches
Introduction to XUL - Archive of obsolete content
warning: the content of this article may be out of date. preamble mozilla has configurable, downloadable chrome, meaning that the arrangement and even presence or absence of controls in the main window is not hardwired into the application, but loaded from a separate ui
description. in fact, most of mozilla's windows (and dialogs) will be described using this mechanism. xul (pronounced "zool," as if that spelling helped any, and short for "xml user interface language") is our name for the language in which these ui
descriptions are built. window chrome is displayed and managed by the same layout engine that manages html content in the browser. ui
descriptions, then, look a great deal like html 4. xul is an application of xml. in fact, it is just xml with specific meaning defined for...
...c cross-platform application framework. that's been done, and is a great deal of work. we intend to provide a subset of cross-platform functionality suitable for building network applications like browsers, leveraging the cross-platform functionality already built into gecko, mozilla's html layout engine. the term "cross-platform ui" is somewhat misleading. ui designers will be able to create ui
descriptions which will work on multiple platforms. but proper ui
descriptions which take into account various platforms' differing ideas about proper placement of such things as dialog buttons will require some platform-specific work. a single xul specification can only cross-platform to a degree. ui designers and build engineers will need to maintain separate, platform-specific versions of at least some xu...
...of a particular application of xml; say, the syntax for specifying a toolbar, are left to separate documents describing those particular applications. check the xptoolkit index for the most recent list. since xul is a language for describing window layout, there is some overlap in the topics covered by this document and a separate document describing xul windows. the task of writing a xul window
description is basically the same as the task of writing an html content
description, with these exceptions: the syntax is xml (not that different from html 4), and there are some elements unique to xul. these elements are widgets and certain infrastructure associated with the behaviour of the window, explained below. most of the details of writing a xul document are identical to those for writing an xml do...
...And 6 more matches
Bindings - Archive of obsolete content
« previousnext » we can add more triples to the previous example to show more information. for example, a
description could be added to a photo. to do this all we need to do is add the necessary data to the rdf datasource and add another <triple> element to the template's statements. <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/
description" object="?
description"/> </query> it works similarly to the previous triple. the ?photo variable is filled in with the known value and then the arc is looked up the datasource, filling in the value for the ?desc...
...://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/
description" object="?
description"/> </query> it works similarly to the previous triple. the ?photo variable is filled in with the known value and then the arc is looked up the datasource, filling in the value for the ?
description variable. the ?
description variable would then be used in the action body. let assume though, that we are only going to add a
description to one of the photos in the datasource; the other two photos will not have a
description. ...
...ous triple. the ?photo variable is filled in with the known value and then the arc is looked up the datasource, filling in the value for the ?
description variable. the ?
description variable would then be used in the action body. let assume though, that we are only going to add a
description to one of the photos in the datasource; the other two photos will not have a
description. this may mean the
description is not known, or that it wasn't filled in by the user. <rdf:
description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" dc:title="palace from above"/> dc:
description="view from the top of the tower looking east of the doges palace"/> if you try a full example based on this data, you will notice that only one result has been generated. this...
...And 6 more matches
Theme Packaging
ction of the add-ons manager. it can be any size. icon.png is a 32x32 (max. 48x48) png (may contain alpha transparency) which will show up in the appearance section of the add-ons manager. ...
...n alpha transparency) which will show up in the appearance section of the add-ons manager. ...
...004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:type>4</em:type> more properties </
description> </rdf> required install.rdf properties your install.rdf file must have the following properties. see the install.rdf reference for more information: em:id em:version em:type em:targetapplication em:name em:internalname optional install.rdf properties em:
description em:creator em:contributor em:homepageurl em:updateurl note that if your theme will be made available on the https://addons.mozilla.org website, it may not include an updateurl. ...
...And 6 more matches
Using DTMF with WebRTC - Web APIs
fied somewhat because we control both the caller and the receiver, so handlecallernegotiationneeded() is able to quickly construct the connection by chaining the required calls together for both the caller and receiver, as shown below. ...
...receiver, so handlecallernegotiationneeded() is able to quickly construct the connection by chaining the required calls together for both the caller and receiver, as shown below. ...
...nection by chaining the required calls together for both the caller and receiver, as shown below. ...
...And 6 more matches
PWA developer guide - Progressive web apps (PWAs)
reation of progressive web applications (pwas). for all other documentation about web development, which generally pertains to pwas as well, see our primary web development documentation. --->>> titles below are just for the list; give articles good seo names and feel free to tweak those and this as needed... ...
...nt documentation. --->>> titles below are just for the list; give articles good seo names and feel free to tweak those and this as needed... <<<--- web app basics introduction and getting started with pwa development some
description installing and uninstalling web apps an introductory guide to how a web app can be installed on the user's device... ...
...the list; give articles good seo names and feel free to tweak those and this as needed... <<<--- web app basics introduction and getting started with pwa development some
description installing and uninstalling web apps an introductory guide to how a web app can be installed on the user's device... ...
...And 6 more matches
SVG documentation index - SVG: Scalable Vector Graphics
pport using svg within css styles to apply graphical effects to html content. 3 compatibility sources svg the following sources are used for the compatibility tables on svg elements and attributes: 4 content type needstechnicalreview, svg, types, data types svg makes use of a number of data types. this article lists these types along with their syntax and
descriptions of what they're used for. 5 linking guide, svg the target attribute on the svg <a> element doesn't work in mozilla firefox 1.5. when svg documents are embedded within a parent html document using the tag: 6 namespaces crash course svg, xml as an xml dialect, svg is namespaced. it is important to understand the concept of namespaces and how they are used ...
...m-origin svg attribute sets the origin for an item’s transformations. 225 type needscompattable, needsexample, svg, svg attribute, filter the type attribute is a generic attribute and it has different meaning based on the context in which it's used. ...
...ions. 225 type needscompattable, needsexample, svg, svg attribute, filter the type attribute is a generic attribute and it has different meaning based on the context in which it's used. ...
...And 6 more matches
simple-prefs - Archive of obsolete content
preferences, use preferences/service. usage defining and initializing preferences to define preferences and give them initial values, add a new json array called preferences to your package.json file, and give it one entry for each preference: { "fullname": "example add-on", ... "preferences": [{ "name": "somepreference", "title": "some preference title", "
description": "some short
description for the preference", "type": "string", "value": "this is the default string value" }, { "
description": "how many of them we have.", "name": "myinteger", "type": "integer", "value": 8, "title": "how many?" }] } each preference is defined by a group of attributes. there are: mandatory attributes that a...
...eger", "type": "integer", "value": 8, "title": "how many?" }] } each preference is defined by a group of attributes. there are: mandatory attributes that all preferences must have optional attributes attributes that are specific to the preference's data type mandatory common attributes these are attributes that all preferences must have. attribute
description type the type of preference, as defined in the "preference types" section below. name an identifier for the preference. this is used to access the preference from your add-on: console.log(require("sdk/simple-prefs").prefs.mysettingname); this means that it must be a valid javascript identifier. title this is used as a label for the preference...
...ed to access the preference from your add-on: console.log(require("sdk/simple-prefs").prefs.mysettingname); this means that it must be a valid javascript identifier. title this is used as a label for the preference in the add-ons manager user interface. optional common attributes these are attributes that all preferences may have: attribute
description description this appears below the preference title in the add-ons manager ui. value a default value for the preference. depending on the preference type, this may be an integer, string, or boolean value. hidden a boolean value which, if present and set to true, means that the preference won't appear in the add-ons manager interface, so users of your add-o...
...And 5 more matches
Dehydra Object Reference - Archive of obsolete content
ra only sets properties that are applicable. for example, class types and typedefs are declared and will have a .loc property. intrinsic types such as "int" are not declared and will not have a .loc. dehydra only sets boolean flags when they are true. for example, a pointer type will have .ispointer == true, but a class type will not have an .ispointer property. common properties property type
description .loc location object source location of a type or declaration. .attributes array of objects attributes of the type or declaration. each member of the array has the following properties: { name: string, value: string or number, if applicable } see an example on enforcing final classes. code can be annotated with arbitrary user attributes: __attribute__((user("customstring"))). var...
... { name: string, value: string or number, if applicable } see an example on enforcing final classes. code can be annotated with arbitrary user attributes: __attribute__((user("customstring"))). variable objects dehydra presents ast nodes as variables. these types are used to represent variables, functions, assignments, etc. the following properties are usually available: property type
description .name string the function or variable name. .type type object the type of this function or variable. .isstatic boolean flag .isreturn boolean flag the variable is being returned. .isdecl boolean flag the variable is being declared (local variables only). .assign array of variable objects this variable is the lhs of an assignment. the value is an array of values that were assi...
...rfn(). note that when constructing the return value of a function (e.g. return t();), no container variable is available; in this case, .isreturn will be true (see function variable). variables can identified by their dehydradecl() prototype. function variable function objects are an extension of variable objects. the following additional properties are available on functions: property type
description .isvirtual true or "pure" true for virtual methods, or "pure" for pure virtuals (e.g. virtual void foo() = 0;). .isconstructor boolean flag constructors generally have a .fieldof attribute (see variable objects). .isfunction boolean flag true for function variables. type objects dehydra provides detailed type objects. dehydra type objects use the dehydratype() prototype. common type ...
...And 5 more matches
What is RSS - Archive of obsolete content
their website. they can even re-syndicate it. and more. if you don't want any of that done, then don't put it in a non-password-protected rss feed, and, of course, don't make the password public. news web sites use rss to provide everyone with a list of their newest articles. ...
...t. and more. if you don't want any of that done, then don't put it in a non-password-protected rss feed, and, of course, don't make the password public. news web sites use rss to provide everyone with a list of their newest articles. ...
...795324-d5ea-44fa-95b1-b5ce2090d4f1</guid> <pubdate>sun, 15 may 2005 13:02:08 -0700</pubdate> <link>http://news.example.com/artcle/552</link> </item> </channel> </rss> bloggers use rss to provide everyone with a list of their newest blog posts. ...
...And 5 more matches
HTML: A good basis for accessibility - Learn web development
rm input. the following seems like a reasonable enough example: fill in your name: <input type="text" id="name" name="name"> however, this is not so useful for disabled users. there is nothing in the above example to associate the label unambiguously with the form input and make it clear how to fill it in if you cannot see it. ...
...this gives the input a bigger hit area, making it easier to select. ...
... head with lots of sharp teeth.". this highlights the importance of not only using meaningful file names in case so-called alt text is not available, but also making sure that alt text is provided in alt attributes wherever possible. note that the contents of the alt attribute should always provide a direct representation of the image and what it conveys visually. any personal knowledge or extra
description shouldn't be included here, as it is not useful for people who have not come across the image before. one thing to consider is whether your images have meaning inside your content, or whether they are purely for visual decoration, and thus have no meaning. if they are decorational, it is better to write an empty text as a value for alt attribute (see empty alt attributes) or to just include them...
...And 5 more matches
HTML: A good basis for accessibility - Learn web development
rm input. the following seems like a reasonable enough example: fill in your name: <input type="text" id="name" name="name"> however, this is not so useful for disabled users. there is nothing in the above example to associate the label unambiguously with the form input and make it clear how to fill it in if you cannot see it. ...
...this gives the input a bigger hit area, making it easier to select. ...
... head with lots of sharp teeth.". this highlights the importance of not only using meaningful file names in case so-called alt text is not available, but also making sure that alt text is provided in alt attributes wherever possible. note that the contents of the alt attribute should always provide a direct representation of the image and what it conveys visually. any personal knowledge or extra
description shouldn't be included here, as it is not useful for people who have not come across the image before. one thing to consider is whether your images have meaning inside your content, or whether they are purely for visual decoration, and thus have no meaning. if they are decorational, it is better to write an empty text as a value for alt attribute (see empty alt attributes) or to just include them...
...And 5 more matches
Gecko info for Windows accessibility vendors
ome with the active accessibility 2.0 sdk tools. the method accessibleobjectfromwindow() will get you the root iaccessible corresponding to the top level window. hold on to this root iaccessible, and use it to walk through the entire tree of iaccessible's. ...
... most part, where we support an msaa feature, we have tried to duplicate internet explorer's use of it. please let us know if you find any differences not listed here: accessible relations are supported the accnavigate() method can be used with new constants defined for gecko. the results are always returned via vt_dispatch. enum { navrelation_label_for = 0x1002 }; enum { navrelation_
description_for = 0x100f }; these two relations can be used on object to determine what form control is being labelled or desribed. enum { navrelation_labelled_by = 0x1003 }; enum { navrelation_described_by = 0x100e }; these two relations are they inverse; they can be used on form controls. if the form control has an accname, you can get the iaccessible that it was labelled by in order to get m...
...ct to determine what form control is being labelled or desribed. enum { navrelation_labelled_by = 0x1003 }; enum { navrelation_described_by = 0x100e }; these two relations are they inverse; they can be used on form controls. if the form control has an accname, you can get the iaccessible that it was labelled by in order to get more formatting information. it is also useful to check for a
description. note that the label and
description relations may be used to prevent redundant information from being presented by the screen reader, since the label and
description can occur both on their own, and in the name or
description fields of an iaccessible. enum { navrelation_default_button = 0x100d }; when used within an html form or a xul dialog, the navrelation_default_button relation ...
...And 5 more matches
Index
monkey js_comparestrings compares two js strings, str1 and str2. if the strings are identical in content and length, js_comparestrings stores 0 in *result. if str1 is less than str2, *result is less than 0. if str1 is greater than str2, *result is greater than 0. 207 js_compilefilehandleforprincipals jsapi reference, needscontent, obsolete, spidermonkey please provide a
description of this function. 208 js_compilefilehandleforprincipalsversion jsapi reference, needscontent, obsolete, spidermonkey please provide a
description for this function. 209 js_compilefunction jsapi reference, spidermonkey js_compilefunction compiles a function from a text string, bytes, and optionally associates it with a js object, obj. js_compileucfunction ...
...rprincipals jsapi reference, obsolete, spidermonkey js_compilescriptforprincipals compiles a security-enabled script, src, for execution. js_compileucscriptforprincipals is the unicode version of the function. the script is associated with a js object. 213 js_compileucfunctionforprincipalsversion jsapi reference, needscontent, obsolete, spidermonkey please provide a
description for this function. 214 js_compileutf8file jsapi reference, obsolete, spidermonkey js_compileutf8file compiles the text of script in an external file location for execution by the js engine. filename is the name of the file containing the script to compile. 215 js_compileutf8filehandle jsapi reference, obsolete, spidermonkey no summary! 216 js_c...
...ript returns the source code of script. if script is a function, it calls js_decompilefunction. otherwise, it returns the original source code of the script. if the script is not cached, it tries to load the source from file, and returns nullptr if an error happened while loading. 225 js_decompilescriptobject jsapi reference, needscontent, spidermonkey fixme: please provide a
description for this function. 226 js_deepfreezeobject jsapi reference, reference, référence(2), spidermonkey js_deepfreezeobject freezes obj, and all objects it refers to, recursively. this will not recurse through non-extensible objects, on the assumption that those are already deep-frozen. 227 js_defaultvalue jsapi reference, spidermonkey renamed to js::toprimit...
...And 5 more matches
Animated PNG graphics
and height parameters of the png 'ihdr' chunk. conceptually, each frame is constructed in the output buffer before being composited onto the canvas. the contents of the output buffer are available to the decoder. the corners of the output buffer are mapped to the corners of the canvas. fully transparent black means red, green, blue and alpha components are all set to zero. for purposes of chunk
descriptions, an unsigned int shall be a 32-bit unsigned integer in network byte order limited to the range 0 to (2^32)-1; an unsigned short shall be a 16-bit unsigned integer in network byte order with the range 0 to (2^16)-1; and a byte shall be an 8-bit unsigned integer with the range 0 to (2^8)-1. error handling apng is designed to allow incremental display of frames before the entire image has been re...
... treat out-of-order apng chunks as an error. apng-aware png editors should restore them to correct order using the sequence numbers. 'actl': the animation control chunk the 'actl' chunk is an ancillary chunk as defined in the png specification. it must appear before the first 'idat' chunk within a valid png stream. the 'actl' chunk contains: byte offset field name field type
description 0 num_frames unsigned int the number of frames in the apng. 4 num_plays unsigned int the number of times to loop this apng. 0 indicates infinite looping. num_frames indicates the total number of frames in the animation. this must equal the number of 'fctl' chunks. 0 is not a valid value. 1 is a valid value for a single-frame apng. if this value does not ...
...before the 'fdat' chunks for the frame. for all subsequent frames, the 'fctl' chunk for frame n must appear after the 'fdat' chunks from frame n-1 and before the 'fdat' chunks for frame n. other ancillary chunks are allowed to appear among the apng chunks, including between 'fdat' chunks. exactly one 'fctl' chunk is required for each frame. byte offset field name field type
description 0 sequence_number unsigned int sequence number of the animation chunk, starting with 0. 4 width unsigned int width of the following frame. 8 height unsigned int height of the following frame. 12 x_offset unsigned int x position at which to render the following frame. 16 y_offset unsigned int y position at wh...
...And 5 more matches
XUL Accessibility
introduction this article shows how xul control elements are mapped to accessibility api. it is much in progress. at api general rules this section holds some rules applied to generating accessible name and
description. aggregating the text from element subtree if the child node is hidden then it's ignored excepting the case when the element used as label is hidden itself if the child node is text node then its rendered value is appended if the child node is element then if it implements nsidomxullabeledcontrolelement then the value of label property is appended otherwise if it's a label element then then value attribute is appended otherwise append tooltiptext attribute append the accessible value searching specific element in neighbour of the element search inside the element subtr...
... is anonymous then search in whole anonymous subtree, here the attribute anonid is used instead of id attribute accessible properties this section describes common rules how accessibility properties are formed for xul elements. ...
...le anonymous subtree, here the attribute anonid is used instead of id attribute accessible properties this section describes common rules how accessibility properties are formed for xul elements. ...
...And 5 more matches
Index
pcom factories can be very simple. rick potts wrote a templated-based generic factory (nsfactory<t>) that simplifies the factory creation process that just requires writing a createinstance() method. the new nsigenericfactory interface takes this a step further, by providing a single interface that can be reused anytime a simple implementation of nsifactory is needed. here is the interface, and a
description of its use.</t> 10 how to pass an xpcom object to a new window needsexample, needshelp if you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the arguments to the window creation method. 11 how to build a binary xpcom component using visual studio add-ons, extensions, xpcom ...
...an be used from c, c++, and javascript. that means you can call javascript methods from c++ and vice versa. for more information on the workings of xpcom look elsewhere. 12 index found 1275 pages: 13 interfacing with the xpcom cycle collector firefox 3, xpcom this is a quick overview of the cycle collector introduced into xpcom for firefox 3, including a
description of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection. if you have a class that you think is involved in a cyclical-ownership leak, this page is for you. 14 introduction to xpcom for the dom developing mozilla warning: this document has not yet been reviewed by the dom gurus, it might contain some errors. 15 language bind...
...0 using components deprecated, guide, needscontent, xpcom, xpcom:language bindings, xpconnect xpconnect works transparently in mozilla and xpcshell to give you access to xpcom components. 61 xpconnect wrappers guide, needscontent, xpcom, xpcom:language bindings, xpconnect this document is a high-level overview of xpconnect wrapper objects (for the more technical
description see xpconnect security membranes). for practical advice on dealing with wrappers, see safely accessing content dom from chrome. 62 appshellservice xpcom:language bindings, xpconnect quitting mozilla: 63 nsiprofile interfaces, xpcom, xpcom:language bindings, xpconnect this interface is obsolete; you should use nsitoolkitprofileservice instead; however, ref...
...And 5 more matches
imgIDecoderObserver
arequest, in boolean aislastpart); methods native code only!ondataavailable decode notification. called when there is more to paint. void ondataavailable( in imgirequest arequest, in boolean acurrentframe, [const] in nsintrect arect ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. acurrentframe missing
description arect missing
description ondiscard() called when the decoded image data is discarded. this means that the frames no longer exist in decoded form, and any attempt to access or draw the image will initiate a new series of progressive decode notifications. void ondiscard( in imgirequest arequest ); parameters arequest the request on which data is available, or null if being cal...
...ht from the image. by the time this callback is been called, the size has been set on the container and status_size_available has been set on the associated imgrequest. void onstartcontainer( in imgirequest arequest, in imgicontainer acontainer ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. acontainer missing
description onstartdecode() this decode notification is called as soon as the image begins getting decoded. this does not include "header-only" decodes used by decode-on-draw to parse the width/height out of the image. thus, it is a decode notification only. void onstartdecode( in imgirequest arequest ); parameters arequest the request on which data is available, or null if being called for an i...
...the request on which data is available, or null if being called for an imgidecoder object. onstartframe() this is a decode notification which is called when each frame is created. void onstartframe( in imgirequest arequest, in unsigned long aframe ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. aframe missing
description onstartrequest() a load notification which is called at the same time that nsirequestobserver.onstartrequest() would be (used only for observers of imgirequest objects, which are nsirequests, not imgidecoder objects). void onstartrequest( in imgirequest arequest ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. onstopco...
...And 5 more matches
ctypes
similar to errno in libc, available on all platforms. cannot be set. winlasterror number|undefined the value of the latest windows error. similar to getlasterror under windows, available only for windows. cannot be set. constants abi constants these constants are used to specify the abi used to call a native...
...test system error. similar to errno in libc, available on all platforms. cannot be set. winlasterror number|undefined the value of the latest windows error. similar to getlasterror under windows, available only for windows. cannot be set. constants abi constants these constants are used to specify the abi used to call a native function in the library. constant
description default_abi corresponds to cdecl; standard libraries use this abi. you also use this for all system calls on mac os x and linux. stdcall_abi used for calling functions declared with stdcall on windows. these functions' names are automatically mangled for you by js-ctypes. winapi_abi used for calling windows system functions. these are declared as stdcall on win...
...nctions declared with stdcall on windows. these functions' names are automatically mangled for you by js-ctypes. winapi_abi used for calling windows system functions. these are declared as stdcall on windows, but do not have mangled names like those used by stdcall_abi above. predefined data types primitive types these types behave the same on all platforms. type
description int8_t signed 8-bit integer. uint8_t unsigned 8-bit integer. int16_t signed 16-bit integer. uint16_t unsigned 16-bit integer. int32_t signed 32-bit integer. uint32_t unsigned 32-bit integer. int64_t signed 64-bit integer. uint64_t unsigned 64-bit integer. float32_t 32-bit floating-point val...
...And 5 more matches
A simple RTCDataChannel sample - Web APIs
te || localconnection.addicecandidate(e.candidate) .catch(handleaddcandidateerror); we configure each rtcpeerconnection to have an event handler for the icecandidate event. start the connection attempt the last thing we need to do in order to begin connecting our peers is to create a connection offer. ...
... .catch(handleaddcandidateerror); we configure each rtcpeerconnection to have an event handler for the icecandidate event. start the connection attempt the last thing we need to do in order to begin connecting our peers is to create a connection offer. localconnection.createoffer() .then(offer => localconnection.setlocal
description(offer)) .then(() => remoteconnection.setremote
description(localconnection.local
description)) .then(() => remoteconnection.createanswer()) .then(answer => remoteconnection.setlocal
description(answer)) .then(() => localconnection.setremote
description(remoteconnection.local
description)) .catch(handlecreate
descriptionerror); let's go through this line by line and decipher what it means. first, we call rtcpeerconnection.createoffer() meth...
...this method accepts, optionally, an object with constraints to be met for the connection to meet your needs, such as whether the connection should support audio, video, or both. in our simple example, we don't have any constraints. ...
...And 5 more matches
WebRTC API - Web APIs
tc connection between the local computer and a remote peer. it is used to handle efficient streaming of data between the two peers. rtcdatachannel represents a bi-directional data channel between two peers of a connection. rtcdatachannelevent represents events that occur while attaching a rtcdatachannel to a rtcpeerconnection. the only event sent with this interface is datachannel. rtcsession
description represents the parameters of a session. each rtcsession
description consists of a
description type indicating which part of the offer/answer negotiation process it describes and of the sdp descriptor of the session. rtcstatsreport provides information detailing statistics for a connection or for an individual track on the connection; the report can be obtained by calling rtcpeerconnection.getst...
...error an rtcerrorevent indicating that an error occurred on the rtcdtlstransport. this error will be either dtls-failure or fingerprint-failure. gatheringstatechange the rtcicetransport's gathering state has changed. icecandidate an rtcpeerconnectioniceevent which is sent whenever the local device has identified a new ice candidate which needs to be added to the local peer by calling setlocal
description(). icecandidateerror an rtcpeerconnectioniceerrorevent indicating that an error has occurred while gathering ice candidates. iceconnectionstatechange sent to an rtcpeerconnection when its ice connection's state—found in the iceconnectionstate property—changes. icegatheringstatechange sent to an rtcpeerconnection when its ice gathering state—found in the icegatheringstate property—ch...
...ionstate property—changes. icegatheringstatechange sent to an rtcpeerconnection when its ice gathering state—found in the icegatheringstate property—changes. message a message has been received on the data channel. the event is of type messageevent. negotiationneeded informs the rtcpeerconnection that it needs to perform session negotiation by calling createoffer() followed by setlocal
description(). open the underlying data transport for the rtcdatachannel has been successfully opened or re-opened. selectedcandidatepairchange the currently-selected pair of ice candidates has changed for the rtcicetransport on which the event is fired. track the track event, of type rtctrackevent is sent to an rtcpeerconnection when a new track is added to the connection following the successful nego...
...And 5 more matches
The Box Model - Archive of obsolete content
ons, the packing will no longer be useful, but the alignment still makes a difference. it also wouldn't make sense to use flexibility or packing in the hbox if it didn't have any available horizontal space; the container element needs to either be flexible itself, or have a fixed width larger than its contents. text there are 2 xul elements that are typically used for displaying text: label and
description. their behavior is nearly identical, but they are meant to be used in different situations. the label element should be used mainly for text in xul forms, such as the ones you see in the firefox options / preferences window. here's a typical usage of the label element: <label control="xulschoolhello-greeting-textbox" value="&xulschoolhello.typegreeting.label;" /> <textbox id="xulschoolhello...
.../> <textbox id="xulschoolhello-greeting-textbox" /> the label says something like "type a greeting message", and the textbox next to it allows the user to type the message. the control attribute links the label to the textbox. if the user clicks on the label, the textbox will be focused. also, if the user has a screen reader, the label will be read when the focus is placed on the textbox. the
description element is used for the rest of the cases, where the text is only meant as additional information and is not related to input elements. handling text in xul may seem simple, but it's actually quite a tricky subject. you always have to keep in mind that localized strings may be significantly longer in other languages, specially much longer than english strings. you should avoid using long blocks ...
...may be significantly longer in other languages, specially much longer than english strings. you should avoid using long blocks text, and also avoid designing your ui so that everything fits just right around text. you should always keep in mind that the text can be much longer, and your ui should adapt to it. labels should generally be short, and they should always be displayed in a single line. ...
...And 4 more matches
Creating a status bar extension - Archive of obsolete content
s sample to look over -- or to use as the basis for your own extension. download the sample the install manifest the install manifest, install.rdf, is a text file containing information that tells the host application important information about the extension. ...
... about the extension. ...
...<rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:id>status-bar-sample-1@example.com</em:id> <em:version>1.0</em:version> <em:type>2</em:type> <!-- front end metadata --> <em:name>status bar sample 1</em:name> <em:
description>sample static status bar panel</em:
description> <em:creator>my name</em:creator> <em:homepageurl>http://developer.mozilla.org/en/docs/creating_a_status_bar_extension</em:homepageurl> <!-- describe the firefox versions we support --> <em:targetapplication> <
description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>1.5</em:minversion> <em:maxversion>2.0.0.*</em:maxversion> </descrip...
...And 4 more matches
Index - Archive of obsolete content
6 datepicker.value xul attributes, xul reference no summary! 87 decimalplaces xul attributes, xul reference no summary! 88 default xul attributes, xul reference no summary! 89 defaultbutton xul attributes, xul reference no summary! 90 defaultset xul attributes, xul reference no summary! 91
description xul attributes, xul reference no summary! 92 dir xul attributes, xul reference no summary! 93 disablekeynavigation xul attributes, xul reference no summary! 94 disableautocomplete xul attributes, xul reference no summary! 95 disableautoselect xul attributes, xul reference no summary! 96 disabl...
...ecko 1.8, as used in firefox 1.5 and other applications, added support for non-ascii characters in javascript files loaded from xul files. 438 introduction to xul guide, xul mozilla has configurable, downloadable chrome, meaning that the arrangement and even presence or absence of controls in the main window is not hardwired into the application, but loaded from a separate ui
description. in fact, most of mozilla's windows (and dialogs) will be described using this mechanism. xul (pronounced "zool," as if that spelling helped any, and short for "xml user interface language") is our name for the language in which these ui
descriptions are built. 439 list of commands xul the following lists commands which might be usable by <command> or command dispatchers/cont...
...aces xul properties, xul reference no summary! 682 decimalsymbol xul properties, xul reference no summary! 683 deck.selectedpanel xul properties, xul reference no summary! 684 defaultbutton xul properties, xul reference no summary! 685 defaultvalue xul properties, xul reference no summary! 686
description xul properties, xul reference no summary! 687 dir xul properties, xul reference no summary! 688 disableautocomplete xul properties, xul reference no summary! 689 disablekeynavigation needshelp, xul properties, xul reference no summary! 690 disableautoselect xul properties, xul reference no summary! ...
...And 4 more matches
Custom toolbar button - Archive of obsolete content
identifier for the extension. there is more information about identifiers in a later section of this tutorial. 3. create a plain text file named install.rdf. copy the following content, making sure that you scroll to get all of it. ...
...ion of this tutorial. 3. create a plain text file named install.rdf. copy the following content, making sure that you scroll to get all of it. ...
... about="urn:mozilla:install-manifest" em:name="custom button" em:
description="my custom toolbar button" em:creator="my name" em:id="custom-toolbar-button@example.com" em:version="1.0" em:homepageurl="http://developer.mozilla.org/en/docs/custom_toolbar_button" em:iconurl="chrome://custombutton/content/icon.png" > <em:targetapplication><!-- firefox --> <
description em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" em:minversion="1.4" em:maxversion="*" /> </em:targetapplication> <em:targetapplication><!-- thunderbird --> <
description em:id="{3550f703-e582-4d05-9a08-453d09bdfdc6}" em:minversion="1.5" em:maxversion="51.0" /> </em:targetapplication> <em:targetapplication><!-- sunbird --> ...
...And 4 more matches
Introduction to RDF - Archive of obsolete content
alternatively, data in other formats can be used and code written that will read the file and create rdf data from it. ...
...alternatively, data in other formats can be used and code written that will read the file and create rdf data from it. this is how mozilla works when it reads data such as bookmarks, the history or mail messages. mozilla provides datasources for this common data so that you can easily use them. ...
... of the fields in an rdf database is a resource, each with a name associated with it. the name is described by a uri. for example, a selection of the fields in the mozilla bookmark list is described by the uris below: name http://home.netscape.com/nc-rdf#name bookmark name url http://home.netscape.com/nc-rdf#url url to link to
description http://home.netscape.com/nc-rdf#
description bookmark
description last visited http://home.netscape.com/web-rdf#lastvisitdate date of last visit these are generated by taking a namespace name and appending the field name. in the next section, we'll look at how we can use these to fill in the field values automatically. note that the last visited dat...
...And 4 more matches
Plug-in Development Overview - Gecko Plugin API Reference
bed below in installation using the registry. but when the plug-in is loaded from a well-known directory, a different method must be used. in this case to ensure the plug-in file will be loaded, it should have a name in the form of "np*.dll". also, the windows version information for the plug-in dll will be used to determines the mime types, file extensions, file open template, plug-in name, and
description. ...
...tion for the plug-in dll will be used to determines the mime types, file extensions, file open template, plug-in name, and
description. for this the version stamp of the embedded resource of the plug-in dll should contain the following set of string/value pairs: mimetype: for mime types fileextents: for file extensions fileopenname: for file open template productname: for plug-in name file
description: for
description language: for language in use in the mime types and file extensions strings, multiple values are separated by the "|" character, for example: video/quicktime|audio/aiff|image/jpeg the version stamp will be loaded only if it has been created with the language set to "us english" and the character set to "windows multilingual" in your development environment. the resource...
...t to "us english" and the character set to "windows multilingual" in your development environment. the resource code for this language and character set combination is 040904e4. unix on unix, plug-ins are found according to the section how gecko finds plug-ins. to determine the mime types and file extensions that the plug-in handles, the browser loads each library and calls into the np_getmime
description entry point. this exported c function should return a string containing the type, extension list, and type
description separated by colons. each mime types should be separated by semicolons. for example: image/xbm:xbm:x bitmap or for 2 mime types: image/xbm:xbm:x bitmap;image/png:png:portable network graphics. this information will then appear in the navigator.mimetypes dom object. npp_getvalue ...
...And 4 more matches
What’s in the head? Metadata in HTML - Learn web development
otential problems in other browsers. active learning: experiment with character encoding to try this out, revisit the simple html template you obtained in the previous section on <title> (the title-example.html page), try changing the meta charset value to iso-8859-1, and add the japanese to your page. this is the code we used: <p>japanese example: ご飯が熱い。</p> adding an author and
description many <meta> elements include name and content attributes: name specifies the type of meta element it is; what type of information it contains. content specifies the actual meta content. two such meta elements that are useful to include on your page define the author of the page, and provide a concise
description of the page. let's look at an example: <meta name="author" content="chris mil...
...ments include name and content attributes: name specifies the type of meta element it is; what type of information it contains. content specifies the actual meta content. two such meta elements that are useful to include on your page define the author of the page, and provide a concise
description of the page. let's look at an example: <meta name="author" content="chris mills"> <meta name="
description" content="the mdn web docs learning area aims to provide complete beginners to the web with all they need to know to get started with developing web sites and applications."> specifying an author is beneficial in many ways: it is useful to be able to understand who wrote the page, if you have any questions about the content and you would like to contact them. some content management systems have...
...o get started with developing web sites and applications."> specifying an author is beneficial in many ways: it is useful to be able to understand who wrote the page, if you have any questions about the content and you would like to contact them. some content management systems have facilities to automatically extract page author information and make it available for such purposes. specifying a
description that includes keywords relating to the content of your page is useful as it has the potential to make your page appear higher in relevant searches performed in search engines (such activities are termed search engine optimization, or seo.) active learning: the
description's use in search engines the
description is also used on search engine result pages. let's go through an exercise to explore ...
...And 4 more matches
Message manager overview
ious types of frame message managers, as depicted in this diagram: this diagram shows the setup when there are 2 browser windows open, one with 2 tabs open and one with 1 tab open. chrome process in the chrome process, there's a hierarchy of frame message managers: the global frame message manager, window message managers, and browser message managers. global frame message manager
description there's a single global frame message manager in the chrome process. this operates on all frames, in all content tabs. if you load a frame script using the global frame message manager, the script gets loaded separately into every open tab: three times, in the diagram above. similarly, if you send a message using the global frame message manager, it's received by all content tabs, an...
...der nsimessagelistenermanager nsimessagebroadcaster how to access access it using components.classes: // chrome script let globalmm = cc["@mozilla.org/globalmessagemanager;1"] .getservice(ci.nsimessagelistenermanager); you can also access it as the mm property of services.jsm, if you are in the parent process. window message manager
description there's a window message manager for every browser window: two, in the diagram above. it operates on all content tabs in a given window. if you load a frame script using the window message manager it gets loaded separately into each tab open in that particular window. if you send a message using the window message manager, it gets sent to all content tabs in that window. its mos...
...agebroadcaster how to access you can access it as a property of the browser window: // chrome script let windowmm = window.messagemanager; browser message manager note that in this context, "browser" refers to the xul <browser> object, which is a frame that hosts a single web document. it does not refer to the more general sense of a web browser.
description finally, there's a browser message manager for every open content tab: three, in the diagram above. this corresponds one-to-one with a content tab. scripts you load using a browser message manager are loaded only into that content tab, and messages you send are delivered only to that content tab. you can mix and match: so for example, you could load a script into every tab using...
...And 4 more matches
sslcrt.html
certusagesslserverwithstepup certusagesslca certusageemailsigner certusageemailrecipient certusageobjectsigner certusageusercertimport certusageverifyca certusageprotectedobjectsigner wincx the pin argument value to pass to pk11 functions. see
description below for more information. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to obtain the error code.
description the cert_verifycertnow function must call one or more pk11 functions to obtain the services of a pkcs #11 module. some of the pk11 functions require a pin argument (see ssl_setpkc...
...be checked. returns the function returns one of these values: if the common name in the subject dn for the certificate matches the domain name passed in the hostname parameter, secsuccess. if the common name in the subject dn for the certificate is not identical to the domain name passed in the hostname parameter, secfailure. use pr_geterror to obtain the error code.
description the comparison performed by cert_verifycertname is not a simple string comparison. instead, it takes account of the following rules governing the construction of common names in ssl server certificates: * matches anything ? matches one character \ escapes a special character $ matches the end of the string [abc] matches one occurrence of a, b, or c. the only character that n...
...of a specified certificate. syntax #include <cert.h> certcertificate *cert_dupcertificate(certcertificate *c) parameter this function has the following parameter: c a pointer to the certificate object to be duplicated. returns if successful, the function returns a pointer to a certificate object of type certcertificate.
description the cert_dupcertificate function increments the reference count for the certificate passed in the c parameter. cert_destroycertificate destroys a certificate object. syntax #include <cert.h> #include <certt.h> void cert_destroycertificate(certcertificate *cert); parameters this function has the following parameter: cert a pointer to th...
...And 4 more matches
IAccessibleImage
her-licenses/ia2/accessibleimage.idlnot scriptable this interface represents images and icons. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this interface is used for a representation of images like icons on buttons. iaccessibleimage only needs to be implemented in certain situations. ...
...icons. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this interface is used for a representation of images like icons on buttons. iaccessibleimage only needs to be implemented in certain situations. ...
...le name and
description() are not enough to fully describe the image, for example when the accessible
description() is used to define the behavior of an actionable image and the image itself conveys semantically significant information. the user can edit the content that includes an image and therefore the user needs to be able to review the image's position. method overview [propget] hresult
description([out] bstr
description ); [propget] hresult imageposition([in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); [propget] hresult imagesize([out] long height, [out] long width ); methods
description() returns the localized
description of the image. ...
...And 4 more matches
nsIWebProgressListener
tates that requests may transition through as they are being loaded. these flags are mutually exclusive. for any given request, onstatechange() is called once with the state_start flag, zero or more times with the state_transferring flag or once with the state_redirecting flag, and then finally once with the state_stop flag. note: for document requests, a second state_stop is generated (see the
description of state_is_window for more details). constant value
description state_start 0x00000001 this flag indicates the start of a request. this flag is set when a request is initiated. the request is complete when onstatechange() is called for the same request with the state_stop flag set. state_redirecting 0x00000002 this flag indicates that a request is be...
...10 this flag indicates the completion of a request. the astatus parameter to onstatechange() indicates the final status of the request. state type flags these flags further describe the entity for which the state transition is occurring. these flags are not mutually exclusive (that is an onstatechange() event may indicate some combination of these flags). constant value
description state_is_request 0x00010000 this flag indicates that the state transition is for a request, which includes but is not limited to document requests. (see below for a
description of document requests.) other types of requests, such as requests for inline content (for example images and stylesheets) are considered normal requests. state_is_document 0x00020000 this ...
...tate type flags. this flag is similar to state_is_document. however, when a document request completes, two onstatechange() calls with state_stop are generated. the document request is passed as arequest to both calls. the first has state_is_request and state_is_document set, and the second has the state_is_window flag set (and possibly the state_is_network flag set as well -- see above for a
description of when the state_is_network flag may be set). this second state_stop event may be useful as a way to partition the work that occurs when a document request completes. state modifier flags these flags further describe the entity for which the state transition is occurring. these flags are not mutually exclusive (that is an onstatechange() event may indicate some combination of these flags...
...And 4 more matches
Plug-in Development Overview - Plugins
bed below in installation using the registry. but when the plug-in is loaded from a well-known directory, a different method must be used. in this case to ensure the plug-in file will be loaded, it should have a name in the form of "np*.dll". also, the windows version information for the plug-in dll will be used to determines the mime types, file extensions, file open template, plug-in name, and
description. ...
...tion for the plug-in dll will be used to determines the mime types, file extensions, file open template, plug-in name, and
description. for this the version stamp of the embedded resource of the plug-in dll should contain the following set of string/value pairs: mimetype: for mime types fileextents: for file extensions fileopenname: for file open template productname: for plug-in name file
description: for
description language: for language in use in the mime types and file extensions strings, multiple values are separated by the "|" character, for example: video/quicktime|audio/aiff|image/jpeg the version stamp will be loaded only if it has been created with the language set to "us english" and the character set to "windows multilingual" in your development environment. the resource...
...t to "us english" and the character set to "windows multilingual" in your development environment. the resource code for this language and character set combination is 040904e4. unix on unix, plug-ins are found according to the section how gecko finds plug-ins. to determine the mime types and file extensions that the plug-in handles, the browser loads each library and calls into the np_getmime
description entry point. this exported c function should return a string containing the type, extension list, and type
description separated by colons. each mime types should be separated by semicolons. for example: image/xbm:xbm:x bitmap or for 2 mime types: image/xbm:xbm:x bitmap;image/png:png:portable network graphics. this information will then appear in the navigator.mimetypes dom object. npp_getvalue ...
...And 4 more matches
ContentIndex.add() - Web APIs
used in user-visible lists of content. url: a string containing the url of the corresponding html document. needs to be under the scope of the current service worker. ...
...used in user-visible lists of content. url: a string containing the url of the corresponding html document. needs to be under the scope of the current service worker. ...
...used in user-visible lists of content. url: a string containing the url of the corresponding html document. needs to be under the scope of the current service worker. category: optional a string defining the category of content. ...
...And 4 more matches
HTMLImageElement.longDesc - Web APIs
for example, if the image is a png of a flowchart. ...
... for example, if the image is a png of a flowchart. ...
... for example, if the image is a png of a flowchart. the longdesc property could be used to provide an explanation of the flow of control represented by the chart, using only text. ...
...And 4 more matches
RTCPeerConnection.canTrickleIceCandidates - Web APIs
the read-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the remote peer can accept trickled ice candidates. ice trickling is the process of continuing to send candidates after the initial offer or answer has already been sent to the other peer. this property is only set after having called rtcpeerconnection.setremote
description(). ideally, your signaling protocol provides a way to detect trickling support, so that you don't need to rely on this property. a webrtc browser will always support trickle ice. if trickling isn't supported, or you aren't able to tell, you can check for a falsy value for this property and then wait until the value of icegatheringstate changes to "completed" before creating and sending the initial offer. that way, t...
...offer. that way, the offer contains all of the candidates. syntax var cantrickle = rtcpeerconnection.cantrickleicecandidates; value a boolean that is true if the remote peer can accept trickled ice candidates and false if it cannot. if no remote peer has been established, this value is null. ...
...ontains all of the candidates. syntax var cantrickle = rtcpeerconnection.cantrickleicecandidates; value a boolean that is true if the remote peer can accept trickled ice candidates and false if it cannot. if no remote peer has been established, this value is null. ...
...And 4 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
ase clone https://github.com/mdn/interactive-examples and send us a pull request. <input> types how an <input> works varies considerably depending on the value of its type attribute, hence the different types are covered in their own separate reference pages. if this attribute is not specified, the default type adopted is text. the available types are as follows: type
description basic examples spec button a push button with no default behavior displaying the value of the value attribute, empty by default. <input type="button" name="button" /> checkbox a check box allowing single values to be selected/deselected. <input type="checkbox" name="checkbox"/> color a control for specifying a color; ...
...e, is based on the htmlinputelement interface, they technically share the exact same set of attributes. however, in reality, most attributes have an effect on only a specific subset of input types. in addition, the way some attributes impact an input depends on the input type, impacting different input types in different ways. this section provides a table listing all the attributes with a brief
description. this table is followed by a list describing each attribute in greater detail, along with which input types they are associated with.those that are common to most or all input types are defined in greater detail below. attributes that are unique to particular input types—or attributes which are common to all input types but have special behaviors when used on a given input type—are instead do...
...r input types—or attributes which are common to all input types but have special behaviors when used on a given input type—are instead documented on those types' pages. this element includes the global attributes. those with extra importance as it relates to <input> are highlighted. attributes for the <input> element include global html attributes and: attribute type or types
description accept file hint for expected file type in file upload controls alt image alt attribute for the image type. required for accessibility autocomplete all hint for form autofill feature autofocus all automatically focus the form control when the page is loaded capture file media capture input method in file upload control...
...And 4 more matches
2015 MDN Fellowship Program - Archive of obsolete content
even weeks of partnering closely with mozilla to (1) build curriculum, code, or likely both; and (2) receive coaching, training and best practices for effectively communicating and educating with technical information. we expect this to be between 5-10 hours of your time per week. specific projects (we encourage you to target one of these in your application): testthewebforward brief project
description mozilla participates in an important w3c open testing initiative, testthewebforward.com. to support our efforts, the fellow will review various technical specifications to identify gaps between the documentation and current situation and refine existing tests to adapt to this cross-browser test harness. activities and deliverables identify gaps between existing documentation and current develo...
...es and deliverables identify gaps between existing documentation and current development environments. the work would entail refining existing tests to adapt to this framework. required skills and experience experience and comfort writing javascript test scripts. mentor information josh matthews, mozilla platform group. github: jdm twitter: @lastontheboat service workers brief project
description service workers essentially act as proxy servers that sit between web applications, the browser and (when available) the network. they enable the creation of effective offline experiences and wiill also allow access to push notifications and background sync apis. activities and deliverables write a demonstration web application (new or existing) to showcase service worker functionality. provid...
...rs essentially act as proxy servers that sit between web applications, the browser and (when available) the network. they enable the creation of effective offline experiences and wiill also allow access to push notifications and background sync apis. activities and deliverables write a demonstration web application (new or existing) to showcase service worker functionality. ...
...And 3 more matches
package.json - Archive of obsolete content
the package.json file contains manifest data for your add-on, providing not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata required of add-ons. some of its entries, such as icon, name, and
description, have direct analogues in the install manifest format, and entries from package.json are written into the install manifest when the add-on is built using jpm xpi. others, such as lib, permissions, and preferences, represent instructions to the jpm tool itself to generate and include particular code and data structures in your add-on. creating a manifest the package.json file is initially generated in your add-on's root directory the first time you run jpm init. it looks like this (assuming the add-on's directory is "my-addon"): { "name":...
...nstructions to the jpm tool itself to generate and include particular code and data structures in your add-on. creating a manifest the package.json file is initially generated in your add-on's root directory the first time you run jpm init. ...
...hor strings, identifying other contributors to the add-on. these values will be used as the add-on's em:contributor elements in its install.rdf. note: this is deprecated along with cfx; it's not available when using jpm. dependencies a string or an array of strings specifying the names of packages that this add-on requires in order to function properly.
description the add-on's
description; this is a human-readable message describing what the add-on does. this defaults to the text "a basic add-on". this value will be used as the add-on's em:
description element in its install.rdf. engines object with supported applications (key) and required version numbers (value). the version number can both specify a minimum and maximum v...
...And 3 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
() {} function uninstall() {} changing the default search engine this change comes in two parts: 1) installing a new search engine (and removing it when your extension is disabled), and 2) setting it as a default (and restoring the previous default when your extension is uninstalled). adding a new search engine search engines may be added either directly via an api call, or indirectly via an xml
description file. while the former is the simpler method, it does not support complex
descriptions containing suggestion urls or separate keyword search urls. note: example uninstall code is only provided for restartless extensions. a separate tutorial exists for running code at uninstall in non-restartless extensions. an example bootstrap.js file illustrating the simple method follows: const { classes: cc, ...
...nsions. an example bootstrap.js file illustrating the simple method follows: const { classes: cc, interfaces: ci, utils: cu, results: cr } = components; // import the services module. cu.import("resource://gre/modules/services.jsm"); // the details of the engine to add const engine_details = { name: "example engine", iconurl: "data:image/png;base64,...", alias: "example-engine",
description: "an example search engine", method: "get", // the http request method url: "https://www.example.com/?q=_searchterms_" }; // keep track of whether this is the first run. var firstrun = false; // decide whether to select the search engine. var selectsearch = false; function startup(data, reason) { firstrun = reason == addon_install; // re-select the search engine if this is the f...
... == addon_install; // re-select the search engine if this is the first run // or we're being re-enabled. selectsearch = firstrun || reason == addon_enable; // only add the engine if it doesn't already exist. ...
...And 3 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
home"); } else { // windows settings var env_user = getenv("username"); var env_home = getenv("homepath"); } var env_mozdebug= getenv("mozilla_debug"); // var env_user = prompt("indiquez votre login", toto); // 2) lock general preferences //ldap address book lockpref("ldap_2.prefs_migrated", true); lockpref("ldap_2.servers.ldapint.auth.savepassword", true); lockpref("ldap_2.servers.ldapint.
description", "ldap int"); lockpref("ldap_2.servers.ldapint.filename", "abook-1.mab"); lockpref("ldap_2.servers.ldapint.uri", "ldap://ldap1.int-evry.fr:389/ou=people,dc=int-evry,dc=fr??sub"); lockpref("ldap_2.servers.history.filename", "history.mab"); lockpref("ldap_2.servers.history.replication.lastchangenumber", 0); lockpref("ldap_2.servers.pab.filename", "abook.mab"); lockpref("ldap_2.servers.pab.replicat...
...yimap.server.com" ); defaultpref("mail.server.server1.name", userinfo.mail ); defaultpref("mail.server.server1.port", 993 ); defaultpref("mail.server.server1.sockettype", 3 ); defaultpref("mail.server.server1.type", "imap" ); defaultpref("mail.server.server1.username", userinfo.mail ); // smtp server settings defaultpref("mail.smtpserver.smtp1.authmethod", 3 ); defaultpref("mail.smtpserver.smtp1.
description", "my company name" ); defaultpref("mail.smtpserver.smtp1.hostname", "mysmtp.server.com" ); defaultpref("mail.smtpserver.smtp1.port", 465 ); defaultpref("mail.smtpserver.smtp1.try_ssl", 3 ); defaultpref("mail.smtpserver.smtp1.username", userinfo.mail ); // glue it all together defaultpref("mail.account.account1.identities", "id1" ); defaultpref("mail.account.account1.server", "server1" ); defaul...
...avascript (here mci-mozilla-glob-prefs-tux.cgi). the variables generated (mail, cn, uid) are defined only inside the processldapvalues() function, that explains why lockpref related to these variables are located inside that function. i also couldn't use the alert() function anymore, so i changed to displayerror() function! locating the file on a web server that was the case in the netscape 4.x
description below, however, at first it was a hard thing to do in mozilla, cf. bug 206294. so now you only need to create a small encoded cfg file making a call to a web located cgi script which will actually generate the javascript configuration directives to the mozilla client. hence you can change all of your mozilla clients preferences by simply modifying a single file on a web server, great! call file ...
...And 3 more matches
Sorting and filtering a custom tree view - Archive of obsolete content
n/javascript" src="sort.js"/> <hbox align="center" id="search-box"> <label accesskey="f" control="filter">filter</label> <textbox id="filter" oninput="inputfilter(event)" flex="1"/> <button id="clearfilter" oncommand="clearfilter()" label="clear" accesskey="c" disabled="true"/> </hbox> <tree id="tree" flex="1" persist="sortdirection sortresource" sortdirection="ascending" sortresource="
description"> <treecols> <treecol id="name" label="name" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sortdirectionindicator" sortdirection="ascending"/> <splitter class="tree-splitter"/> <treecol id="
description" label="
description" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sortdirectionindicator"/> <splitter class="tree-splitter"/> <treecol ...
...able //to prevent the user from losing the row they edited var topvisiblerow = null; if (table) { topvisiblerow = gettopvisiblerow(); } if (data == null) { //put object loading code here. for our purposes, we'll hard code it. data = []; //the property names match the column ids in the xul. ...
...; if (table) { topvisiblerow = gettopvisiblerow(); } if (data == null) { //put object loading code here. for our purposes, we'll hard code it. data = []; //the property names match the column ids in the xul. ...
...And 3 more matches
Multiple Rule Example - Archive of obsolete content
« previousnext » the most common use of multiple rules is to apply different action bodies to different results. often this will be because a particular result has a property that others do not. for instance, in an earlier example, one of the photos had a
description and the other photos did not. in this case, you might wish to display the photo with a
description in a different manner. this is useful if you wish to hide any content that would be needed to display the
description. the next example shows how we can do this. <vbox id="photoslist" align="start" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <rule> <conditions> <content uri="?start"/> <member container="?start" child="?photo"/> ...
... ref="http://www.xulplanet.com/rdf/myphotos"> <template> <rule> <conditions> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/
description" object="?
description"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/date" object="?date"/> </conditions> <action> <hbox uri="?photo" class="box-padded"> <vbox> <label value="?title"/> <image src="?photo"/> </vbox> <groupbox> <captio...
...iple subject="?photo" predicate="http://purl.org/dc/elements/1.1/date" object="?date"/> </conditions> <action> <hbox uri="?photo" class="box-padded"> <vbox> <label value="?title"/> <image src="?photo"/> </vbox> <groupbox> <caption label="photo details"/> <label value="?
description"/> <label value="date: ?date"/> </groupbox> </hbox> </action> </rule> <rule> <conditions> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?phototitle"/> </conditions> <action> ...
...And 3 more matches
RDF Modifications - Archive of obsolete content
rce of a 'triple'. for mozilla's datasources, the latter two just unassert the old triple and add a new one, creating the effect of changing the value. however, only one notification is made. for instance, an assert call looks like the following: var source = rdf.getresource("http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg"); var predicate = rdf.getresource("http://purl.org/dc/elements/1.1/
description"); var target = rdf.getliteral("one of the thirty or so egyptian obelisks"); datasource.assert(source, predicate, target, true); the assert call adds a new triple to the rdf datasource. when this happens, any templates observing the datasource will be notified via the rdf observer's onassert method. the second situation when notifications are made is when a datasource is being loaded or reloaded...
...late builder then rebuilds the template completely when done. this is useful when making a large amount of changes to avoid having to keep recalculating parts of the template that might change again quickly. adding rdf triples let's say we've just added the triple below to the datasource. subject: http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg predicate: http://purl.org/dc/elements/1.1/
description object: one of the thirty or so egyptian obelisks the template builder will be notified through the rdf observer mechanism of the change. the template builder will need to check all of the queries and rules to see if this triple could cause a change in what would be displayed. if the triple wouldn't cause any change in the output, the builder won't make any changes. if the output would change, t...
...e what needs to be changed and leave the remaining parts alone. let's assume we have single query with as follows: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/
description" object="?
description"/> </query> these query statements will cause any photos with both a title and a
description to be displayed. assuming that the 'obelisk' photo doesn't have a
description already, adding the triple listed above should cause a new result to be available for this photo. the builder scans through the query statements one by one. the content tag can safely be skipp...
...And 3 more matches
XUL Template Primer - Bindings - Archive of obsolete content
onditions> and <action> elements, so we won't discuss those here. we'll use a the following data model to illustrate how bindings work. see the rdf/xml file friends.rdf, below, a simple database with name and address information for some of my good friends. ...
...ta model to illustrate how bindings work. see the rdf/xml file friends.rdf, below, a simple database with name and address information for some of my good friends. ...
...abase with name and address information for some of my good friends. ...
...And 3 more matches
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
rss has long had the <
description> element that can be used to include the contents of an <item>. for example, you could use it to include the entire contents of a blog post; or just a summary of it. however, the rss <
description> element is only suppose to be used to includeplain text data. this obviously limits you. and since many peoplewrite in html information and formatting is lost with the rss <
description> element. however, it has become common practice to putxml escaped html data in it. (even through you are not suppose to.) for example, if your blog post was: this is <b>bold</b>. then the <
description> would be: <
description>this is <b>bold</b>.</
description> note that the "<" has been turned into "<". and the ">" has been turned into ">". this greatly bloats...
...ption> note that the "<" has been turned into "<". and the ">" has been turned into ">". this greatly bloats the size of contents but is necessary since certain characters are no allowed in xml. xml does however have the cdata convention. you can put (almost) whatever you want in a cdata section. including "<" and ">" without having to escape them. using the example above we'd have: <
description><![cdata[this is <b>bold</b>.]]></
description> this helps reduce the bloat. however, the <
description> is not suppose to be used for any of this. it is only suppose to be used to includeplain text. but rss still leaves us without a way to include html contents. the rss content module fills this gap. note: do not put anything butplain text into the rss <
description> element. although it has be...
...it is not actually allowed. the rss 2.0 specification clearly states that “entity-encoded html is allowed“ and even provides examples showing exactly the syntax above (using cdata and unencoded html). the wording of this note should be reconsidered. ...
...And 3 more matches
install.rdf - Archive of obsolete content
copy the following text and paste it into a text file, then save that file as "install.rdf": <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> <!-- target application this extension can install into, with minimum and maximum supported versions. ...
...ersion="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> <!-- target application this extension can install into, with minimum and maximum supported versions. ...
... <em:version>themes_version</em:version> <!-- target application this extension can install into, with minimum and maximum supported versions. ...
...And 3 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
he form of a 128-bit "fingerprint" or "message digest". hashes are very useful for cryptography — they insure the integrity of transmitted data. this provides the basis for hmac's, which provide message authentication. 202 head codingscripting, glossary, html, head, metadata the head is the part of an html document that contains metadata about that document, such as author,
description, and links to css or javascript files that should be applied to the html. 203 high-level programming language codingscripting, glossary a high-level programming language has a significant abstraction from the details of computer operation. it is designed to be easily understood by humans and for this reason they must be translated by another software. unlike low-level program...
...214 ide codingscripting, glossary an integrated development environment (ide) or interactive development environment is a software application that provides comprehensive facilities to computer programmers for software development. an ide normally consists of a source code editor, build automation tools and a debugger. 215 idl codingscripting, glossary, idl, interface
description language an idl (interface
description language) is a generic language used to specified objects' interfaces apart from any specific programming language. 216 ietf glossary, ietf, infrastructure, internet the internet engineering task force (ietf) is a worldwide organization that drafts specifications governing the mechanisms behind the internet, especially the tcp/ip o...
...ormance mantra of rail is "focus on the user; the end goal isn't to make your site perform fast on any specific device, it's to make users happy." there are 4 stages of interaction: page load, idle, response to input, and scrolling and animation. in acronym order, the main tenets are: 352 rdf codingscripting, glossary, infrastructure, openpractices, webmechanics rdf (resource
description framework) is a language developed by w3c for representing information on the world wide web, such as webpages. rdf provides a standard way of encoding resource information so that it can be exchanged in a fully automated way between applications. 353 rest architecture, beginner, glossary, http, rest, webmechanics rest(representational state transfer) refers to a group of sof...
...And 3 more matches
How to implement a custom autocomplete search component
const class_id = components.id('x753d830-ba1e-11e0-962b-0800200c9a66'); // ← change this const class_name = "basic autocomplete"; const contract_id = '@mozilla.org/autocomplete/search;1?name=basic-autocomplete'; /** * @constructor * * @implements {nsiautocompleteresult} * * @param {string} searchstring * @param {number} searchresult * @param {number} defaultindex * @param {string} error
description * @param {array.<string>} results * @param {array.<string>|null=} comments */ function providerautocompleteresult(searchstring, searchresult, defaultindex, error
description, results, comments) { this._searchstring = searchstring; this._searchresult = searchresult; this._defaultindex = defaultindex; this._error
description = error
description; this._results = results; this._comments...
...ring, searchresult, defaultindex, error
description, results, comments) { this._searchstring = searchstring; this._searchresult = searchresult; this._defaultindex = defaultindex; this._error
description = error
description; this._results = results; this._comments = comments; } providerautocompleteresult.prototype = { _searchstring: "", _searchresult: 0, _defaultindex: 0, _error
description: "", _results: [], _comments: [], /** * @return {string} the original search string */ get searchstring() { return this._searchstring; }, /** * @return {number} the result code of this result object, either: * result_ignored (invalid searchstring) * result_failure (failure) * result_nomatch (no matches found) * result_success (matches found) ...
... searchstring) * result_failure (failure) * result_nomatch (no matches found) * result_success (matches found) */ get searchresult() { return this._searchresult; }, /** * @return {number} the index of the default item that should be entered if * none is selected */ get defaultindex() { return this._defaultindex; }, /** * @return {string}
description of the cause of a search failure */ get error
description() { return this._error
description; }, /** * @return {number} the number of matches */ get matchcount() { return this._results.length; }, /** * @return {string} the value of the result at the given index */ getvalueat: function(index) { return this._results[index]; }, /** * @return {string} ...
...And 3 more matches
JS::CompileOptions
this article covers features introduced in spidermonkey 17 compile options classes. constructor js::readonlycompileoptions(); // added in spidermonkey 31 js::owningcompileoptions(jscontext *cx); // added in spidermonkey 31 js::compileoptions(jscontext *cx, jsversion version = jsversion_unknown); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. version jsversion javascript version used to compile the script. methods some methods of js::owningcompileoptions and js::compileoptions return the instance itself to allow method chain. methods of js::readonlycompileoptions me...
...hich to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. version jsversion javascript version used to compile the script. methods some methods of js::owningcompileoptions and js::compileoptions return the instance itself to allow method chain. methods of js::readonlycompileoptions method
description bool mutederrors() const determines if errors are muted. the web platform allows scripts to be loaded from arbitrary cross-origin sources. this allows an attack by which a malicious website loads a sensitive file (say, a bank statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (via a window.onerror handler) for juicy morsels of its cont...
...propriately to child scripts and passed back in jserrorreports. const char *filename() const returns filename of the source code. const char *introducerfilename() const returns filename of the file which introduces the file. const char16_t *sourcemapurl() const returns the url of the source map. methods of js::owningcompileoptions method
description jsobject *element() const returns the dom element to which this source code belongs, if any, or null if it belongs to no dom element. source belongs to a dom element in the following cases: source belongs to a <script> element if it is the element's text content (that is, it is written out as the body of the <script> element in the markup text), or is the source docume...
...And 3 more matches
TPS Bookmark Lists
support forward slashes as part of a folder name. folder contents the contents for a folder are given as an array of objects, representing various bookmark types, described below. bookmark objects valid properties are: uri: the bookmark uri. required. title: the bookmark title. optional. defaults to the bookmark uri. loadinsidebar: true or false. optional. toggles the "load in sidebar" property.
description: the bookmark
description. optional. tags: an array of tags for the bookmark. optional. keyword: the keyword for the bookmark. optional. after: the title of the bookmark item expected to be found after this bookmark; used only in verify and modify actions. before: the title of the bookmark item expected to be found before this bookmark; used only in verify and modify actions. changes: an object c...
...tem expected to be found after this bookmark; used only in verify and modify actions. before: the title of the bookmark item expected to be found before this bookmark; used only in verify and modify actions. changes: an object containing new properties to be set for this bookmark when this asset list is used in a modify action. ...
...emark would be inserted into the bookmark list at the position of the named bookmark, causing that bookmark to be positioned below the current one) example: { livemark: "livemarkone", feeduri: "http://rss.wunderground.com/blog/jeffmasters/rss.xml", siteuri: "http://www.wunderground.com/blog/jeffmasters/show.html" } folder objects valid properties are: folder: the folder's name. required.
description: the folder's
description. optional. after: the title of the bookmark item expected to be found after this folder; used only in verify and modify actions. before: the title of the bookmark item expected to be found before this folder; used only in verify and modify actions. changes: an object containing new properties to be set for this folder when this asset list is used in a modify action. the ...
...And 3 more matches
IAccessibleAction
t can be manipulated via the native gui beyond the methods available either in the msaa iaccessible interface or in the set of iaccessible2 interfaces (other than this iaccessibleaction interface) should support the iaccessibleaction interface in order to provide assistive technology access to all the actions that can be performed by the object. each action can be performed or queried for a name,
description or associated key bindings. actions are needed more for ats that assist the mobility impaired, such as on-screen keyboards and voice command software. by providing actions directly, the at can present them to the user without the user having to perform the extra steps to navigate a context menu. the first action should be equivalent to the msaa default action. if there is only one action, iaccess...
... mobility impaired, such as on-screen keyboards and voice command software. by providing actions directly, the at can present them to the user without the user having to perform the extra steps to navigate a context menu. the first action should be equivalent to the msaa default action. if there is only one action, iaccessibleaction should also be implemented. ...
...s and voice command software. by providing actions directly, the at can present them to the user without the user having to perform the extra steps to navigate a context menu. the first action should be equivalent to the msaa default action. if there is only one action, iaccessibleaction should also be implemented. ...
...And 3 more matches
IAccessibleTable
h the index 0 up to the last (but not including) used row or column as returned by nrows() and ncolumns(). ...
...luding) used row or column as returned by nrows() and ncolumns(). ...
...out] long rowcount ); [propget] hresult nselectedchildren([out] long cellcount ); [propget] hresult nselectedcolumns([out] long columncount ); [propget] hresult nselectedrows([out] long rowcount ); [propget] hresult rowcolumnextentsatindex([in] long index, [out] long row, [out] long column, [out] long rowextents, [out] long columnextents, [out] boolean isselected ); [propget] hresult row
description([in] long row, [out] bstr
description ); [propget] hresult rowextentat([in] long row, [in] long column, [out] long nrowsspanned ); [propget] hresult rowheader([out] iaccessibletable accessibletable, [out] long startingcolumnindex ); [propget] hresult rowindex([in] long cellindex, [out] long rowindex ); hresult selectcolumn([in] long column ); [propget] hresult selectedchildren([in] long...
...And 3 more matches
IAccessibleTable2
in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) please also refer to the iaccessibletablecell interface. if you want to support older applications you should also support the iaccessibletable interface. ...
...d 3.1 / fennec 1.0) please also refer to the iaccessibletablecell interface. if you want to support older applications you should also support the iaccessibletable interface. ...
...oolean isselected ); [propget] hresult modelchange([out] ia2tablemodelchange modelchange ); [propget] hresult ncolumns([out] long columncount ); [propget] hresult nrows([out] long rowcount ); [propget] hresult nselectedcells([out] long cellcount ); [propget] hresult nselectedcolumns([out] long columncount ); [propget] hresult nselectedrows([out] long rowcount ); [propget] hresult row
description([in] long row, [out] bstr
description ); hresult selectcolumn([in] long column ); [propget] hresult selectedcells([out, size_is(, nselectedcells,)] iunknown cells, [out] long nselectedcells ); [propget] hresult selectedcolumns([out, size_is(, ncolumns)] long selectedcolumns, [out] long ncolumns ); [propget] hresult selectedrows([out, size_is(, nrows)] long selectedrows, [out] long nrows )...
...And 3 more matches
nsIAccessibleTable
mary to this article. ...
...ndex); note: renamed from getindexat in gecko 1.9.2 astring getcolumn
description(in long columnindex); long getcolumnextentat(in long row, in long column); long getcolumnindexat(in long cellindex); note: renamed from getcolumnatindex in gecko 1.9.2 void getrowandcolumnindicesat(in long cellindex, out long rowindex, out long columnindex); astring getrow
description(in long rowindex); long getrowextentat(in long row, in long column); long getrowindexat(in long cellindex); note: renamed from getrowatindex in gecko 1.9.2 void getselectedcellindices(out unsigned long cellsarraysize, [retval, array, size_is(cellsarraysize)] out long cellsarray); note: renamed from getselectedcells in gecko 1.9.2 void getselectedcolumnindices(o...
...for example, html:caption element of html:table element. read only. columncount long the number of columns in the table. read only. note: renamed from columns in gecko 1.9.2 columnheader nsiaccessibletable read only. obsolete since gecko 1.9.2 rowcount long the number of rows in...
...And 3 more matches
nsIBrowserSearchService
makes use of nsibrowsersearchservice, you should make sure that this code is executed from the callback to init(). ...
...may be null if there are no visible search engines. defaultengine nsisearchengine the default search engine. returns the first visible engine if the default engine is hidden. may be null if there are no visible search engines. read only. originaldefaultengine ...
...is shown, it will offer the option to begin using the newly added engine right away; if no confirmation dialog is shown, the new engine will be used right away automatically. void addengine( in astring engineurl, in long datatype, in astring iconurl, in boolean confirm, [optional] in nsisearchinstallcallback callback ); parameters engineurl the url to the search engine's
description file. datatype an integer representing the plugin file format. must be one of the supported search engine data types defined above. iconurl a url string to an icon file to be used as the search engine's icon. this value may be overridden by an icon specified in the engine
description file. confirm a boolean value indicating whether the user should be aske...
...And 3 more matches
nsIMimeHeaders
nsimimeheaders mailnews/mime/public/nsimimeheaders.idlscriptable ??? add brief
description of interface ??? inherits from: nsisupports last changed in gecko 1.7 implemented by: ?????????????????????????????????????. to create an instance, use: implemented by: ????????????????????????????????????? as a service: var mimeheaders = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsimimeheaders); method overview string extractheader([const] in string headername, in boolean getallofthem); void initialize([const] in string allheaders, in long allheaderssize); attributes attribute type
description allheaders string read only. ...
...lean getallofthem); void initialize([const] in string allheaders, in long allheaderssize); attributes attribute type
description allheaders string read only. ...
...lize([const] in string allheaders, in long allheaderssize); attributes attribute type
description allheaders string read only. ...
...And 3 more matches
nsIRequest
3.5 / thunderbird 3.0 / seamonkey 2.0) for example nsichannel typically passes itself as the nsirequest argument to the nsistreamlistener on each onstartrequest, ondataavaliable, and onstoprequest invocation. method overview void cancel(in nsresult astatus); boolean ispending(); void resume(); void suspend(); attributes attribute type
description loadflags nsloadflags the load flags of this request. bits 0-15 are reserved. when added to a load group, this request's load flags are merged with the load flags of the load group. loadgroup nsiloadgroup the load group of this request. while pending, the request is a member of the load group. it is the responsibility of the request to implement this policy.
... the request is a member of the load group. it is the responsibility of the request to implement this policy. name autf8string the name of the request. often this is the uri of the request. read only. status nsresult the error status associated with the request. read only. constants various load flags which may be or'd together. ...
...it does not, however, prevent cached content from being used to satisfy this request. inhibit_persistent_caching 1 << 8 this flag prevents caching on disk (or other persistent media), which may be needed to preserve privacy. ...
...And 3 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the above example shows usage of the <img> element: the src attribute is required, and contains the path to the image you want to embed. the alt attribute holds a text
description of the image, which isn't mandatory but is incredibly useful for accessibility — screen readers read this
description out to their users so they know what the image means. alt text is also displayed on the page if the image can't be loaded for some reason: for example, network errors, content blocking, or linkrot. there are many other attributes to achieve various purposes: referrer/cors c...
... image loading errors if an error occurs while loading or rendering an image, and an onerror event handler has been set on the error event, that event handler will get called. this can happen in a number of...
...tly on. the image is corrupted in some way that prevents it from being loaded. the image's metadata is corrupted in such a way that it's impossible to retrieve its dimensions, and no dimensions were specified in the <img> element's attributes. the image is in a format not supported by the user agent. attributes this element includes the global attributes. alt defines an alternative text
description of the image. note: browsers do not always display images. there are a number of situations in which a browser might not display images, such as: non-visual browsers (such as those used by people with visual impairments) the user chooses not to display images (saving bandwidth, privacy reasons) the image is invalid or an unsupported type in these cases, the browser may replace the...
...And 3 more matches
Expressions and operators - JavaScript
ceptions to type conversion within comparisons involve the === and !== operators, which perform strict equality and inequality comparisons. these operators do not attempt to convert the operands to compatible types before checking equality. the following table describes the comparison operators in terms of this sample code: var var1 = 3; var var2 = 4; comparison operators operator
description examples returning true equal (==) returns true if the operands are equal. 3 == var1 "3" == var1 3 == '3' not equal (!=) returns true if the operands are not equal. var1 != 4 var2 != "3" strict equal (===) returns true if the operands are equal and of the same type. see also object.is and sameness in js. 3 === var1 strict no...
...k as they do in most other programming languages when used with floating point numbers (in particular, note that division by zero produces infinity). for example: 1 / 2; // 0.5 1 / 2 == 1.0 / 2.0; // this is true in addition to the standard arithmetic operations (+, -, *, /), javascript provides the arithmetic operators listed in the following table: arithmetic operators operator
description example remainder (%) binary operator. returns the integer remainder of dividing the two operands. 12 % 5 returns 2. increment (++) unary operator. adds one to its operand. if used as a prefix operator (++x), returns the value of its operand after adding one; if used as a postfix operator (x++), returns the value of its operand before adding one. if x is 3, th...
...f 32 bits (zeros and ones), rather than as decimal, hexadecimal, or octal numbers. for example, the decimal number nine has a binary representation of 1001. bitwise operators perform their operations on such binary representations, but they return standard javascript numerical values. the following table summarizes javascript's bitwise operators. bitwise operators operator usage
description bitwise and a & b returns a one in each bit position for which the corresponding bits of both operands are ones. bitwise or a | b returns a zero in each bit position for which the corresponding bits of both operands are zeros. bitwise xor a ^ b returns a zero in each bit position for which the corresponding bits are the same. [returns a one in ...
...And 3 more matches
Using templates and slots - Web Components
ac0; padding: 2px 6px 2px 6px } h4 span { border: 1px solid #cee9f9; border-radius: 4px } h4 span { color: white } .attributes { margin-left: 22px; font-size: 90% } .attributes p { margin-left: 16px; font-style: italic } </style> <details> <summary> <span> <code class="name"><<slot name="element-name">need name</slot>></code> <i class="desc"><slot name="
description">need
description</slot></i> </span> </summary> <div class="attributes"> <h4><span>attributes</span></h4> <slot name="attributes"><p>none</p></slot> </div> </details> <hr> </template> that <template> element has several features: the <template> has a <style> element with a set of css styles that are scoped just to the document fragment the <template> create...
... <slot name="attributes"><p>none</p></slot> </div> </details> <hr> </template> that <template> element has several features: the <template> has a <style> element with a set of css styles that are scoped just to the document fragment the <template> creates. the <template> uses <slot> and its name attribute to make three named slots: <slot name="element-name"> <slot name="
description"> <slot name="attributes"> the <template> wraps the named slots in a <details> element. creating a new <element-details> element from the <template> next, let’s create a new custom element named <element-details> and use element.attachshadow to attach to it, as its shadow root, that document fragment we created with our <template> element above. this uses exactly the same pattern as w...
...telementbyid('element-details-template') .content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(template.clonenode(true)); } } ); using the <element-details> custom element with named slots now let’s take that <element-details> element and actually use it in our document: <element-details> <span slot="element-name">slot</span> <span slot="
description">a placeholder inside a web component that users can fill with their own markup, with the effect of composing different dom trees together.</span> <dl slot="attributes"> <dt>name</dt> <dd>the name of the slot.</dd> </dl> </element-details> <element-details> <span slot="element-name">template</span> <span slot="
description">a mechanism for holding client- side cont...
...And 3 more matches
Dialogs and Prompts - Archive of obsolete content
bove, and the default is "accept", for compatibility with previous versions. using <dialogheader> you can use the dialogheader element to add "headers" to windows. to get an idea of what it looks like, open options (or preferences) dialog in firefox or thunderbird (v1.0 and earlier only). the header to the right of the sections buttons is made with <dialogheader>: <dialogheader title="general"
description="whatever"/> note, that you should only use this element in a <dialog>, because otherwise it may be not styled properly. (although it seems to work in <window> as well). programmatic button access if you want to access the accept ("ok") and cancel buttons from script, use this: // disable the ok and cancel btns document.documentelement.getbutton("accept").disabled = true; document.documentele...
...dialogheader> elements. passing parameter to a dialog and getting return values from it. passing arguments and displaying a dialog the following code demonstrates how to pass custom arguments to a dialog, process those arguments in the dialog, and return user-modified arguments to the caller. the code to open a dialog named mydialog.xul and pass it arguments: var params = {inn:{name:"foo",
description:"bar", enabled:true}, out:null}; window.opendialog("chrome://myext/content/mydialog.xul", "", "chrome, dialog, modal, resizable=yes", params).focus(); if (params.out) { // user clicked ok. process changed arguments; e.g. write them to disk or whatever } else { // user clicked cancel. typically, nothing is done here. } mydialog.xul: <dialog xmlns="http://www.mozilla.org/...
...dialog" ondialogaccept="return onok();" onload="onload();" persist="screenx screeny width height" windowtype="mydialogwindowtype"> <script type="application/javascript" src="chrome://myext/content/mydialog.js"/> <grid> <columns><column/><column/></columns> <rows> <row align="center"><label value="name:"/><textbox id="name"/></row> <row align="center"><label value="
description:"/><textbox id="
description"/></row> <row align="center"><spacer/><checkbox id="enabled" label="check to enable"/></row> </rows> </grid> </dialog> mydialog.js: // called once when the dialog displays function onload() { // use the arguments passed to us by the caller document.getelementbyid("name").value = window.arguments[0].inn.name; document.getelementbyid("
description").v...
...And 2 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
main extension directory): depth = ../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = myextension dirs = public src xpi_name = myextension install_extension_id = myextension@mycompany.com xpi_pkgname = myextension dist_files = install.rdf include $(topsrcdir)/config/rules.mk a detailed
description of the make process, describing the key features of this makefile, can be found here. module and xpi_name are both set to the name of your extension; they should be repeated in all project makefiles so that all of the files land in the same place in the xpi staging area (see below). install_extension_id is the unique id of your extension. this can be a guid, but the format shown above is prettier...
...e root of the xpi staging area (/mozilla/$(moz_objdir)/dist/xpi-stage/). every extension must include an install.rdf file that tells firefox how to install it. ...
... located in the main extension directory and look something like this: <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:id>myextension@mycompany.com</em:id> <em:version>0.1</em:version> <em:targetapplication> <!-- firefox --> <
description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>1.0+</em:minversion> <em:maxversion>1.0+</em:maxversion> </
description> </em:targetapplication> <!-- front-end metadata --> <em:name>my first extension</em:name> <em:
description>just an example.</em:
description> <em:creator>allpeers.com</em:creator> <em:homepageurl>http://w...
...And 2 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
firefox/thunderbird addon for developers who are well-acquainted with ides like netbeans, eclipse, etc. is to use netbeans (ide from sun microsystems) and foxbeans (plugin for netbeans, by teesoft). setting up your development environment in order to develop (and test) extensions in a most convenient way it is recommended to apply some changes to firefox. in the following you will find a brief
description how to do so; a more detailed one can be found under setting up an extension development environment. create a development profile if you want to partition your everyday browsing environment from your development environment in firefox, set up a second profile for development. to create this dev profile start firefox with firefox.exe -no-remote -p dev on the first start the profile manager wi...
...art the profile manager will appear, where you can create the dev profile and configure its home-path. change your preferences for more efficient development before you get to work developing your extension, you’ll want to change some of your firefox preferences. this isn’t a requirement for extension development, but i recommend it as a way to work more efficiently. preference
description value nglayout.debug.disable_xul_cache (not present in firefox 3.5+) ordinarily, firefox will cache xul documents after they have been read in once, to speed subsequent displays. disabling this cache forces xul documents to be reloaded any every time they are displayed. true browser.dom.window.dump.enabled (not present in firefox 3.5+) enables u...
... content/clock.js the xul to display a clock in the window, and the javascript to control its operation (these files will be used in phase 2). create install manifest fill in the install.rdf file as shown in listing 1. listing 1: content for install.rdf <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <!-- unique id for extension. can be in e-mail address format or guid format --> <em:id>helloworld@xuldev.org</em:id> <!-- indicates that this add-on is an extension --> <em:type>2</em:type> <!-- extension name displayed in add-on manager --> <em:name>hello, world!</em:name> <!-- extension version number. there is a version numberi...
...And 2 more matches
XUL Events - Archive of obsolete content
opupshownthe popupshown event is executed when a <menupopup>, <panel> or <tooltip> has become visible.radiostatechangethe radiostatechange event is executed when the state of a <radio> element has changed.valuechangethe valuechange event is executed when the value of an element, <progress> for example, has changed. inherited dom events event
description blur the opposite of the focus event, the blur event is passed after an element loses the focus. attribute: onblur change this event is sent when the value of the textbox is changed. the event is not sent until the focus is mo...
... unload this event is sent to a window when the window has closed. this is done after the close event. you should place this event handler on the window element. attribute: onunload mutation dom events event
description domattrmodified this event is sent to an element when one of its attributes is modified. in the event handler, you can retrieve the attribute that was modified using the event's attrname property, and you can retrieve the old and new values of the attribute using the event's prevvalue and newvalue properties. ...
...ed that the addition of any mutation event listeners to a document degrades the performance of subsequent dom operations in that document, and that removing the listeners later does not mitigate or reverse the effect. see mutation events for more details and mutation observers for a more efficient alternative. common xul events event
description broadcast the event handler should be placed on an observer. the broadcast event is sent when the attributes of the element (such as a broadcaster) being listened to are changed. attribute: onbroadcast close this event is sent...
...And 2 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
aking sure that you scroll to get all of it. ...
...="utf-8"?> <!doctype rdf:rdf> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <rdf:seq rdf:about="urn:mozilla:package:root"> <rdf:li rdf:resource="urn:mozilla:package:custombutton"/> </rdf:seq> <rdf:
description rdf:about="urn:mozilla:package:custombutton" chrome:displayname="custom button" chrome:
description="my custom toolbar button" chrome:author="my name" chrome:name="custombutton" chrome:localeversion="1.8" chrome:skinversion="1.5" chrome:extension="true"/> <rdf:seq about="urn:mozilla:overlays"> <!-- browser --> <rdf:li> <rdf:seq about="chrome://navigator/content/navigator.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:se...
...change the text between double-quote characters on those three lines. optionally remove the sections for toolbars where you do not want your button. save the file. explanation: this file contains details of your extension, and specifies how it modifies seamonkey. 6. create a plain text file named button.xul. copy the following content, making sure that you...
...And 2 more matches
RDF Datasources - Archive of obsolete content
other datasources the tables below list some of the other datasources available with mozilla. you can use any of the resources that you want. bookmarks (rdf:bookmarks) the bookmarks are generated from the user's bookmark list. ...
...he other datasources available with mozilla. you can use any of the resources that you want. bookmarks (rdf:bookmarks) the bookmarks are generated from the user's bookmark list. ...
...ble with mozilla. you can use any of the resources that you want. bookmarks (rdf:bookmarks) the bookmarks are generated from the user's bookmark list. ...
...And 2 more matches
ant script to assemble an extension - Archive of obsolete content
this ant script helps to package an extension <?xml version="1.0"?> this build file was written by régis décamps <decamps@users.sf.net> <project name="blogmark" default="createxpi"> <property name="version" value="1.3-rc1"/> <property name="
description" value="new context-menu item to add the current page in your blogmarks"/> xpi file is created after "chrome/blogmark.jar" is created, which is then stuffed into "blogmark.xpi" <target name="createxpi" depends="createjar"
description="assemble the final build blogmark.xpi"> <zip destfile="blogmark-${version}.xpi"> <zipfileset dir="." includes="chrome/blogmark.jar" /> <zipfileset d...
...build blogmark.xpi"> <zip destfile="blogmark-${version}.xpi"> <zipfileset dir="." includes="chrome/blogmark.jar" /> <zipfileset dir="." includes="install.rdf" /> </zip> </target> everything inside the chrome directory is zipped into chrome/blogmark.jar <target name="createjar" depends="templates"
description="assemble the jar"> <jar destfile="chrome/blogmark.jar"> <fileset dir="chrome/"> <include name="**/*"/> <exclude name="**/*~"/> <exclude name="**/*.tpl.*"/> <exclude name="blogmark.jar"/> </fileset> ...
...logmark.jar"> <fileset dir="chrome/"> <include name="**/*"/> <exclude name="**/*~"/> <exclude name="**/*.tpl.*"/> <exclude name="blogmark.jar"/> </fileset> </jar> </target> <target name="templates"
description="generate files from templates."> <copy file="chrome/content/blogmark/contents.rdf.tpl.xml" tofile="chrome/content/blogmark/contents.rdf" overwrite="true"> <filterchain> <replacetokens> <token key="version" value="${version}"/> ...
...And 2 more matches
The First Install Problem - Archive of obsolete content
mples: [hkey_local_machine\software\mozillaplugins\@mycompany.com/myapplication,version=5.01\mimetypes\application/x-myapp] there can be more than one such subkey, depending on how many mimetypes an application wishes to handle (or advertise that it handles). ...
...ine\software\mozillaplugins\@mycompany.com/myapplication,version=5.01\mimetypes\application/x-myapp] there can be more than one such subkey, depending on how many mimetypes an application wishes to handle (or advertise that it handles). ...
...ion/x-myapp] there can be more than one such subkey, depending on how many mimetypes an application wishes to handle (or advertise that it handles). the mimetypes subkeys contain the following string (reg_sz) value: "
description" -- this is the actual
description of the mimetype, very much as it appears in the dll (e.g. the same mimetype
description that apears when you type "about:plugins" as a url in mozilla's location bar. example: [hkey_local_machine\software\mozillaplugins\]\@mycompany.com/myapplication,version=5.01\mimetypes\application/x-myapp]
description=myapplication plugin for app files "suffixes" -- this will be a semi-colon concatenated list of supported suffixes. th...
...And 2 more matches
Theme changes in Firefox 2 - Archive of obsolete content
nginemanager.css new file containing the ui for the search engine manager window. toolkit/mozapps/preferences/fontscaling.xul - removed from firefox 2. changes to the default theme the table below lists all the changes made in the default theme for firefox 2; you can use this information as a starting point for figuring out the changes you need to make. file
description of change browser/bookmarks/addbookmark.css updated to include microsummary-related css changes. browser/bookmarks/bookmarksproperties.css new file; includes microsummary-related css. browser/browser.css needs to be updated to include new css for microsummaries, search fields, iconic bookmark menu items, and more. browser/dropmark-nav-small.png new ...
...ton[addengines="true"] .searchbar-engine-button[open="true"] .searchbar-engine-menuitem[selected="true"] > .menu-iconic-text .searchbar-left you may of course wish to make changes to other styles as well. ...
...earchbar-engine-button[open="true"] .searchbar-engine-menuitem[selected="true"] > .menu-iconic-text .searchbar-left you may of course wish to make changes to other styles as well. ...
...And 2 more matches
Styling lists - Learn web development
ites: basic computer literacy, html basics (study introduction to html), css basics (study introduction to css), css text and font fundamentals. objective: to become familiar with the best practices and properties related to styling lists. a simple list example to begin with, let's look at a simple list example. throughout this article, we'll look at unordered, ordered, and
description lists — all have styling features that are similar, and some that are particular to their type of list. the unstyled example is available on github (check out the source code too.) the html for our list example looks like so: <h2>shopping (unordered) list</h2> <p>paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, parag...
...graph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference.</p> <ol> <li>toast pita, leave to cool, then slice down the edge.</li> <li>fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li>wash and chop the salad.</li> <li>fill pita with salad, hummus, and fried halloumi.</li> </ol> <h2>ingredient
description list</h2> <p>paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference.</p> <dl> <dt>hummus</dt> <dd>a thick dip/sauce generally made from chick peas blended with tahini, lemon juice, salt, garlic, and other ingredients.</dd> <dt>pita</dt> <dd>a soft, slightly leavened flatbread.</dd> <dt>hallou...
...these are inherited by everything on the page. rules 2 and 3 set relative font sizes for the headings, different list types (the children of the list elements inherit these), and paragraphs. this means that each paragraph and list will have the sa...
...And 2 more matches
Advanced text formatting - Learn web development
previous overview: introduction to html next there are many other elements in html for formatting text, which we didn't get to in the html text fundamentals article. the elements described in this article are less known, but still useful to know about (and this is still not a complete list by any means). ...
... up quotations,
description lists, computer code and other related text, subscript and superscript, contact information, and more. prerequisites: basic html familiarity, as covered in getting started with html. html text formatting, as covered in html text fundamentals. objective: to learn how to use lesser-known html elements to mark up advanced semantic features.
description lists in html text fundamentals, we walked through how to mark up basic lists in html, but we didn't mention the third type of list you'll occasionally come across —
description lists. the purpose of these lists is to mark up a set of items and their associated
descriptions, such as terms and definitions, or questions and answers. let's look at an example of a set of terms and definitions: so...
...in the process relaying them to the audience (but not to other characters.) monologue in drama, where a character speaks their thoughts out loud to share them with the audience and any other characters present. aside in drama, where a character shares a comment only with the audience for humorous or dramatic effect. this is usually a feeling, thought or piece of additional background information
description lists use a different wrapper than the other list types — <dl>; in addition each term is wrapped in a <dt> (
description term) element, and each
description is wrapped in a <dd> (
description definition) element. let's finish marking up our example: <dl> <dt>soliloquy</dt> <dd>in drama, where a character speaks to themselves, representing their inner thoughts or feelings and in the process ...
...And 2 more matches
Creating MozSearch plugins
the web, see creating opensearch plugins for firefox the plugin file the mozsearch format is similar to the opensearch format. the only difference is the root element and xml namespace. ...
...nsearch plugins for firefox the plugin file the mozsearch format is similar to the opensearch format. the only difference is the root element and xml namespace. ...
...oo.com/search"> <param name="p" value="{searchterms}"/> <param name="ei" value="utf-8"/> <mozparam name="fr" condition="pref" pref="yahoo-fr" /> </url> <searchform>http://search.yahoo.com/</searchform> </searchplugin> let's say the user chooses to use the yahoo! search engine plugin and enters "mozilla" in the search box and presses the enter key. firefox will use the above search engine
description to construct the following search url: http://search.yahoo.com/search?p=mozilla&ei=utf-8&fr=moz2 if the user clicks the magnifying glass icon in the search bar, or chooses the web search option in the tools menu when the search bar isn't visible, the browser will take them to http://search.yahoo.com/, the value of the <searchform> element. example: searching mdc this plugin lets you easily se...
...And 2 more matches
Commenting IDL for better documentation
hat people for whom english is not their native language will be reading your comments (as well as the generated documentation), so try to avoid slang and abbreviations when possible. if possible, avoid putting comments in the middle of the definitions of apis. if an interface is used as a parameter or as the type of the value returned by a method, please use the full name of the interface in the
description of the method. this will help the tools generate proper links to help make the documentation easier to read and browse through. special commands you can use special commands in your doxygen comments; the ones listed below are interpreted by our tools. using these will help generate much higher quality documentation, faster, with less human intervention required. command details @brief descr...
...te proper links to help make the documentation easier to read and browse through. special commands you can use special commands in your doxygen comments; the ones listed below are interpreted by our tools. using these will help generate much higher quality documentation, faster, with less human intervention required. command details @brief
description please only use this to provide a brief
description of the interface, keep it short and to the point. ...
... your doxygen comments; the ones listed below are interpreted by our tools. using these will help generate much higher quality documentation, faster, with less human intervention required. command details @brief
description please only use this to provide a brief
description of the interface, keep it short and to the point. do not include more than one brief per interface. @param parameter
description every parameter of a method should be documented, only use the parameter name, leave out things like [in]/[out]. @returns
description if the method returns something then this should be included. @throws error
description the error should be the actual name of the error constant, in all caps. @note
description used to include a note styled paragraph. @remarks remark a remark paragraph to...
...And 2 more matches
XPCOMUtils.jsm
ates how to put together a javascript class based on the steps listed above. constructor the constructor is a simple method that handles any required initialization tasks. function mycomponent() { // initialize the component here } class declaration declare the class prototype, using a form similar to this. mycomponent.prototype = { // properties required for xpcom registration: class
description: "unique text
description", classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@example.com/xxx;1", // [optional] custom factory (an object implementing nsifactory). if not // provided, the default factory is used, which returns // |(new mycomponent()).queryinterface(iid)| in its createinstance(). _xpcom_factory: { ... }, // [optional] an...
... its createinstance(). _xpcom_factory: { ... }, // [optional] an array of categories to register this component in. _xpcom_categories: [{ // each object in the array specifies the parameters to pass to // nsicategorymanager.addcategoryentry(). 'true' is passed for // both apersist and areplace params. category: "some-category", // optional, defaults to the object's class
description entry: "entry name", // optional, defaults to the object's contractid (unless // 'service' is specified) value: "...", // optional, defaults to false. when set to true, and only if 'value' // is not specified, the concatenation of the string "service," and the // object's contractid is passed as avalue parameter of addcategoryentry. service: true, // optional a...
...rfaces.nsimyinterface, "nsifoo", "nsibar" ]), // [optional] classinfo implementation, e.g. using the generateci helper. // will be automatically returned from queryinterface if that was // generated with the generateqi helper. classinfo: xpcomutils.generateci( {classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@example.com/xxx;1", class
description: "unique text
description", interfaces: [components.interfaces.nsiobserver, components.interfaces.nsimyinterface, "nsifoo", "nsibar"], flags: ci.nsiclassinfo.singleton}), // ...component implementation... }; note: the ability to register the component in a category only on specific applications by adding the apps field to a cat...
...And 2 more matches
pkfnc.html
wincx a pointer to application data for the password callback function. this pointer is set with ssl_setpkcs11pinarg during ssl configuration. to retrieve its current value, use ssl_revealpinarg. returns the function returns one of these values: if successful, a pointer to a certificate structure. if unsuccessful, null.
description a nickname is an alias for a certificate subject. there may be multiple certificates with the same subject, and hence the same nickname. this function will return the newest certificate that matches the subject, based on the notbefore / notafter fields of the certificate. when you are finished with the certificate structure returned by pk11_findcertfromnickname, you must free it by calling cert...
... wincx a pointer to application data for the password callback function. this pointer is set with ssl_setpkcs11pinarg during ssl configuration. to retrieve its current value, use ssl_revealpinarg. returns the function returns one of these values: if successful, a pointer to a private key structure. if unsuccessful, null.
description when you are finished with the private key structure returned by pk11_findkeybyanycert, you must free it by calling seckey_destroyprivatekey. the pk11_findkeybyanycert function calls the password callback function set with pk11_setpasswordfunc and passes it the pointer specified by the wincx parameter. pk11_getslotname gets the name of a slot. syntax #include <pk11func.h> char *pk11_ge...
... of a slot. syntax #include <pk11func.h> char *pk11_getslotname(pk11slotinfo *slot); parameters this function has the following parameter: slot a pointer to a slot info structure. returns the function returns one of these values: if successful, a pointer to the name of the slot (a string). if unsuccessful, null.
description if the slot is freed, the string with the slot name may also be freed. if you want to preserve it, copy the string before freeing the slot. do not try to free the string yourself. pk11_gettokenname gets the name of the token. syntax #include <pk11func.h> char *pk11_gettokenname(pk11slotinfo *slot); parameters this function has the following parameter: slot ...
...And 2 more matches
ssltyp.html
twork security services. as long as you use the form shown here, your code will not need revision. certcertdbhandle an opaque handle structure for open certificate databases. syntax #include <certt.h> typedef struct certcertdbhandlestr certcertdbhandle; certcertificate an opaque x.509 certificate object. syntax #include <certt.h> typedef struct certcertificatestr certcertificate;
description certificate structures are shared objects. when an application makes a copy of a particular certificate structure that already exists in memory, ssl makes a shallow copy--that is, it increments the reference count for that object rather than making a whole new copy. when you call cert_destroycertificate, the function decrements the reference count and, if the reference count reaches zero as a r...
... particular certificate structure that already exists in memory, ssl makes a shallow copy--that is, it increments the reference count for that object rather than making a whole new copy. when you call cert_destroycertificate, the function decrements the reference count and, if the reference count reaches zero as a result, frees the memory. the use of the word "destroy" in function names or in the
description of a function often implies reference counting. never alter the contents of a certificate structure. if you attempt to do so, the change affects all the shallow copies of that structure and can cause severe problems. pk11slotinfo an opaque structure representing a physical or logical pkcs #11 slot. syntax #include <pk11expt.h> typedef struct pk11slotinfostr pk11slotinfo; secitem a s...
...<prtypes.h> #include <secport.h> typedef enum { sibuffer, sicleardatabuffer, sicipherdatabuffer, sidercertbuffer, siencodedcertbuffer, sidernamebuffer, siencodednamebuffer, siasciinamestring, siasciistring, sideroid } secitemtype; typedef struct secitemstr secitem; struct secitemstr { secitemtype type; unsigned char *data; unsigned int len; };
description a secitem structure can be used to associate your own data with an ssl socket. to free a structure pointed to by a secitem, and, if desired, the secitem structure itself, use one the functions secitem_freeitem or secitem_zfreeitem. seckeyprivatekey an opaque, generic key structure. syntax #include <keyt.h> typedef struct seckeyprivatekeystr seckeyprivatekey;
description key structur...
...And 2 more matches
nsIAccessibleEvent
accessible/public/nsiaccessibleevent.idlscriptable an interface for accessibility events listened to by in-process accessibility clients, which can be used to find out how to get accessibility and dom interfaces for the event and its target. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type
description accessible nsiaccessible the nsiaccessible associated with the event. may return null if no accessible is available. read only. accessibledocument nsiaccessibledocument the nsiaccessibledocument that the event target nsiaccessible resides in. this can be used to get the dom window, the dom document and the window handler, among other things. read only. domnode nsidomnode the nsidomnode associated with the...
...with the event. may return null if accessible for event has been shut down. read only. eventtype unsigned long the type of event, based on the enumerated event values defined in this interface. read only. isfromuserinput boolean returns true if the event was caused by explicit user input, as opposed to purely originating from a timer or mouse movement. constants constant gecko version
description 1.7 - 1.8.1 1.9 - 1.9.2 2.0 event_show 0x8002 0x0001 an object has been created. event_hide 0x8003 0x0002 an object has been destroyed. event_reorder 0x8004 0x005c 0x0003 an object's children have changed. event_active_decendent_changed 0x0007 0x0004 the active descendant of a component has changed. the active descendant is used in objects with transient children. event_focus 0x...
.... the active descendant is used in objects with transient children. event_focus 0x8005 0x0008 0x0005 an object has received the keyboard focus. event_state_change 0x800a 0x0009 0x0006 an object's state has changed. event_location_change 0x800b 0x000a 0x0007 an object has changed location, shape, or size. event_name_change 0x800c 0x000b 0x0008 an object's name property has changed. event_
description_change 0x000c 0x0009 an object's
description property has changed. event_value_change 0x800e 0x000d 0x000a an object's value property has changed. event_help_change 0x000e 0x000b an object's help has changed. event_defaction_change 0x000f 0x000c an object's default action has changed. event_action_change 0x0010 0x000d an object's action has changed. event_accelerator_change 0x...
...And 2 more matches
nsIAccessibleRelation
66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) note: be carefull, do not change constants until atk has a structure to map gecko constants into atk constants. ...
...ng index); nsiarray gettargets(); attributes attribute type
description relationtype unsigned long returns the type of the relation. read only. targetscount unsigned long returns the number of targets for this relation. read only. constants constant value
description relation_nul 0x00 relation_controlled_by 0x01 some attribute of this object is affected by a target object. relation_controller_for 0x02 this object is interactive and controls some attribute of a target object. relation_label_for 0x03 this object is label for a target object. ...
...rget object. relation_label_for 0x03 this object is label for a target object. relation_labelled_by 0x04 this object is labelled by a target object. if the accessible has an nsiaccessible.name() , you can get the nsiaccessible that it was labelled by in order to get more formatting information. note: the label and
description (see relation_described_by) relations may be used to prevent redundant information from being presented by the screen reader, since the label and
description can occur both on their own, and in the name or
description fields of an nsiaccessible. relation_member_of 0x05 this object is a member of a group of one or more objects. when there is more than one object ...
...And 2 more matches
nsICycleCollectorListener
nformation about the cycle collector graph while it is being built. ...
...he graph a call to noteobject() and calls to noteedge() for every edge starting at that node; then a call to begin
descriptions(); then for every black node in the cycle collector graph a call to either describerefcountedobject() or to describegcedobject(); and then a call to end(). if begin() returns an error none of the other functions will be called. ...
...describegcedobject() void describegcedobject( in unsigned long long aaddress, in boolean amarked ); parameters aaddress amarked describerefcountedobject() void describerefcountedobject( in unsigned long long aaddress, in unsigned long aknownedges, in unsigned long at...
...And 2 more matches
nsIMemoryReporter
bject and then register it by calling nsimemoryreportermanager.registerreporter(). once that has been done, the reporter will be found by any client accessing the enumerator returned by nsimemoryreportermanager.enumeratereporters(). this includes the about:memory page. note: this interface is undergoing heavy development, and is subject to rapid changes. ...
...read only. kind print32 the memory kind, one of the memory reporter kind constants below. read only. path autf8string the path that this memory usage should be reported under. ...
...read only. kind print32 the memory kind, one of the memory reporter kind constants below. read only. path autf8string the path that this memory usage should be reported under. paths are delimited with '/' characters to allow a hierarchy of memory to be displayed in about:memory. ...
...And 2 more matches
nsINavHistoryQueryOptions
t/components/places/nsinavhistoryservice.idlscriptable represents the global options for executing a query. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) method overview nsinavhistoryqueryoptions clone(); attributes attribute type
description applyoptionstocontainers boolean if true, the query options are only applied to the containers. asyncenabled boolean when true, the root container node generated by these options and all of its descendant containers are opened asynchronously if they support doing so. by default, this is false. note: currently, onl...
... sortingmode short the sorting annotation to use; see sorting methods for possible values. constants sorting methods you can ask for the results to be pre-sorted. since the db has indices of many items, it can produce sorted results almost for free. note: re-sorting is slower, as is sorting by title or when you have a host name. constant value
description sort_by_none 0 for bookmark items, this constant means sort by the natural bookmark order. sort_by_title_ascending 1 sort by the ascending title order. sort_by_title_descending 2 sort by the descending title order. sort_by_date_ascending 3 sort by the ascending date order. ...
...t by the ascending annotation order. sort_by_annotation_descending 20 sort by the descending annotation order. sort_by_frecency_ascending 21 sort by ascending frecency order. sort_by_frecency_descending 22 sort by descending frecency order. result type constants constant value
description results_as_uri 0 "uri" results, one for each uri visited in the range. individual result nodes will be of type "uri". results_as_visit 1 "visit" results, with one for each time a page was visited (this will often give you multiple results for one uri). individual result nodes will have type "visit". results_as_full_visit ...
...And 2 more matches
nsIPromptService
ex. all flags are defined as unsigned long constants and can be accessed as components.interfaces.nsipromptservice.flagname from javascript and as nsipromptservice::flagname from c++. button position flags on linux and mac, button 2 is on the left of the prompt, while buttons 1 and 0 are on the right. on windows and os/2, the buttons are centred in the order 0, 2, 1. constant value
description button_pos_0 1 this is usually the button used to confirm the prompt. it typically has the label "ok", "yes", or "save". button_pos_1 256 this is the button used to cancel the prompt. it typically has the label "cancel" or "no". it is equivalent to pressing the escape key (or cmd+. on the mac), or closing the window through the os controls. button_pos_2 6...
..., or closing the window through the os controls. button_pos_2 65536 this button can be used to give the user a choice of options, but still allowing the user to cancel the prompt. for instance, it might have the label "don't save". button title flags these flags are used along with button position flags to set the labels of buttons in the prompt. constant value
description button_title_ok 1 these flags are used to select standard labels from the user's current locale. button_title_cancel 2 button_title_yes 3 button_title_no 4 button_title_save 5 button_title_dont_save 6 button_title_revert 7 button_title_is_string 127 this flag indicates that the label is passed as...
... 4 button_title_save 5 button_title_dont_save 6 button_title_revert 7 button_title_is_string 127 this flag indicates that the label is passed as a separate string. use this for labels that don't match one of the constants above. button default flags these flags are used to select which button is the default. constant value
description button_pos_0_default 0 button_pos_1_default 16777216 button_pos_2_default 33554432 button_delay_enable button_delay_enable causes the buttons to be initially disabled. they are enabled after a timeout expires. the implementation may interpret this loosely, as the intent is to ensure that the user does not click through a security dialog too...
...And 2 more matches
nsITransferable
isprivatedata boolean although this is not a read-only attribute, you should generally avoid changing it, since doing so may cause it not to actually reflect the status of the context in which the t...
... was created. native code only! requestingnode nsidomnode the source dom node this transferable was created from. native code only! note: currently, this can only be used on windows (in order to support network principal information in drag operations). constants kflavorhasdataprovider (that title needs to be better) constant value
description kflavorhasdataprovider 0 a
description is needed here. common mime types some of these need better
descriptions, especially the mozilla-specific ones. constant value
description ktextmime text/plain plain text. kunicodemime text/unicode unicode text. kmoztextinternal text/x-moz-text-internal text data that isn...
...ge/jpg jpeg image. kgifimagemime image/gif gif image. kfilemime application/x-moz-file an arbitrary file (is this an nsifile?) kurlmime text/x-moz-url a mozilla url object; this is a text string containing the url, a newline (\n), then the title of the page. kurldatamime text/x-moz-url-data a string containing only a url. kurl
descriptionmime text/x-moz-url-desc a string containing only a
description. kurlprivatemime text/x-moz-url-priv the same as kurldatamime, except intended for private use only. knativeimagemime application/x-moz-nativeimage an image in gecko's native internal image storage format. knativehtmlmime application/x-moz-nativehtml html in gecko's native internal st...
...And 2 more matches
Address Book examples
note: thunderbird and seamonkey user interfaces now reference 'contacts' not 'cards' however, as the backend still uses the 'cards' terminology, that is what is used here this article provides examples on accessing and manipulating thunderbird address books. address book interfaces provides an overview of the related interfaces. see an overview of thunderbird components for a general
description of the thunderbird user interface and related programmatic interfaces. how do i get all address books? use the address book manager to get an nsisimpleenumerator, then progress through the enumerator, looking for nsiabitem, nsiabcollection or nsiabdirectory interfaces as you require. let abmanager = components.classes["@mozilla.org/abmanager;1"] .getservice(components.int...
... parentdirectory.addmaillist(maillist); modifying a mailing list to modify a mailing list, you first need an object that impleme...
... parentdirectory.addmaillist(maillist); modifying a mailing list to modify a mailing list, you first need an object that implements nsiabcard. this ...
...And 2 more matches
Building a Thunderbird extension 3: install manifest
or newer information. the install.rdf file is an xml file that provides general information about the extension. ...
...the first portion is ...
...the first portion is the short name of the extension and must be in lowercase; the last portion is a two-part period-delimited value such as your first and last name or the top-level domain of...
...And 2 more matches
Add to iPhoto
ided default callback record, which is exported by core foundation under the name kcftypearraycallbacks. ...
... we need to be able to reference that predefine...
... we need to be able to reference that predefined structure from our cod...
...And 2 more matches
Deprecated tools - Firefox Developer Tools
d finally, we will remove the panel from the codebase. you may see a warning message, as in the following image, when trying to activate a deprecated panel: in addition, if you open the panel for one of these tools, you will also see a warning message about its removal. scratchpad scratchpad is deprecated as of firefox 70 (bug 1565380), and will be removed as of firefox 72 (bug 1519103).
description scratchpad provided an environment for experimenting with javascript code. you can write, run, and examine the result of code that interacts with the web page. alternatives in firefox 71+, you can write multi-line javascript code in the web console editor mode, making it similar to the scratchpad. the editor mode can be triggered clicking on the icon on the right of the console input, or wit...
...to debug the code you're currently writing. starting firefox 72, you can import a javascript file content in the console input with ctrl + o (cmd + o on macos), as well as saving the console input content to a file using ctrl + s (cmd + s on macos). webide and connect page webide was deprecated as of firefox 69 disabled as of firefox 70 (bug 1539451). removed as of firefox 71 (bug 1539462).
description webide allowed you to connect the firefox developer tools to remote browsers, such as firefox for android. it was also intended to support application development for firefox os. alternatives remote debugging is available in about:debugging as of firefox 68. features not ported to about:debugging are: wifi debugging for firefox for android, application development. features that are planned ...
...mote debugging is available in about:debugging as of firefox 68. features not ported to about:debugging are: wifi debugging for firefox for android, application development. features that are planned but not ported yet: remote browser screenshots and edit remote browser configuration. more details on the mailing-list thread. ...
...And 2 more matches
FileSystemEntrySync - Web APIs
fullpath readonly domstring the full absolute path from the root to the entry. an absolute path is a relative path from the root directory, prepended with a '/'. isdirectory readonly boolean true if filesystementrysync is a directory. isfile reado...
... file. name readonly domstring the name of the entry, excluding the path leading to it. methods getmetadata() look up metadata about this entry. [ todo: specify what kind of metadata ] metadata getmetada () raises (fileexception); parameter none returns metadata exceptions this method can raise a fileexception with the following codes: exception
description not_found_err the entry does not exist. invalid_state_err the filesystemsync is no longer valid for some reason besides being deleted. moveto() move an entry to a different location on the file system. moving a file over an existing file replaces that existing file. moving a directory over an existing empty directory replaces that directory. [todo: what if the ...
...ame ) raises (fileexception); parameters parent the directory to which to move the entry. newname the new name of the entry. if you do not specify a name, the browser preserves the entry's current name. returns filesystementrysync an object that represents an entry in the file system. exceptions this method can raise a fileexception with the following codes: exception
description encoding_err the name supplied is invalid, because at least one of the characters is reserved or illegal. examples include a backslash (\), dot (.), and two dots (..). not_found_err the target directory does not exist. invalid_modification_err you tried one of the following disallowed operations: moving an entry into its parent without chan...
...And 2 more matches
RTCPeerConnection.createOffer() - Web APIs
s already attached to the webrtc session, codec, and options supported by the browser, and any candidates already gathered by the ice agent, for the purpose of being sent over the signaling channel to a potential peer to request a connection or to update the configuration of an existing connection. the return value is a promise which, when the offer has been created, is resolved with a rtcsession
description object containing the newly-created offer. syntax apromise = mypeerconnection.createoffer([options]); mypeerconnection.createoffer(successcallback, failurecallback, [options]) parameters options optional an rtcofferoptions dictionary providing options requested for the offer. rtcofferoptions dictionary the rtcofferoptions dictionary is used to customize the offer created by this met...
...ed parameters in older code and documentation, you may see a callback-based version of this function. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-based version of createoffer() instead. the parameters for this form of createoffer() are described below, to aid in updating existing code. successcallback an rtcsession
descriptioncallback which will be passed a single rtcsession
description object describing the newly-created offer. errorcallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an offer failed. options optional an optional rtcofferoptions dictionary providing options requested for the offer. return value a promise whose fulfill...
...ect describing the newly-created offer. errorcallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an offer failed. options optional an optional rtcofferoptions dictionary providing options requested for the offer. return value a promise whose fulfillment handler will receive an object conforming to the rtcsession
descriptioninit dictionary which contains the sdp describing the generated offer. that received offer should be delivered through the signaling server to a remote peer. exceptions these exceptions are returned by rejecting the returned promise. your rejection handler should examine the received exception to determine which occurred. invalidstateerror the rtcpeerconnection is closed. notreadableerror ...
...And 2 more matches
RTCPeerConnection: negotiationneeded event - Web APIs
event handler property rtcpeerconnection.onnegotiationneeded the negotiationneeded event is first dispatched to the rtcpeerconnection when media is first added to the connection. this starts the process of ice negotiation by instructing your code to begin exchanging ice candidates through the signaling server. ...
...calling for a
description of the signaling process that begins with a negotiationneeded event. examples in this example, we use addeventlistener() to create an event handler for negotiationneeded. its role is to create an sdp offer and send it through the signaling channel to the remote peer. ...
...mples in this example, we use addeventlistener() to create an event handler for negotiationneeded. its role is to create an sdp offer and send it through the signaling channel to the remote peer. pc.addeventlistener("negotiationneeded", ev => { pc.createoffer() .then(offer => return pc.setlocal
description(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.local
description })) .catch(err => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocal
description(); then a signaling message is created and sent to the remote peer through the signaling server, to share that offer with the other peer. the other peer should recognize this message and follow up by creating its own rtcpeerconnect...
...And 2 more matches
RTCPeerConnection.signalingState - Web APIs
, being able to verify that your code is in the expected state when messages arrive can help avoid unexpected and avoidable failures. for example, if you receive an answer while the signalingstate isn't "have-local-offer", you know that something is wrong, since you should only receive answers after creating an offer but before an answer has been received and passed into rtcpeerconnection.setlocal
description(). your code will be more reliable if you watch for mismatched states like this and handle them gracefully. this value may also be useful during debugging, for example. in addition, when the value of this property changes, a signalingstatechange event is sent to the rtcpeerconnection instance. syntax var state = rtcpeerconnection.signalingstate; value the allowed values are those included ...
...ion instance. syntax var state = rtcpeerconnection.signalingstate; value the allowed values are those included in the enum rtcsignalingstate. rtcsignalingstate enum the rtcsignalingstate enum specifies the possible values of rtcpeerconnection.signalingstate, which indicates where in the process of signaling the exchange of offer and answer the connection currently is. ...
...ignalingstate enum specifies the possible values of rtcpeerconnection.signalingstate, which indicates where in the process of signaling the exchange of offer and answer the connection currently is. constant
description "stable" there is no ongoing exchange of offer and answer underway. this may mean that the rtcpeerconnection object is new, in which case both the local
description and remote
description are null; it may also mean that negotiation is complete and a connection has been established. "have-local-offer" the local peer has called rtcpeerconnection.setlocal
description(), passing in sdp representing an offer (usually created by calling rtcpeerconnection.createoffer()), and the offer has been applied successfully. "have-remote-offer" the remo...
...And 2 more matches
Using the aria-describedby attribute - Accessibility
the aria-describedby attribute is not used only for form elements; it is also used to associate static text with widgets, groups of elements, panes, regions that have a heading, definitions, and more. the examples section below provides more information about how to use the attribute in these cases. this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned. ...
...ml form element; it is not limited to elements that have an aria role assigned. value a space-separated list of element ids possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: application landmark
descriptions in the example below, an introductory paragraph describes a calendar application. aria-describedby is used to associate the paragraph with the application container. <div role="application" aria-labelledby="calendar" aria-describedby="info"> <h1 id="calendar">calendar</h1> <p id="info"> this calendar shows the game schedule for the boston red sox. </p> <div role="grid">...
...bedby="info"> <h1 id="calendar">calendar</h1> <p id="info"> this calendar shows the game schedule for the boston red sox. </p> <div role="grid"> ... </div> </div> example 2: a close button in the example below, a link that functions as a 'close' button on a dialog is described elsewhere in the document. ...
...And 2 more matches
Operable - Accessibility
ls and building keyboard accessibility back in 2.1.4 character key shortcuts (a) added in 2.1 if a single character key shortcut exists, then at least one of the following is true: single character key shortcuts can be turned off, remapped or are only active when the relevant user interface component is in focus. understanding character key shortcuts note: also see the wcag
description for guideline 2.1 keyboard accessible: make all functionality available from a keyboard. guideline 2.2 — enough time: provide users enough time to read and use content this guideline covers situations in which functionality may have a time limit. for example, purchases sometimes need to be completed within a time limit for security reasons. success criteria how to conform to the...
...e user can re-authenticate and continue their usage without losing any data. 2.2.6 timeouts (aaa) added in 2.1 if there is a timeout (caused by user inactivity) warn users at the start of a process so they will not be surprised that a timeout exists (or only allow the timeout to occur after 20 hours of inactivity. understanding timeouts note: also see the wcag
description for guideline 2.2 enough time: provide users enough time to read and use content. guideline 2.3 — seizures and physical reactions: do not design content in a way that is known to cause seizures or physical reactions this refers to content that, if not changed, could cause seizures in users with conditions such as epilepsy or could cause physical reactions (like dizziness) for users with cond...
...table flash and red flash thresholds. 2.3.2 three flashes (aaa) content doesn't contain any aspect that flashes more than three times per second. 2.3.3 animations from interactions (aaa) added in 2.1 allow users to disable animations from interactions (unless the animation is essential). understanding animations from interactions note: also see the wcag
description for guideline 2.3 seizures and physical reactions: do not design content in a way that is known to cause seizures or physical reactions. guideline 2.4 — navigable: provide ways to help users navigate, find content, and determine where they are the conformance criteria under this guideline relate to ways in which users can be expected to orientate themselves, and find the content and function...
...And 2 more matches
Displaying web content in an extension without security issues - Archive of obsolete content
possibilities. so properly sanitizing input is still required when using innerhtml and it is far from trivial. it is much easier to use dom manipulation methods that won’t have unexpected side-effects. ...
...clonenode() always creates a copy and textcontent only manipulates text. ...
...clonenode() always creates a copy and textcontent only manipulates text. so there is no chance of accidentally adding new elements or attributes. ...
...s text. so there is no chance of accidentally adding new elements or attributes. but what if you have to display html rather than only text, e.g. an rss feed entry? extension authors will often come up with flawed attempts to sanitize html code. instead, nsiscriptableunescapehtml.parsefragment() method should be used that is meant for just that scenario: var target = entry.getelementsbyclassname("
description")[0]; var fragment = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(
description, false, null, target); target.appendchild(fragment); this will add the html code to the specified node — minus all the potentially dangerous content. ...
Creating a Firefox sidebar extension - Archive of obsolete content
ed and where its chrome resources are stored. the first is install.rdf, the install manifest. see install manifests for a complete listing of the required and optional properties. the install manifest is listed in example 5. example 5. ...
.... example 5. ...
...the chrome manifest creates a lookup...
... xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:id>emptysidebar@yourdomain.com</em:id> <em:name>emptysidebar extension</em:name> <em:version>1.0</em:version> <em:creator>your name</em:creator> <em:
description>example extension for creation and registration of a sidebar.</em:
description> <em:targetapplication> <
description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- firefox --> <em:minversion>1.5</em:minversion> <em:maxversion>2.0.0.*</em:maxversion> </
description> </em:targetapplication> </
description> </rdf> the other manifest file is chrome.manifest, the chrome manifest file. the chrome manifest creates a lookup for all the resource types used by the extensi...
Getting Started - Archive of obsolete content
xt editor. this file is a small xml database which is used to describe the skin. list all the skins being supplied by this theme <rdf:seq about="urn:mozilla:skin:root"> <rdf:li resource="urn:mozilla:skin:myskin/1.0" /> in the code search for the part listed above. change the blue part to whatever you want your theme called and then its version number. then scroll down to the next section. <rdf:
description about="urn:mozilla:skin:myskin/1.0" chrome:displayname="my skin" chrome:accesskey="m" chrome:author="me" chrome:
description="this is my custom skin for mozilla" chrome:name="myskin/1.0" chrome:image="preview.png"> the blue areas are explained below. the first line should match the line that you modified in the previous section. the display name. that is what the ...
... chrome:name="myskin/1.0" chrome:image="preview.png"> the blue areas are explained below. the first line should match the line that you modified in the previous section. the display name. that is what the user sees in the preference panels list of themes. the access key is what key you can press to activate the skin in the preferences. replace the author section with your name. the
description shows up below the preview image. place your theme name and version number on this line point to your preview.png/preview.jpg/preview.gif here the packages section lists which components of the browser suit that you are modifying. if we also had skins for chatzilla, we would have to add another line resembling the other ones and change it to point to chatzilla. but this list includes everythin...
...rk in versions of mozilla 1.0. you'll have to increase this version number to match the version of mozilla that you want it to work on. if you have the wrong number here, after you install the skin and select it in the list, it will give you a message saying that it's out of date. if that happens, just come back to this step and change the number to whatever version of mozilla you are using. ...
...on of mozilla that you want it to work on. if you have the wrong number here, after you install the skin and select it in the list, it will give you a message saying that it's out of date. if that happens, just come back to this step and change the number to whatever version of mozilla you are using. <rdf:
description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:communicator"/> <rdf:
description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:editor"/> <rdf:
description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:global"/> <rdf:
description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:messenger"/> <rdf:
description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:navigator"/> save the file and exit the text editor. the jar file in the \...
Creating XPI Installer Modules - Archive of obsolete content
e. xul, javascript, or css files) in the chrome subdirectories and editing them with a text editor has been replaced by something a lot of developers find more confusing and esoteric. this article describes the new packaging scheme of mozilla and offers a tutorial for creating a new package that can then be redistributed, installed, and made available to users. the xpi packaging scheme a complete
description of the new packaging scheme is beyond the scope of this article. the reader is referred to jar packaging, which describes the design, goals, and options available for jar packaging in some depth. what follows is a very brief overview of the design and a
description of what mozilla expects in installable packages. resources are collected in jar archives whose contents are specified in contents.rdf...
...torial, for example, all of the resources are located under the content/ subdirectory, but they could just as easily have been archived directly at the top--along with skin and locale resources, if you wanted. where before a single manifest.rdf file described the resources in an entire package directory or archive, now contents.rdf files can be used for as large or as small a part of your package
description as you want; you can use several contents.rdf files in your package to describe the various parts (e.g., one for the skin of your package, another for the content, and so on), or you can use a single one, as was common before. mozilla is alerted to these content specifications and the resources they manage either through registration as part of an installation process (as described in this tutori...
... barley/ content/ barley.gif barley.js barley.xul contents.rdf these four files are...
...ax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <!-- list all the packages being supplied --> <rdf:seq about="urn:mozilla:package:root"> <rdf:li resource="urn:mozilla:package:barley"/> </rdf:seq> <!-- package information --> <rdf:
description about="urn:mozilla:package:barley" chrome:displayname="barley grain" chrome:author="ian oeschger" chrome:name="barley"> </rdf:
description> </rdf:rdf> create a contents.rdf file like the one in the listing above and put it in the content/ subdirectory with the other package resources. barley/ content/ barley.gif barley.js barley.xul contents.rdf these four files are all you need in your new package. the next step is to zip up the contents of the working directory. using a zip archiver[zip], create a new archive...
Complete - Archive of obsolete content
ale has its own directory there. in each locale's directory, there is an allcustom directory. this is useful when files from various components and extensions and all unpacked in the same place—it keeps each set of files separate. in the allcustom directory, the file allcustom.dtd contains the translated strings. the file contents.rdf contains registration data used by seamonkey. ...
... each locale's directory, there is an allcustom directory. this is useful when files from various components and extensions and all unpacked in the same place—it keeps each set of files separate. in the allcustom directory, the file allcustom.dtd contains the translated strings. the file contents.rdf contains registration data used by seamonkey. localizing the
description firefox etc. ...
...this is useful when files from various components and extensions and all unpacked in the same place—it keeps each set of files separate. in the allcustom directory, the file allcustom.dtd contains the translated strings. the file contents.rdf contains registration data used by seamonkey. localizing the
description firefox etc. display a
description of the extension in the extensions window. the
description in install.rdf is the default. ...
... unpacked in the same place—it keeps each set of files separate. in the allcustom directory, the file allcustom.dtd contains the translated strings. the file contents.rdf contains registration data used by seamonkey. localizing the
description firefox etc. display a
description of the extension in the extensions window. the
description in install.rdf is the default. for each supported locale, a
description in install.properties overrides the default. a preference setting in defaults/preferences/allcustom.js makes the connection between the
description and the properties file, specifying the url: chrome://allcustom/locale/install.properties again, the application's chrome registry converts this url to the correct file for the locale you are using. for example, if your locale is fr-fr, it gets the de...
Adding HTML Elements - Archive of obsolete content
. (there are xul elements for doing layout). notice that the prefix html: was added to the front of each tag. this is so that mozilla knows that this is an html tag and not a xul one. if you left out the html: part, the browser would think that the elements were xul elements and they would not display because img, input, table, and so on are not valid xul tags. in xul, you can add labels with the
description or label element. you should use these elements when you can. you can also add labels to controls either by using the html label element, or you can simply put the text inside another html block element (such as p or div) as in the example below. example 1 : source view <html:p> search for: <html:input id="find-text"/> <button id="okbutton" label="ok"/> </html:p> this code will cause the t...
...text 'search for:' to be displayed, followed by an input element and an ok button. notice that the xul button can appear inside the html elements, as it does here. plain text will only be displayed when placed inside an html element that would normally allow you to display text (such as a p tag). text outside of one will not be displayed, unless the xul element the text is inside allows this (the
description element, for example). the examples below may help. examples of html elements what follows are some examples of adding html elements to windows. in each case, the window and other common information has been left out for simplicity. a dialog with a check box example 2 : source view <html:p> click the box below to remember this decision. <html:p> <html:input id="rtd" type="checkbox"/> ...
...t summer <button id="yes" label="yes"/> <button id="no" label="no"/> as can be seen in the image, the text inside the div tag was displayed but the other text (expense report 1 and what i did last summer) was not. this is because there is no html or xul element capable of displaying text enclosing it. to have this text appear, you would need to put it inside the div tag, or enclose the text in a
description tag. note: due to bug 554290, this text actually does render in gecko 1.9.2 and later. invalid html elements <html:po>case 1</html:po> <div>case 2</div> <html:
description value="case 3"/> all three of the cases above will not display, each for a different reason. case 1 po is not a valid html tag and mozilla has no idea what to do with it. case 2 div is valid but only in html.
...it should not have the html: qualifier. ...
Adding Labels and Images - Archive of obsolete content
ation is also important for accessibility, so that screen readers read aloud the label for the control as the user tabs to it. set the value of the control attribute to the id of the element to be focused. example 3 : source view <label value="click here:" control="open-button"/> <button id="open-button" label="open"/> in the example above, clicking the label will cause the button to be focused. ...
...l as the user tabs to it. set the value of the control attribute to the id of the element to be focused. example 3 : source view <label value="click here:" control="open-button"/> <button id="open-button" label="open"/> in the example above, clicking the label will cause the button to be focused.
description element for descriptive text not associated with any particular control, you can use the
description tag. this element is useful for informative text at the top of a dialog or a group of controls for example. as with the label element, you can either use the value attribute for a single line of text or place text or xhtml content inside opening and closing
description tags for longer blocks of text. it is more common to use the attribute syntax for labels, and the text content syntax for descrip...
... informative text at the top of a dialog or a group of controls for example. as with the label element, you can either use the value attribute for a single line of text or place text or xhtml content inside opening and closing
description tags for longer blocks of text. it is more common to use the attribute syntax for labels, and the text content syntax for
descriptions. example 4 : source view <
description> this longer section of text is displayed. </
description> you can set the text via script using the textcontent property, as in the following example: <
description id="text" width="200"/> document.getelementbyid('text').textcontent = "some lengthy word wrapped text goes here."; internally, both the label element and the
description elements are the same. the label element is intended for lab...
...images xul has an element to display images within a window. this element is appropriately named image. note that the tag name is different than html (image instead of img). ...
Creating a Wizard - Archive of obsolete content
is created using the title attribute, much like one would use for regular windows. the navigation buttons are created automatically. ...
...n buttons are created automatically. ...
...<
description> this wizard will help you select the type of dog that is best for you." </
description> <label value="why do you want a dog?"/> <menulist> <menupopup> <menuitem label="to scare people away"/> <menuitem label="to get rid of a cat"/> <menuitem label="i need a best friend"/> </menupopup> </menulist> </wizardpage> <wizardpage
description="dog details"> <label value="provide additional details about the dog you would like:"/> <radiogroup> <caption label="size"/> <radio value="small" label="small"/> <radio value="large" label="large"/> </radiogroup> <radiogroup> <caption label="gender"/> <radio value="male" label="male"/> <radio value="female" label="female"/> </radiogroup> ...
...ted automatically, with a title across the top and a set of buttons along the bottom. the user can navigate between the pages of the wizard with the back and next buttons. these buttons will enable and disable themselves at the appropriate moments. in addition, on the last page, the finish button will appear. all of this is automatic, so you don't have to do anything to manipulate the pages. the
description attribute may optionally be placed on a wizardpage element to provide a sub-caption for that page. in the example above, it has been placed on the second page, but not the first page. handling page changes you will generally want to do something once the finish button is pressed. you can set an attribute onwizardfinish on the wizard element to accomplish this. set it to a script which performs ...
Stacks and Decks - Archive of obsolete content
ds to be added over an existing element. for example, a progress bar might be created using a bar and a label overlaid on top of it. shadowing with stacks one convenient use of the stack element however is that you could emulate a number of css properties with it. for example, you could create an effect similar to the text-shadow property with the following: example 1 : source view <stack> <
description value="shadowed" style="padding-left: 1px; padding-top: 1px; font-size: 15pt"/> <
description value="shadowed" style="color: red; font-size: 15pt;"/> </stack> both
description elements create text with a size of 15 points. the first, however is offset one pixel to the right and down by adding a padding to its left and top sides. this has the result of drawing the same text 'shadowed' again b...
... this method has advantages over using text-shadow because you could completely style the shadow apart from the main text. it could have its own font, underline or size. (you could even make the shadow blink). it is also useful as mozilla doesn't currently support css text shadowing. ...
.... it could have its own font, underline or size. (you could even make the shadow blink). it is also useful as mozilla doesn't currently support css text shadowing. a disadvantage is that the area taken up by the shadow makes the size of the stack larger. shadowing is very useful for creating the disabled appearance of buttons: example 2 : source view <stack style="background-color: #c0c0c0"> <
description value="disabled" style="color: white; padding-left: 1px; padding-top: 1px;"/> <
description value="disabled" style="color: grey;"/> </stack> this arrangement of text and shadow colors creates the disabled look under some platforms. note that events such as mouse clicks and keypresses are passed to the element on the top of the stack, that is, the last element in the stack. that means that but...
... children of the deck element, the deck will have three children. the displayed page of the deck can be changed by setting an selectedindex attribute on the deck element. the index is a number that identifies which page to display. pages are numbered starting from zero. so, the first child of the deck is page 0, the second is page 1 and so on. example 3 : source view <deck selectedindex="2"> <
description value="this is the first page"/> <button label="this is the second page"/> <box> <
description value="this is the third page"/> <button label="this is also the third page"/> </box> </deck> three pages exist here, the default being the third one. the third page is a box with two elements inside it. both the box and the elements inside it make up the page. the deck will be as large a...
dialogheader - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a heading row for a dialog box. this element should be placed inside a dialog element. the header may have a title and a
description. ...
... « xul reference home [ examples | attributes | properties | methods | related ] a heading row for a dialog box. this element should be placed inside a dialog element. the header may have a title and a
description. ...
...an ellipsis will be used in place of the cropped text. ...
...ays appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; }
description type: string descriptive text to appear in addition to the dialog title. title type: string the text to appear in the title bar of the window. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, mi...
menulist - Archive of obsolete content
inside the menulist containing the choices as menuitem elements. the command event may be used to execute code when the menulist selection changes. more information is available in the xul tutorial. ...
...ng the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. crop type: string gets and sets the value of the crop attribute.
description type: string set to the
description of the currently selected menuitem. disableautoselect type: boolean gets and sets the value of the disableautoselect attribute. disabled type: boolean gets and sets the value of the disabled attribute. editable type: boolean returns true if the element is editable. autocomplete fields are editable so this property ...
...the function returns the new item. contains( item ) return type: boolean returns true if the menulist contains the specified menuitem as one of its items. getindexofitem( item ) return type: integer returns the zero-based position of the specifie...
...the function returns the new item. ...
window - Archive of obsolete content
me://global/skin/" type="text/css"?> <!-- run this example using copy & paste in this live xul editor: https://github.com/km-200/xul --> <!-- extremely recommended to keep this css include!! ...
...css"?> <!-- run this example using copy & paste in this live xul editor: https://github.com/km-200/xul --> <!-- extremely recommended to keep this css include!! ...
... activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground). moreover this...
... activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground). moreover this hides separator b...
External resources for plugin creation - Archive of obsolete content
frameworks and tools there are several open source projects designed to assist with the creation of npapi plugins. please note that even when using these, it is still a good idea to have an understanding of what is going on under the hood, regardless of the level of abstraction provided. framework: firebreath project home page project history
description (from the project creators): firebreath is a cross-platform browser plugin framework written in c++. plugins created with firebreath work on all major browsers, including firefox 3.0 and later. platforms supported include windows, linux, and mac os x (intel). feature highlights include thread safety checks, unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javas...
...s, unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javascript arrays and objects), advanced security features, and more. supported development environments are visual studio on windows, xcode on mac, and gcc on linux. all platforms rely on cmake for easy cross-platform builds. project: nixysa project home page
description (from the home page): nixysa is a framework written in python to automatically generate glue code for npapi plugins (plugins for browsers such as google chrome or firefox), letting you easily expose c++ classes to javascript from a simple idl representation. nixysa was originally conceived for the needs of o3d, but is flexible enough to support a wide range of use cases. project: juce project hom...
...the home page): nixysa is a framework written in python to automatically generate glue code for npapi plugins (plugins for browsers such as google chrome or firefox), letting you easily expose c++ classes to javascript from a simple idl representation. nixysa was originally conceived for the needs of o3d, but is flexible enough to support a wide range of use cases. project: juce project home page
description (from the home page): juce (jules' utility class extensions) is an all-encompassing c++ class library for developing cross-platform applications. it contains pretty much everything you're likely to need to create most applications, and is particularly good for creating highly-specialised uis and for handling graphics and sound. supported development environments are xcode, visual studio, gcc (a...
...retty much everything you're likely to need to create most applications, and is particularly good for creating highly-specialised uis and for handling graphics and sound. supported development environments are xcode, visual studio, gcc (and probably any other modern c++ compiler) browser plugins can be built as npapi (mac/windows), or activex (windows). ...
title - Archive of obsolete content
ontain onlyplain text data. note: in userland's rss 0.91 there is a 100 character maximum limit. ...
... userland's rss 0.91 there is a 100 character maximum limit. ...
... <tr> <th>name</td> <th>tag</td> <th>0.90</td> <th>n 0.91 r1</td> <th>n 0.91 r3</td> <th>u 0.91</td> <th>0.92</td> <th>0.93</td> <th>0.94</td> <th>...
... <link>http://www.advogato.org/</link> <title>advogato</title> <url>http://www.advogato.org/image/tinyadvogato.png</url> </image> <item> <title>why can i not get any tang?!</title> <link>http://www.advogato.org/article/10101.html</link> <
description>seriously. why can't i get any tang?</
description> </item> </channel> </rss> attributes none sub-elements none parent elements the table below shows a list of rss elements that this element can be a child of. <tr> <th>name</td> <th>tag</td> <th>0.90</td> <th>n 0.91 r1</td> <th>n 0.91 r3</td> <th>u 0.91</td> <th>0.92</td> <th>0.93</td> <th>0.94</td> <th>1.0</td> <th>2.0</td> </tr> <tr> <td>rss channel el...
Building a Theme - Archive of obsolete content
directions there. it's especially important to install the dom inspector, which we'll be using in later steps. ...
...="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:id>sample@example.net</em:id> <em:version>1.0</em:version> <em:type>4</em:type> <!-- target application this theme can install into, with minimum and maximum supported versions. ...
...@example.net</em:id> <em:version>1.0</em:version> <em:type>4</em:type> <!-- target application this theme can install into, with minimum and maximum supported versions. --> <em:targetapplication> <
description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>29.0</em:minversion> <em:maxversion>39.*</em:maxversion> </
description> </em:targetapplication> <!-- front end metadata --> <em:name>my theme</em:name> <em:internalname>sample</em:internalname> <em:
description>a test extension</em:
description> <em:creator>your name here</em:creator> <em:homepageurl>http://www.example.com/</em:homepageurl> </
description> </rdf> sample@example.net - the id of the extension. this is a value you come u...
...of your existing versions when you upload them. in addition, mozilla add-ons allows users to comment and provide feedback on your theme. it is highly recommended that you use mozilla add-ons to distribute your themes! visit https://addons.mozilla.org/developers/ to create an account and begin distributing your themes! note: your theme will be passed faster and downloaded more if you have a good
description and some screenshots of the theme in action. themes ______________________________ ...
Updating an extension to support multiple Mozilla applications - Archive of obsolete content
e it as a basis for your own extension. download the sample updating the install manifest the first step is to revise the extension's install manifest to indicate that it can be installed in thunderbird and sunbird. ...
... can be installed in thunderbird and sunbird. ...
...after inserting this code, you can successfully install the exten...
... <em:minversion>1.5</em:minversion> <em:maxversion>2.0.0.*</em:maxversion> </
description> </em:targetapplication> <!-- describe the sunbird versions we support --> <em:targetapplication> <
description> <em:id> {718e30fb-e89b-41dd-9da7-e25a45638b28}</em:id> <em:minversion>0.2</em:minversion> <em:maxversion>0.4.*</em:maxversion> </
description> </em:targetapplication> these two blocks indicate that the extension supports thunderbird versions 1.5 through 2.0.0.x, sunbird versions 0.2 through 0.4.x. after inserting this code, you can successfully install the extension into any (or all) of firefox, thunderbird, and sunbird, but you won't see any effect in thunderbird and sunbird. that's because there's nothing telling those two appli...
Making asynchronous programming easier with async and await - Learn web development
esponse.ok) { throw new error(`http error! ...
...ror(`http error! ...
...blob') { content = await response.blob(); } else if(type === 'text') { content = await response.text(); } return content; } } async function displaycontent() { let coffee = fetchanddecode('coffee.jpg', 'blob'); let tea = fetchanddecode('tea.jpg', 'blob'); let
description = fetchanddecode('
description.txt', 'text'); let values = await promise.all([coffee, tea,
description]); let objecturl1 = url.createobjecturl(values[0]); let objecturl2 = url.createobjecturl(values[1]); let desctext = values[2]; let image1 = document.createelement('img'); let image2 = document.createelement('img'); image1.src = objecturl1; image2.src = objecturl2; document.body.appendchild(image1); document.body.appendchild(image2); let para = document.createelement('p'); ...
...e1); document.body.appendchild(image2); let para = document.createelement('p'); para.textcontent = desctext; document.body.appendchild(para); } displaycontent() .catch((e) => console.log(e) ); you'll see that the fetchanddecode() function has been converted easily into an async function with just a few changes. see the promise.all() line: let values = await promise.all([coffee, tea,
description]); by using await here we are able to get all the results of the three promises returned into the values array, when they are all available, in a way that looks very much like sync code. we've had to wrap all the code in a new async function, displaycontent(), and we've not reduced the code by a lot of lines, but being able to move the bulk of the code out of the .then() block provides a nice, u...
Graceful asynchronous programming with Promises - Learn web development
ure on our page with content. in many cases, it makes sense to receive all the data and only then show the complete content, rather than displaying partial information. let's build another example to show this in action. download a fresh copy of our page template, and again put a <script> element just before the closing </body> tag. download our source files (coffee.jpg, tea.jpg, and
description.txt), or feel free to substitute your own. in our script, we'll first define a function that returns the promises we want to send to promise.all(). this would be easy if we just wanted to run the promise.all() block in response to three fetch() operations completing. we could just do something like: let a = fetch(url1); let b = fetch(url2); let c = fetch(url3); promise.all([a, b, c]).th...
...se-based, therefore in effect, the entire function acts like a promise — convenient. next, we call our function three times to begin the process of fetching and decoding the images and text and store each of the returned promises in a variable. ...
... the entire function acts like a promise — convenient. next, we call our function three times to begin the process of fetching and decoding the images and text and store each of the returned promises in a variable. add the following below your previous code: let coffee = fetchanddecode('coffee.jpg', 'blob'); let tea = fetchanddecode('tea.jpg', 'blob'); let
description = fetchanddecode('
description.txt', 'text'); next, we will define a promise.all() block to run some code only when all three of the promises stored above have successfully fulfilled. to begin with, add a block with an empty executor inside the .then() call, like so: promise.all([coffee, tea,
description]).then(values => { }); you can see that it takes an array containing the promises as a parameter. the executor ...
... finally, add the following inside the executor. here we use some fairly simple sync code to store the results in separate variables (creating object urls from the blobs), then display the images and text on the page. ...
Handling common accessibility problems - Learn web development
he right job in the first place. text alternatives text alternatives are very important for accessibility — if a person has a visual or hearing impairment that stops them being able to see or hear some content, then this is a problem. the simplest text alternative available is the humble alt attribute, which we should include on all images that contain relevant content. this should contain a
description of the image that successfully conveys its meaning and content on the page, to be picked up by a screenreader and read out to the user. note: for more information, read text alternatives. missing alt text can be tested for in a number of ways, for example using accessibility auditing tools. alt text is slightly more complex for video and audio content. there is a way to define text tracks (e...
...from the khan academy that takes the form of a javascript library that you attach to your page to provide a number of accessibility tools. let's look at an example, using wave. go to the wave homepage. enter the url of our bad-semantics.html example into the text input at the top of the page (or the url of another webpage you'd like to analyze) and press analyse your webpage. check out the
description of the accessibility problems on the results page (the icons you can click to see what problems are occuring where are rather useful). note: such tools aren't good enough to solve all your accessibility problems on their own. you'll need a combination of these, knowledge and experience, user testing, etc. to get a full picture. automation tools deque's axe tool goes a bit further than the a...
...eir commands from clashing with other commands. in the case of vo, the modifier can either be capslock, or ctrl + option. vo has many keyboard commands, and we won't list them all here. the basic ones you'll need for web page testing are in the following table. in the keyboard shortcuts, "vo" means "the voiceover modifier". most common voiceover keyboard shortcuts keyboard shortcut
description vo + cursor keys move the vo cursor up, right, down, left. vo + spacebar select/activate items highlighted by the vo cursor. this includes items selected in the rotor (see below). vo + shift + down cursor move into a group of items (such as an html table, or a form, etc.) once inside a group you can move around and select items inside that group using the a...
... for all things. if you get completely lost, you can press ctrl + f5 to refresh the current page and begin from the top again. nvda has many keyboard commands, and we won't list them all here. the basic ones you'll need for web page testing are in the following table. in the keyboard shortcuts, "nvda" means "the nvda modifier". most common nvda keyboard shortcuts keyboard shortcut
description nvda + q turn nvda off again after you've started it. nvda + up cursor read the current line. nvda + down cursor start reading at the current position. up cursor and down cursor, or shift + tab and tab move to previous/next item on page and read it. left cursor and right cursor move to previous/next character in current item and read...
Accessibility API cross-reference
aria live region. alert alert alert alert, alertdialog content changes over time, s...
... n/a <input type=color> a dialog for picking a file n/a file_chooser file_chooser n/a invoked with <input type=file> no explanation given n/a n/a invalid n/a contains accessible info, but its role is not known n/a n/a unknown accessible states and properties
description & notes msaa state (state_system_*) java accessibility state gnome accessibility state (atk_state_*) mac os x accessibility state aria state or property html attribute tagged pdf relevant xul used in aria to denote non-conformant user input n/a n/a invalid aria-invalid this window is currently the active window n/a ac...
... n/a aria-controls indicates the element that represents the current item within a container or set of related elements. n/a n/a aria-current identifies the element (or elements) that describes the object. n/a n/a aria-describedby identifies the element that provides a detailed, extended
description for the object. n/a n/a aria-details this is for expandable items that are not expanded, such as folded tree branches or accordions collapsed collapsed collapsed aria-expanded=false different from xul's collapsed="true" attribute which indicates something is hidden this is the default button or menu item default n/a ...
... unavailable enabled n/a aria-disabled=true disabled (boolean attribute) especially used for sliders and scrollbars n/a vertical vertical aria-orientation=vertical accessible events msaa event (event_object_*, event_system_*) java accessibility event gnome accessibility signals mac os x accessibility event
description & notes javascript relevant xul focus focus, focusin blur, focusout selection select state_change change (not sure if this is the same thing?) ...
Creating a spell check dictionary add-on
ddition to these required files, you may add optional files, for example to give your add-on an icon or to describe the license of the dictionary. here is an example of the install.rdf file. you can create and edit it with a plain text editor such as notepad. ...
...99/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:id>locale-code@dictionaries.addons.mozilla.org</em:id> <em:version>version number</em:version> <em:type>64</em:type> <em:unpack>true</em:unpack> <em:name>name</em:name> <!-- other install.rdf metadata such as em:localized, em:
description, em:creator, em:developer, em:translator, em:contributor or em:homepageurl --> <!-- firefox --> <em:targetapplication> <
description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>18.0a1</em:minversion> <em:maxversion>46.0</em:maxversion> </
description> </em:targetapplication> <!-- thunderbird --> ...
...em:translator, em:contributor or em:homepageurl --> <!-- firefox --> <em:targetapplication> <
description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>18.0a1</em:minversion> <em:maxversion>46.0</em:maxversion> </
description> </em:targetapplication> <!-- thunderbird --> <em:targetapplication> <
description> <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <em:minversion>18.0a1</em:minversion> <em:maxversion>22.0</em:maxversion> </
description> </em:targetapplication> <!-- seamonkey --> <em:targetapplication> <
description> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.15a1</em:minversion> ...
...09bdfdc6}</em:id> <em:minversion>18.0a1</em:minversion> <em:maxversion>22.0</em:maxversion> </
description> </em:targetapplication> <!-- seamonkey --> <em:targetapplication> <
description> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.15a1</em:minversion> <em:maxversion>2.49</em:maxversion> </
description> </em:targetapplication> </
description> </rdf> there are some rules about how you should adapt the install.rdf file: if you are creating a new dictionary add-on, we recommend that the em:id consists of your locale code followed by @dictionaries.addons.mozilla.org, but if there is more than one dictionary for your language (for example the german "old spelling" versus "new spelling" d...
Addon
blockliststate read only integer the current blocklist state of this add-on; see nsiblocklistservice for possible values. creator read only addonauthor the creator of the add-on. foreigninstall ...
... scope read only integer indicates what scope the add-on is installed in, per profile, user, system, or application. type read only string the type of the add-on. userdisabled boolean true if the user wants this add-on to be disabled. version read only string the version of the add-on. optional properties attribute type
description abouturl read only string the url of the about dialog to display for this add-on. this is passed to window.opendialog() when presenting the about dialog. if you don't provide an abouturl, a generic about dialog is displayed. the dialog receives the addon object representing your add-on as a parameter. applybackgroundupdates integer indicates whether updates found in...
...oundupdates integer indicates whether updates found in the background for this add-on will be applied automatically. see auto update values. the user is provided a ui for this in the add-ons manager and it's the add-on provider's responsibility to remember its selection. contributors read only addonauthor[] an array of strings holding the contributors of the add-on.
description read only string the
description of the add-on. developers read only addonauthor[] an array of strings holding the developers of the add-on. homepageurl read only string the homepage url of the add-on. iconurl read only string the url of the icon that represents this add-on. install read only addoninstall the addoninstall that...
... devices during sync. translators read only addonauthor[] an array of strings holding the translators of the add-on. updatedate read only date the date that the add-on was most recently updated. operationsrequiringrestart read only integer a bitfield holding all of the operations that will require a restart to complete for this add-on. ...
CustomizableUI.jsm
a listener added with addlistener. parameters alistener the listener object to remove registerarea() register a customizable area with customizableui. parameters aareaid the name of the area to register. can only contain alphanumeric characters, dashes (-) and underscores (_). aproperties the properties of the area. the following properties are recognized: property
description type the type of area. either type_toolbar (default) or type_menu_panel. anchor for a menu panel or overflowable toolbar, the anchoring node for the panel. legacy set to true if you want customizableui to automatically migrate the currentset attribute. overflowable set to true if your toolbar is overflowable. this requires an anchor,...
...erties. for a list of supported properties, see api-provided widgets. parameters aproperties the specification for the widget return value a wrapper around the created widget. note: if your extension is compatible with versions of firefox below 29, i.e. before customizableui was introduced, then you have to make sure that in case of running on newer browsers, xul overlay does not contain
description of the button that you are creating with createwidget() method. otherwise, conflicting static xul overlay button and dynamic customizableui buttons might cause the created button to be unstable or create a double button. to avoid that, update your chrome manifest file with links to two different versions of xul overlay, using manifest flags. note: unlike button described with xul overlay, widget...
... "palette" if it is in the (visible!) customization palette, undefined otherwise. isbuiltintoolbar() check if a toolbar is builtin or not. parameters atoolbarid the id of the toolbar you want to check return value true if the toolbar is builtin, false otherwise. properties for readability, the properties are split according to purpose: dynamic getters attribute type
description areas array always returns an up to date array of all the area ids that are currently registered with customizableui. indefaultstate bool whether we're in a default state. note that non-removable non-default widgets and non-existing widgets are not taken into account in determining whether we're in the default state. nb: this is a property with a getter. th...
...art things with non-removable non-default items, non-existent items, and so forth. please don't call unless necessary. canundoreset bool whether the "restore defaults" operation can be reverted. this is only true after "restore defaults" has been performed and no other ui changes happen after the "restore defaults" operation. area constants attribute type
description area_navbar string "nav-bar", a constant reference to the id of the navigation toolbar. area_tabstrip string "tabstoolbar", a constant reference to the id of the tabstrip toolbar. area_menubar string "toolbar-menubar", a constant reference to the id of the menubar's toolbar. area_bookmarks string "personaltoolbar", a constant reference t...
PerfMeasurement.jsm
t that was not being recorded has a value of -1 (that is, 0xffffffffffffffff). note: these values are all zeroed (or set to -1, for events not being measured) when you initialize the perfmeasurement object, then they are not zeroed again unless you explicitly call the reset() method. this lets you accumulate measurements over multiple passes through code that you want to analyze. variable type
description cpu_cycles uint64 the number of cpu cycles elapsed. instructions uint64 the number of instructions executed. cache_references uint64 the number of memory accesses that occurred. cache_misses uint64 the number of times memory accesses missed the cache. branch_instructions uint64 the number of branch instructions executed. branch_misses uint64 the number of times branch predi...
...ber of times page faults required disk access. context_switches uint64 the number of context switches that occurred involving the thread being profiled. cpu_migrations uint64 the number of times the profiled thread migrated from one cpu core to another. event types measured constant the eventsmeasured constant provides a mask indicating which event types were recorded. ...
... instructions 0x00000002 measure the number of instructions executed. cache_references 0x00000004 measure the number of cache references. cache_misses 0x00000008 measure the number of cache misses. branch_instructions 0x00000010 measure the number of branch instructions executed. ...
...the number of major page faults that occurred. context_switches 0x00000200 measure the number of context switches that occurred. cpu_migrations 0x00000400 measure the number of context switches that occurred. all 0x000007ff measure all available events. number of available event types the num_measurable_events constant tells you how many types of events can be measured. constant value
description num_measurable_events 11 the number of types of events that can be measured. constructor creates a new perfmeasurement object, configured to record the specified event types. perfmeasurement( eventmask tomeasure ); parameters tomeasure a mask of all of the event types you want to record; see event mask constants for a list of values. or together all the event types you want to record, an...
Python binding for NSS
thods/functions provide sane default (keyword) parameters freeing the python programmer from having to specify all parameters yet allowing them to be overriden when necessary. error codes are never returned from methods/functions. python-nss follows the existing python exception mechanism. any error reported by nss/nspr is converted into a python exception and raised. the exact error code, error
description, and often contextual error information will be present in the exception object. enumerated constants used in the nss/nspr api's are available in the python module under the exact same name as they appear in the c header files of nss/nspr. convenience functions are provided to translate between the numeric value of an enumerated constant and it's string representation and visa versa. python-ns...
...ribute. this was fixable in python-nss without requiring a patch to nss. formerly python-nss did not provide access to the attributes in a csr only the extensions, with this release all components of a csr can be accessed. see test/test_cert_request.py for examples. add ability to read pem data from a string. add more build instructions to readme. source readme into package long
description. a secitem now converts almost all der encoded data to a string when it's str method is invoked, formerly it was limited to only a few objects. the following classes were added: certattribute the following class methods were added: certattribute.format_lines certattribute.format nss.secitem.get_integer the fol...
...orary database when they are loaded, but earlier code failed to to that. it's is not likely that an previous code was failing to pass initialization data or the der_is_signed flag so this change should be backwards compatible. fix bug #922247, pkcs12decoder.database_import() method. importing into a nss database would sometimes fail or segfault. error codes and
descriptions were updated from upstream nspr & nss. the password callback did not allow for breaking out of a password prompting loop, now if none is returned from the password callback the password prompting is terminated. nss.nss_shutdown_context now called from initcontext destructor, this assures the context is shutdown even if the programmer forgot to. it's still best...
... nsprerror is now derived from standardexception instead of environmenterror. it was never correct to derive from environmenterror but was difficult to implement a new subclassed exception with it's own attributes, using environmenterror had been expedient. ...
FC_GetInfo
name fc_getinfo - return general information about the pkcs #11 library. syntax ck_rv fc_getinfo(ck_info_ptr pinfo); parameters fc_getinfo has one parameter: pinfo points to a ck_info structure
description fc_getinfo returns general information about the pkcs #11 library. on return, the ck_info structure that pinfo points to has the following information: cryptokiversion: pkcs #11 interface version number implemented by the pkcs #11 library. the version is 2.20 (major=0x02, minor=0x14). ...
...s #11 library. on return, the ck_info structure that pinfo points to has the following information: cryptokiversion: pkcs #11 interface version number implemented by the pkcs #11 library. the version is 2.20 (major=0x02, minor=0x14). manufacturerid: the pkcs #11 library manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. flags: should be 0. library
description:
description of the library, "nss internal crypto services", padded with spaces to 32 characters and not null-terminated. libraryversion: pkcs #11 library version number, for example, 3.11 (major=0x03, minor=0x0b). a user may call fc_getinfo without logging into the token (to assume the nss user role). return value fc_getinfo always returns ckr_ok. fc_getinfo should return ckr_arguments_ba...
...3, minor=0x0b). a user may call fc_getinfo without logging into the token (to assume the nss user role). return value fc_getinfo always returns ckr_ok. fc_getinfo should return ckr_arguments_bad if pinfo is null. fc_getinfo should return ckr_cryptoki_not_initialized if the library is not initialized. examples note the use of the %.32s format string to print the manufacturerid and library
description members of the ck_info structure. #include <assert.h> #include <stdio.h> ck_function_list_ptr pfunctionlist; ck_rv crv; ck_info info; crv = fc_getfunctionlist(&pfunctionlist); assert(crv == ckr_ok); ... /* invoke fc_getinfo as pfunctionlist->c_getinfo */ crv = pfunctionlist->c_getinfo(&info); assert(crv == ckr_ok); printf("general information about the pkcs #11 library:\n"); printf(" pkcs...
...c_getinfo as pfunctionlist->c_getinfo */ crv = pfunctionlist->c_getinfo(&info); assert(crv == ckr_ok); printf("general information about the pkcs #11 library:\n"); printf(" pkcs #11 version: %d.%d\n", (int)info.cryptokiversion.major, (int)info.cryptokiversion.minor); printf(" manufacturer id: %.32s\n", info.manufacturerid); printf(" flags: 0x%08lx\n", info.flags); printf(" library
description: %.32s\n", info.library
description); printf(" library version: %d.%d\n", (int)info.libraryversion.major, (int)info.libraryversion.minor); printf("\n"); see also nsc_getinfo ...
JS_AddArgumentFormatter
e removed at any time. try to avoid using it. add or remove a format string handler for js_convertarguments, js_pusharguments, js_convertargumentsva, and js_pushargumentsva. ...
...on success, it returns js_true. otherwise it returns js_false. ...
...ypically a string constant. if format is in dynamic storage, the caller must keep the string alive until js_removeargumentformatter is called. js_removeargumentformatter removes any conversion functions associated with format. callback syntax jsbool (*jsargumentformatter)(jscontext *cx, const char *format, jsbool fromjs, jsval **vpp, va_list *app); name type
description cx jscontext * the context in which the conversion is being performed. format const char * the tail of the format string whose prefix is associated with this formatting function. fromjs jsbool js_true if the conversion function should convert from jsval values to c values; js_false if the conversion function should convert from c values to jsval values...
...s jsbool js_true if the conversion function should convert from jsval values to c values; js_false if the conversion function should convert from c values to jsval values. vpp jsval ** in-out parameter. a pointer into an array of jsval values. app va_list * in-out parameter. a pointer to an argument pointer, used to retrieve pointers to c values. callback
description the conversion function should return true on success, and return false after reporting an error or detecting an already-reported error. for a given format string, for example "aa", the formatter is called from js_convertargumentsva like so: formatter(cx, "aa...", js_true, &sp, &ap); sp points into the arguments array on the js stack, while ap points into the stdarg.h va_list on the c stack. the...
JS_AddFinalizeCallback
ove callback function for finalization. syntax bool js_addfinalizecallback(jsruntime *rt, jsfinalizecallback cb, void *data); // added in spidermonkey 38 (jsapi 32) void js_removefinalizecallback(jsruntime *rt, jsfinalizecallback cb); // added in spidermonkey 38 (jsapi 32) void js_setfinalizecallback(jsruntime *rt, jsfinalizecallback cb); // obsolete since jsapi 32 name type
description rt jsruntime * the jsruntime for which to set the finalization callback. cb jsfinalizecallback pointer to the new callback function to use. data void * passed to data parameter for jsfinalizecallback. callback syntax typedef enum jsfinalizestatus { jsfinalize_group_start, jsfinalize_group_end, jsfinalize_collection_end } jsfinalizes...
... callback function to use. data void * passed to data parameter for jsfinalizecallback. callback syntax typedef enum jsfinalizestatus { jsfinalize_group_start, jsfinalize_group_end, jsfinalize_collection_end } jsfinalizestatus; typedef void (* jsfinalizecallback)(jsfreeop *fop, jsfinalizestatus status, bool iscompartment, void *data); name type
description fop jsfreeop * a pointer to an instance of jsfreeop. status jsfinalizestatus one of the jsfinalizestatus constants, described below, indicating the stage of finalize. iscompartment bool false if all compartments are being collected, true if a compartment is being collected. data void * data parameter specified in js_addfinalizecallback. ...
...stance of jsfreeop. status jsfinalizestatus one of the jsfinalizestatus constants, described below, indicating the stage of finalize. iscompartment bool false if all compartments are being collected, true if a compartment is being collected. data void * data parameter specified in js_addfinalizecallback. added in spidermonkey 38 name
description jsfinalize_group_start called when preparing to sweep a group of compartments, before anything has been swept. the collector will not yield to the mutator before calling the callback with jsfinalize_group_end status. jsfinalize_group_end called when preparing to sweep a group of compartments. weak references to unmarked things have been removed and things that are not swep...
..._end status. jsfinalize_group_end called when preparing to sweep a group of compartments. weak references to unmarked things have been removed and things that are not swept incrementally have been finalized at this point. the collector may yield to the mutator after this point. jsfinalize_collection_end called at the end of collection when everything has been swept.
description js_addfinalizecallback add a callback function which the garbage collector calls at several points during garbage collection. rt is the runtime in which you specify the callback. cb is a pointer to the callback function to add. js_removefinalizecallback removes the previously added callback function. obsolete since jsapi 32 js_setfinalizecallback sets a new callback function. it was replaced...
How to build an XPCOM component in JavaScript
if not // provided, the default factory is used, which returns // |(new mycomponent()).queryinterface(iid)| in its createinstance(). _xpcom_facto...
...ts createinstance(). _xpcom_factory: { ... }, // [optional] an array of categories to register this component in. _xpcom_categories: [{ // each object in the array specifies the parameters to pass to // nsicategorymanager.addcategoryentry(). 'true' is passed for both // apersist and areplace params. category: "some-category", // optional, defaults to the object's class
description entry: "entry name", // optional, defaults to the object's contractid (unless 'service' is specified) value: "...", // optional, defaults to false. when set to true, and only if 'value' is not // specified, the concatenation of the string "service," and the object's contractid // is passed as avalue parameter of addcategoryentry. service: true }], // queryinter...
...gher else var nsgetmodule = xpcomutils.generatensgetmodule(components); // firefox 3.x so the total simplified version of your component now looks like (of course documentation and comments aren't a bad thing, but as a template something smaller is nice to have): components.utils.import("resource://gre/modules/xpcomutils.jsm"); function helloworld() { } helloworld.prototype = { class
description: "my hello world javascript xpcom component", classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@dietrich.ganx4.com/helloworld;1", queryinterface: xpcomutils.generateqi([components.interfaces.nsihelloworld]), hello: function() { return "hello world!"; } }; var components = [helloworld]; if ("generatensgetfactory" in xpcomutils) var nsgetfactor...
...see xpcom changes in gecko 2.0 for more details. installation for extensions: copy helloworld.js, and helloworld.xpt (only if you defined and compiled the idl) to {extensiondir}/components/. delete compreg.dat and xpti.dat from your profile directory. restart application. for firefox: copy helloworld.js, and helloworl...
imgIEncoder
post-multiplied alpha us used (for example 50% transparent red is 0xff000080) input_format_hostargb 2 input is host-endian...
...est). quality >= 90 prevents down-sampling of the color channels. methods addimageframe() void addimageframe( [array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 frameformat, in astring frameoptions ); parameters data list of bytes in the format specified by inputformat. ...
...t32 frameformat, in astring frameoptions ); parameters data list of bytes in the format specified by inputformat. length missing
description width width in pixels. height height in pixels. stride the number of bytes per row in the image. normally (width*3) or (width*4), depending on your input format, but some data uses padding at the end of each row, which would be extra. frameformat missing
description frameoptions missing
description encodeclipboardimage() obsolete since gecko 1.9 (firefox 3) void encodeclipboardimage( in nsiclipboardimage aclipboardimage, out nsifile aimagefile ); parameters aclipboardimage missing
description aimagefile missing
description endimageencode() void endimageencode(); parameters none. initfromdata() void initfromdata( [array, s...
...height height in pixels. stride the number of bytes per row in the image. normally (width*3) or (width*4), depending on your input format, but some data uses padding at the end of each row, which would be extra. inputformat one of input_format_* constants specifying the format of data. ...
nsIDocShell
do not create an instance directly. instead, retrieve an nsidocshell from a browser or other document container element. note that out-of-process browsers do not have an nsidocshell; instead you can access the nsidocshell object from a frame script. ...
... allowdnsprefetch boolean attribute that determines whether dns prefetch is allowed for this subtree of the docshell tree. defaults to true. setting this will make it take effect starting with the next document loaded in the docshell. ...
...et/get the document scale factor. when setting this attribute, a ns_error_not_implemented error may be returned by implementations not supporting zoom. implementations not supporting zoom should return 1.0 all the time for the get operation. 1.0 by the way is the default of zoom. this means 100% of normal scaling or in other words normal size no zoom. constants constant value
description internal_load_flags_none 0x0 used as a placeholder when you don't want to explicitly specify flags. internal_load_flags_inherit_owner 0x1 used to indicate that it may be safe to inherit the owner of a javascript: or data: url from the existing document. internal_load_flags_dont_send_referrer 0x2 used to indicate that the load was caused by a meta refre...
...ds. load_cmd_history 0x4 returned by the loadtype attribute for history navigation. load_cmd_pushstate 0x8 returned by the loadtype attribute when the page has used history.pushstate() character set source constants these constants are not exposed to script. they are used internally as values for the parentcharsetsource attribute. constant value
description kcharsetuninitialized 0 the character set has not yet been initialized. kcharsetfromweakdoctypedefault 1 kcharsetfromuserdefault 2 the user's default character set is being used. kcharsetfromdoctypedefault 3 the character set has been inferred from the doctype. all values from here upward are confident enough to be used for xmlhttp...
nsIFilePicker
this attribute has no effect if private browsing mode is in effect. defaultextension astring the extension for the type of files you want to work with. on some plat...
... of the currently selected file or directory. read only. filterindex long the (0-based) index of the filter which is currently selected in the file picker dialog. set this to choose a particular filter to be selected by default. constants mode constants these constants are used to specify the type of file picker to create when calling init(). ...
...
description modeopen 0 load a file. modesave 1 save a file. modegetfolder 2 select a folder/directory. modeopenmultiple 3 load multiple files. return value constants these values are returned by show() or passed as an argument to open()'s callback, indicating the result of the file picker activity. constant value
description returnok 0 the file picker dialog was closed by the user hitting 'ok' returncancel 1 the file picker dialog was closed by the user hitting 'cancel' returnreplace 2 the user chose an existing file and acknowledged that they want to overwrite the file filter constants these constants are used to create filters for commonly-used file types. for th...
...'ok' returncancel 1 the file picker dialog was closed by the user hitting 'cancel' returnreplace 2 the user chose an existing file and acknowledged that they want to overwrite the file filter constants these constants are used to create filters for commonly-used file types. for the most up to date list see filepicker.properties. constant value
description filterall 0x001 corresponds to the *.* filter for file extensions. all files will pass through the filter. filterhtml 0x002 corresponds to the *.html, *.htm, *.shtml and *.xhtml filters for file extensions. filtertext 0x004 corresponds to the *.txt and *.text filter for file extensions. filterimages 0x008 corresponds to the *.jpe, *.jpg,...
nsISearchEngine
read only. hidden boolean whether the engine should be hidden from the user. iconuri nsiuri a nsiuri corresponding to the en...
...read only. ...
...read only. hidden boolean whether the engine should be hidden from the user. ...
...d only. name astring the display name of the search engine. this is a unique identifier. read only. searchform astring a url string pointing to the engine's search form. read only. type long the search engine type. read only. constants search engine type constants constant value
description type_mozsearch 1 type_sherlock 2 type_opensearch 3 search engine data type constants constant value
description data_xml 1 data type is xml data_text 2 data type is text. methods addparam() adds a parameter t...
nsISelectionController
visibilityduringselection(in boolean visibility); void setcaretwidth(in short pixels); obsolete since gecko 1.8 void setdisplayselection(in short toggle); void wordextendfordelete(in boolean forward); native code only! ...
...in boolean extend); attributes attribute type
description caretvisible boolean this is true if the caret is enabled, visible, and currently blinking. this is still true when the caret is enabled, visible, but in its "off" blink cycle. read only. ...
... num_selection_regions 2 3 selection_off 0 selection_hidden 1 hidden displays selection. selection_on 2 selection_disabled 3 selection_attention 4 scroll constants constant value
description scroll_synchronous 1<<1 if set scrolls the selection into view before returning. if not set, posts a request which is processed at some point after the method returns. scroll_first_ancestor_only 1<<2 if set, only the first ancestor will be scrolled into view. scroll_center_vertically 1<<4 if set, the specified l...
...70, comment 12 for details. void scrollselectionintoview( in short type, in short region, in short flags ); parameters type the selection to scroll into view. (selectiontype) region the region inside the selection to scroll into view. (selectionregion) flags one of the scroll_* constants. exceptions thrown missing exception missing
description selectall() will select the whole page. void selectall(); parameters none. setcaretenabled() set the caret as enabled or disabled. an enabled caret will draw or blink when made visible. a disabled caret will never show up. can be called any time. void setcaretenabled( in boolean enabled ); parameters enabled pr_true to enable caret. pr_false to disable. setcaretreadonly() set...
nsISocketTransport
see connection flag constants for more details. host autf8string get the host for the underlying socket connection. read only. port long get the port for the underlying socket connection. read only. ...
...ty info object returned from the secure socket provider. this object supports nsisslsocketcontrol, nsitransportsecurityinfo, and possibly other interfaces. this attribute is only available once the socket is connected. read only. constants timeout type this constants are used by gettransport() and settransport() to specify socket timeouts constant value
description timeout_connect 0 connecting timeout. timeout_read_write 1 read and write timeouts. nsitransporteventsink status codes note: although these constants look like xpcom error codes and are passed in an nsresult variable, they are not error codes. they do overlap with existing error codes in necko, these status codes are confined w...
...may appear, so there is no ambiguity. the values of these status codes must never change. the status codes appear in near-chronological order (not in numeric order). status_resolving may be skipped if the host does not need to be resolved. status_waiting_for is an optional status code, which the implementation of this interface may choose not to generate. constant value
description status_resolving 0x804b0003 transport is resolving the host. usually a dns lookup. status_resolved 0x804b000b transport has resolved the host. status_connecting_to 0x804b0007 status_connected_to 0x804b0004 status_sending_to 0x804b0005 s...
... anonymous_connect 1 when this flag is set, the socket will not apply any credentials when establishing a connection. for example, an ssl connection would not send a...
nsIWindowsRegKey
read only. key hkey this attribute exposes the native hkey and is available to provide c++ consumers with the flexibility of making other windows registry api calls that are not exposed via this interface. it is possible to initialize this object by setting an hkey on it. in that case,...
... valuecount unsigned long this attribute returns the number of values under this key. read only. constants root key constants the values for these keys correspond to the values from winreg.h in the ms platform sdk. the root_key_ prefix corresponds to the hkey_ prefix in the ms platform sdk. this interface is not restricted to using only these root keys. constant value
description root_key_classes_root 0x80000000 root_key_current_user 0x80000001 root_key_local_machine 0x80000002 access constants values for the mode parameter passed to the open() and create() methods. the values defined here correspond to the regsam values defined in winnt.h in the ms platform sdk, where access_ is replaced with key_. this interface i...
... 0x80000001 root_key_local_machine 0x80000002 access constants values for the mode parameter passed to the open() and create() methods. the values defined here correspond to the regsam values defined in winnt.h in the ms platform sdk, where access_ is replaced with key_. this interface is not restricted to using only these access types. ...
...nterface is somewhat restricted to using only these value types. there is no method that is directly equivalent to regqueryvalueex or regsetvalueex. in particular, this interface does not support the reg_multi_sz and reg_expand_sz value types. it is still possible to enumerate values that have other types (that is, getvaluetype() may return a type not defined below). constant value
description type_none 0 reg_none type_string 1 reg_sz type_binary 3 reg_binary type_int 4 reg_dword type_int64 11 reg_qword methods close() this method closes the key. if the key is already closed, then this method does nothing. void close(); parameters none. create() this method opens an existing key or creates a new key. note...
Network request details - Firefox Developer Tools
the request details pane appears when you click on a network request in the request list. this pane provides more detailed information about the request. network request details clicking on a row displays a new pane in the right-hand side of the network monitor, which provides more detailed information about the request. the screenshots and
descriptions in this section reflect firefox 78. earlier versions appeared similarly, but might not include some functionality. the tabs at the top of this pane enable you to switch between the following pages: headers messages (only for websocket items) cookies params response cache timings security (only for secure pages) stack trace (only when the request has a stack trace, e.g. a script called by another script). clicking the icon at the ...
...dress of the host the following information is shown in both the collapsed and the expanded states: status: the http response code for the request. version: the http version used transferred: the amount of data transferred with the request the referrer policy, which governs which referrer information, sent in the referer header, should be included with requests. (see referrer-policy for a
description of possible values) blocking: if the request is to a site that is associated with a known tracker, an icon and a message are shown; otherwise, this field is not shown. response headers the response headers section shows details about the response. for each line in the response headers section, a question mark links to the documentation for that response header, if one is available. a raw tog...
...ce started downloading. downloaded: when the the resource finished downloading. note: future versions will also show this information when entries in the network monitor timeline graph are moused over (see bug 1580493). request timing the request timing section breaks a network request down into the following subset of the stages defined in the http archive specification: name
description blocked time spent in a queue waiting for a network connection. the browser imposes a limit on the number of simultaneous connections that can be made to a single server. in firefox this defaults to 6, but can be changed using the network.http.max-persistent-connections-per-server preference. if all connections are in use, the browser can't download more resources until ...
... the server. receiving time taken to read the entire response from the server (or cache). server timing new in firefox 71, the server timing section lists any information provided in the server-timing header — this is used to surface any backend server timing metrics you've recorded (e.g. database read/write, cpu time, file system access, etc.). the header takes a series of
descriptions and durations, which can be anything you like. in the above screenshot for example, the highlighted request's server-timing header contains 4 items — data, markup, total, and miss. security tab if the site is being served over https, you get an extra tab labeled "security". this contains details about the secure connection used including the protocol, the cipher suite, and certificate detail...
Rich output - Firefox Developer Tools
oard. then you can paste it into a document. the output will look something like this: console.log(todolist) array(4) [ {…}, {…}, {…}, {…} ] debugger eval code:1:9 undefined if you expand objects, such as arrays, you get slightly different content. ...
...g(todolist) array(4) [ {…}, {…}, {…}, {…} ] debugger eval code:1:9 undefined if you expand objects, such as arrays, you get slightly different content. ...
...xpand objects, such as arrays, you get slightly different content. ...
...ray in the above list, i get the following: console.log(todolist) (4) […] 0: object { status: "done",
description: "morning pages", datecreated: 1552404478137 } 1: object { status: "in progress",
description: "refactor styles", datecreated: 1552404493169 } 2: object { status: "to do",
description: "create feedback form", datecreated: 1552404512630 } 3: object { status: "to do",
description: "normalize table", datecreated: 1552404533790 } length: 4 <prototype>: array [] debugger eval code:1:9 undefined highlighting and inspecting dom nodes if you hover the mouse over any dom element in the console output, it's highlighted on the page: in the screenshot above you'll also see a blue "target" icon next to the node in the console output: click it to switch to the inspector wi...
DirectoryEntrySync - Web APIs
overecursively () raises (fileexception); methods createreader() creates a new directoryreadersync to read entries from this directory. directoryreadersync createreader ( ) raises (fileexception); returns directoryreadersync represents a directory in a file system. parameter none exceptions this method can raise a fileexception with the following codes: exception
description not_found_err the directory does not exist. security_err the browser determined that it was not safe to look up the metadata. [ todo: explain why ] getfile() depending on how you've set the options parameter, the method either creates a file or looks up an existing file. void getfile ( in domstring path, in optional flags options ) raises (fileexception); p...
...sts the file is returned. create: false (exclusive is ignored) path doesn't exist an error is thrown. create: false (exclusive is ignored) path exists, but is a directory an error is thrown. returns fileentrysync represents a file in a file system. exceptions this method can raise a fileexception with the following codes: exception
description encoding_err the path supplied is invalid. not_found_err the path was structurally correct, but refers to a resource that does not exist. no_modification_allowed_err this is a permission issue. the target directory or file is not writable. path_exists_err the file already exists. you cannot create another one with the same path. quota_e...
...ctory is returned. create: false (exclusive is ignored) path doesn't exist an error is thrown. create: false (exclusive is ignored) path exists, but is a directory an error is thrown. returns directoryentrysync represents a directory in a file system. exceptions this method can raise a fileexception with the following codes: exception
description encoding_err the path supplied is invalid. not_found_err the path was structurally correct, but refers to a resource that does not exist. no_modification_allowed_err this is a permission issue. the target directory or file is not writable. path_exists_err the file already exists. you cannot create another one with the same path. quota_e...
...rectory that contains a file that cannot be removed or if an error occurs while the deletion is in progress, some of the contents might not be deleted. catch these cases with error callbacks and retry the deletion. void removerecursively ( ) raises (fileexception); parameter none returns void exceptions this method can raise a fileexception with the following codes: exception
description not_found_err the target directory does not exist. invalid_state_err this directory is not longer valid for some reason other than being deleted. [todo: explain more ] no_modification_allowed_err one of the following is not writable: the directory, its parent directory, and some of the content in the directory. security_err the applicatio...
PerformanceServerTiming - Web APIs
iming interface surfaces server metrics that are sent with the response in the server-timing http header. this interface is restricted to the same origin, but you can use the timing-allow-origin header to specify the domains that are allowed to access the server metrics. note that this interface is only available in secure contexts (https) in some browsers. properties performanceservertiming.
descriptionread only a domstring value of the server-specified metric
description, or an empty string. performanceservertiming.durationread only a double that contains the server-specified metric duration, or value 0.0. performanceservertiming.nameread only a domstring value of the server-specified metric name. methods performanceservertiming.tojson() returns a domstring that is the json repres...
... working draft initial definition. ...
... working draft initial definition. ...
... working draft initial definition. ...
PluginArray - Web APIs
h the specified name. pluginarray.refresh refreshes all plugins on the current page, optionally reloading documents. examples the following example function returns the version of the shockwave flash plugin. ...
...th><th>
description</th><th>version</th></tr>' +'</thead><tbody></tbody></table>'; var table = document.getelementbyid('plugintable'); for(var i = 0; i < pluginslength; i++) { let newrow = table.insertrow(); newrow.insertcell().textcontent = navigator.plugins[i].name; newrow.insertcell().textcontent = navigator.plugins[i].filename; newrow.insertcell().textcontent = navigator.plugins[i].
description; newrow.insertcell().textcontent = navigator.plugins[i].version?navigator.plugins[i].version:""; } the following example displays information about the installed plugin(s). ...
....plugins[i].filename; newrow.insertcell().textcontent = navigator.plugins[i].
description; newrow.insertcell().textcontent = navigator.plugins[i].version?navigator.plugins[i].version:""; } the following example displays information about the installed plugin(s). ...
...following example displays information about the installed plugin(s). var pluginslength = navigator.plugins.length; document.write( pluginslength.tostring() + " plugin(s)<br>" + "name | filename |
description<br>" ); for(var i = 0; i < pluginslength; i++) { document.write( navigator.plugins[i].name + " | " + navigator.plugins[i].filename + " | " + navigator.plugins[i].
description + " | " + navigator.plugins[i].version + "<br>" ); } specifications specification status comment html living standardthe definition of 'pluginarray' in that specification. living standard initial definition. ...
RTCConfiguration - Web APIs
t integer value which specifies the size of the prefetched ice candidate pool. the default value is 0 (meaning no candidate prefetching will occur). you may find in some cases that connections can be established more quickly by allowing the ice agent to start fetching ice candidates before you start trying to connect, so that they're already available for inspection when rtcpeerconnection.setlocal
description() is called. changing the size of the ice candidate pool may trigger the beginning of ice gathering. iceservers optional an array of rtciceserver objects, each describing one server which may be used by the ice agent; these are typically stun and/or turn servers. if this isn't specified, the connection attempt will be made with no stun or turn server available, which limits the connection to...
... at the completion of negotiation, regardless of policy used, and any superfluous transports that were created initially are closed at that point. note: in technical terms, a bundle lets all media flow between two peers flow across a single 5-tuple; that is, from a single ip and port on one peer to a single ip and port on the other peer, using the same transport protocol. constant
description "balanced" the ice agent initially creates one rtcdtlstransport for each type of content added: audio, video, and data channels. if the remote endpoint is not bundle-aware, then each of these dtls transports then handles all the communication for one type of data. "max-compat" the ice agent initially creates one rtcdtlstransport per media track and a separate one for d...
...stransport to carry all of the rtcpeerconnection's data. if the remote endpoint is not bundle-aware, then only a single track will be negotiated and the rest ignored. rtcicetransportpolicy enum the rtcicetransportpolicy enum defines string constants which can be used to limit the transport policies of the ice candidates to be considered during the connection process. constant
description "all" all ice candidates will be considered. "public" only ice candidates with public ip addresses will be considered. removed from the specification's may 13, 2016 working draft. "relay" only ice candidates whose ip addresses are being relayed, such as those being passed through a turn server, will be considered. rtcrtcpmuxpolicy enum the rtcrtcp...
...3, 2016 working draft. "relay" only ice candidates whose ip addresses are being relayed, such as those being passed through a turn server, will be considered. rtcrtcpmuxpolicy enum the rtcrtcpmuxpolicy enum defines string constants which specify what ice candidates are gathered to support non-multiplexed rtcp. <<<add a link to info about multiplexed rtcp. constant
description "negotiate" instructs the ice agent to gather both rtp and rtcp candidates. if the remote peer can multiplex rtcp, then rtcp candidates are multiplexed atop the corresponding rtp candidates. otherwise, both the rtp and rtcp candidates are returned, separately. "require" tells the ice agent to gather ice candidates for only rtp, and to multiplex rtcp atop them. if the r...
RTCPeerConnection.addIceCandidate() - Web APIs
when a web site or app using rtcpeerconnection receives a new ice candidate from the remote peer over its signaling channel, it delivers the newly-received candidate to the browser's ice agent by calling rtcpeerconnection.addicecandidate(). this adds this new remote candidate to the rtcpeerconnection's remote
description, which describes the state of the remote end of the connection. if the candidate parameter is missing or a value of null is given when calling addicecandidate(), the added ice candidate is an "end-of-candidates" indicator. the same is the case if the value of the specified object's candidate is either missing or an empty string (""), it signals that all remote candidates have been delivered. the end-of-candidates notification is transmitted to the remote peer using a candidate wit...
... when the ice candidate has been successfully added. this function receives no input parameters and doesn't return a value. failurecallback a function to be called if attempting to add the ice candidate fails. receives as input a domexception object describing why failure occurred. return value a promise which is fulfilled when the candidate has been successfully added to the remote peer's
description by the ice agent. the promise does not receive any input parameters. exceptions when an error occurs while attempting to add the ice candidate, the promise returned by this method is rejected, returning one of the errors below as the name attribute in the specified domexception object passed to the rejection handler. typeerror the specified candidate's sdpmid and sdpmlineindex are both null...
...rror occurs while attempting to add the ice candidate, the promise returned by this method is rejected, returning one of the errors below as the name attribute in the specified domexception object passed to the rejection handler. typeerror the specified candidate's sdpmid and sdpmlineindex are both null. invalidstateerror the rtcpeerconnection currently has no remote peer established (remote
description is null). operationerror this can happen for a number of reasons: the value specified for sdpmid is non-null and doesn't match the media
description id of any media
description included within the remote
description. the specified value of sdpmlineindex is greater than or equal to the number of media
descriptions included in the remote
description. the specified ufrag doesn't match the u...
... one or more of the values in the candidate string are invalid or could not be parsed. attempting to add the candidate fails for any reason. examples this code snippet shows how to signal ice candidates across an arbitrary signaling channel. ...
Introduction to WebRTC protocols - Web APIs
nat (turn) is meant to bypass the symmetric nat restriction by opening a connection with a turn server and relaying all information through that server. you would create a connection with a turn server and tell all peers to send packets to the server which will then be forwarded to you. this obviously comes with some overhead so it is only used if there are no other alternatives. sdp session
description protocol (sdp) is a standard for describing the multimedia content of the connection such as resolution, formats, codecs, encryption, etc. so that both peers can understand each other once the data is transferring. this is, in essence, the metadata describing the content and not the media content itself. technically, then, sdp is not truly a protocol, but a data format used to describe connectio...
...ly a protocol, but a data format used to describe connection that shares media between devices. documenting sdp is well outside the scope of this documentation; however, there are a few things worth noting here. ...
... are a few things worth noting here. structure sdp consists of one or more lines of utf-8 text, each beginning with a one-character type, followed by an equals sign ("="), followed by structured text comprising a value or
description, whose format depends on the type. the lines of text that begin with a given letter are generally referred to as "letter-lines". ...
...comprising a value or
description, whose format depends on the type. the lines of text that begin with a given letter are generally referred to as "letter-lines". ...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
et_accname: get the "name" of the iaccessible, for example the name of a button, checkbox or menu item. try to use unique names for each item in a dialog so that voice dictation software doesn't have to deal with extra ambiguity.[important] get_accvalue: get the "value" of the iaccessible, for example a number in a slider, a url for a link, the text a user entered in a field. [important] get_acc
description: get a long
description of the current iaccessible. this is not really too useful. get_accrole: get an enumerated value representing what this iaccessible is used for, for example. is it a link, static text, editable text, a checkbox, or a table cell, etc. [important] get_accstate: a 32 bit field representing possible on/off states, such as focused, focusable, selected, selectable, visible, p...
...nt] get_acchelp: get context sensitive help for the iaccessible. get_acchelptopic: we don't use this, it's only if the windows help system is used. get_acckeyboardshortcut: what is the keyboard shortcut for this iaccessible (underlined alt+combo mnemonic) get_accfocus: which child is focused? [important] get_accselection: which children of this item are selected? get_accdefaultaction: get a
description or name of the default action for this component, such as "jump" for links. accselect: select the item associated with this iaccessible. [important] acclocation: get the x,y coordinates, and the height and width of this iaccessible node. [important] accnavigate: navigate to the first/last child, previous/next sibling, up, down, left or right from this iaccessible. [important, but no need to im...
... check with your assistive technology partners to find out what states you need to su...
...e kinds of text equivalents, and it is difficult to know when to use each. different applications behave differently in this regard. for example, acrobat uses accessible value for text labels where as most programs use accessible name. solution: be as consistent with internet explorer as possible. use accessible name for most text equivalents, and accessible value for url's. don't use accessible
description unless you really do have a long
description for the object you need to expose -- most assistive technology makes little use of it. dueling text roles problem: there are two different roles for text objects, role_statictext and role_text. role_text is supposed to mean editable text, yet it is sometimes used in conjuction with state_readonly. it's difficult to know when to use which role plus re...
Text labels and names - Accessibility
nology understand what the element is showing. figures with optional captions should be labeled for best accessibility, include a <figcaption> within a <figure> element, even though doing so is technically optional. the caption is in addition to any alternative text on images within the figure. the caption describes the purpose of the figure in the document, which may be different from a simple
description of a visual item, as provided by the alternative text. example the following example shows code for a figure with a caption. the alt attribute of the <img> describes the appearance of the image; the <figcaption> describes it from a functional perspective (in this case, the latin name of the flower in the image). <figure> <img src="milkweed.jgp" alt="black and white close-up photo of mi...
... the <img> describes the appearance of the image; the <figcaption> describes it from a functional perspective (in this case, the latin name of the flower in the image). ...
...verticillata</figcaption> </figure> fieldset elements must be labeled fieldset elements must have a text
description, similar to other form elements. use the <legend> element to describe the purpose of a fieldset. use a legend to label a fieldset when grouping a set of form elements together with a <fieldset> element, you should include a nested <legend> element inside it, containing a clear
description of the group. users of assistive technology find this
description helpful when trying to work out the overall purpose of the group. without the legend, they would have to navigate around the individual form controls in the group to infer an idea of the overall purpose, which could result in confusion. examples <form> <fieldset> <legend>choose your favorite monster</legend> <input ty...
...in both places. content with images must be labeled provide descriptive text for all contentful (that is, non-decorative) images and image-like elements. this includes svg images, <img>, <canvas>, <map>, and <area> elements, as well as <input> elements where type=image and <object> elements where the type starts with image/. the typical way to do this is with the alt attribute. be sure that the
description conveys what is shown in the image. example <img src="milkweed.jgp" alt="black and white close-up photo of milkweed flowers"> interactive elements must be labeled if an element is intended for users to interact with it, it should have a label. interactive elements include links (<a>), form elements, buttons, and any element that has a handler for mouse or keyboard events. the way to lab...
Understandable - Accessibility
t part of a specific language). 3.1.3 unusual words (aaa) where technical terms, jargon, or idioms/slang are used, definitions should be provided for such phrases/words. your site should provide a glossary that contains definitions of such words/terms that you can then link to when they appear, or at the very least provide definitions somewhere in the surrounding text, or in a
description list at the bottom of the page. 3.1.4 abbreviations (aaa) where abbreviations are used, you should provide an expansion of them, or a definition as required. the <abbr> element is often thought of as the preferred way to provide an expansion for an abbreviation — it takes a title attribute that contains the expansion, and this appears when the acronym is moused over. h...
...html5 <audio> element can be used to create a control that allows the reader to play back an audio file containing the correct pronounciation, and it also makes sense to include a textual pronounciation guide after difficult words, in the same way that you find in dictionary entries. see video and audio content, and pronunciation guide for english dictionary note: also see the wcag
description for guideline 3.1 readable: make text content readable and understandable. guideline 3.2 — predictable: make web pages appear and operate in predictable ways this guideline focuses on making user interfaces intuitive and understandable. success criteria how to conform to the criteria practical resource 3.2.1 on focus (a) when a control or other page featu...
...icantly changes the current view (e.g. content or controls), let the user control when they want that change to occur (e.g. what page to show, when to advance to the next photo in the gallery...) if you need to have something like a carousel on a page, provide an option to stop it automatically advancing. better to avoid such functionality if possible. note: also see the wcag
description for guideline 3.2 predictable: make web pages appear and operate in predictable ways. guideline 3.3 — input assistance: help users avoid and correct mistakes this guideline centers around helping users enter correct information when required with the minimum of mistakes. success criteria how to conform to the criteria practical resource 3.3.1 error identification...
... information and services, e.g. providing a dedicated link to a help page or service on each page, providing examples showing what successful completion should look like. 3.3.6 error prevention (all) (aaa) this principle builds on 3.3.4, extending its requirements to all user input situations, not just ones involving sensitive data. again, see 3.3.4. note: also see the wcag
description for guideline 3.3 input assistance: help users avoid and correct mistakes. see also wcag perceivable operable understandable robust ...
Standard metadata names - HTML: Hypertext Markup Language
ication-name: the name of the application running in the web page. note: browsers may use this to identify the application. it is different from the <title> element, which usually contain the application name, but may also contain information like the document name or a status. simple web pages shouldn't define an application-name. author: the name of the document's author.
description: a short and accurate summary of the content of the page. several browsers, like firefox and opera, use this as the default
description of bookmarked pages. generator: the identifier of the software that generated the page. keywords: words relevant to the page's content separated by commas. referrer: controls the http referer header for to requests sent from the document: values for the ...
...mes. your styles can adapt to the current color scheme using the prefers-color-scheme css media feature. the css device adaptation specification defines the following metadata name: viewport: gives hints about the size of the initial size of the viewport. used by mobile devices only. values for the content of <meta name="viewport"> value possible subvalues
description width a positive integer number, or the text device-width defines the pixel width of the viewport that you want the web site to be rendered at. height a positive integer, or the text device-height defines the height of the viewport. not used by any browser. initial-scale a positive number between 0.0 and 10.0 defin...
...al <meta> elements should be used. googlebot, a synonym of robots, is only followed by googlebot (the indexing crawler for google). publisher: the name of the document's publisher. robots: the behaviour that cooperative crawlers, or "robots", should use with the page. it is a comma-separated list of the values below: values for the content of <meta name="robots"> value
description used by index allows the robot to index the page (default). all noindex requests the robot to not index the page. all follow allows the robot to follow the links on the page (default). all nofollow requests the robot to not follow the links on the page. all all equi...
... all nofollow requests the robot to not follow the links on the page. all all equivalent to index, follow google none equivalent to noindex, nofollow google noarchive requests the search engine not to cache the page content. google, yahoo, bing nosnippet prevents displaying any
description of the page in search engine results. google, bing noimageindex requests this page not to appear as the referring page of an indexed image. google nocache synonym of noarchive. bing notes: only cooperative robots follow these rules. do not expect to prevent e-mail harvesters with them. the robot still needs to access ...
HTML documentation index - HTML: Hypertext Markup Language
anything else a url can address. 56 <abbr>: the abbreviation element acronym, definitions, element, html, html text-level semantics, html:flow content, html:palpable content, html:phrasing content, reference, web, abbr, abbreviation, semantics the html abbreviation element (<abbr>) represents an abbreviation or acronym; the optional title attribute can provide an expansion or
description for the abbreviation. 57 <acronym> element, html, html:flow content, obsolete, reference, web the html acronym element (<acronym>) allows authors to clearly indicate a sequence of characters that compose an acronym or abbreviation for a word. 58 <address>: the contact address element address, author, contact, contact information, element, email, email address, ...
...e-readable translation. if the content is time- or date-related, the <time> element must be used. 86 <datalist>: the html data list element element, html, html forms, html5, reference, web the html <datalist> element contains a set of <option> elements that represent the permissible or recommended options available to choose from within other controls. 87 <dd>: the
description details element definition,
description details, element, html, html grouping content, reference, web, dd,
description list, details the html <dd> element provides the
description, definition, or value for the preceding term (<dt>) in a
description list (<dl>). 88 <del>: the deleted text element deleted text, element, html, html edits, reference, web, del the html <...
... potentially with styles and icons applied by the user agent. 93 <div>: the content division element content division, element, html, html grouping content, html:flow content, layout, reference, web, div the html content division element (<div>) is the generic container for flow content. it has no effect on the content or layout until styled using css. 94 <dl>: the
description list element element, html, html grouping content, html:flow content, html:palpable content, reference, web the html <dl> element represents a
description list. the element encloses a list of groups of terms (specified using the <dt> element) and
descriptions (provided by <dd> elements). common uses for this element are to implement a glossary or to display metadata (a list of key-value...
...html grouping content, html:flow content, html:palpable content, reference, web the html <dl> element represents a
description list. the element encloses a list of groups of terms (specified using the <dt> element) and
descriptions (provided by <dd> elements). common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs). 95 <dt>: the
description term element definition, definition list, definition term, element, html, html grouping content, reference, term, dt, lists the html <dt> element specifies a term in a
description or definition list, and as such must be used inside a <dl> element. 96 <element>: the custom element element (obsolete) element, html, obsolete, web components, custom elements, shadow dom ...
Microformats - HTML: Hypertext Markup Language
u-email email address u-photo a photo of the person or organization u-url home page or other url representing the person or organization u-uid universally unique identifier, preferably canonical url p-street-address street number + name p-locality city/...
...mats are amazing</h1> <p>published by <a class="p-author h-card" href="http://example.com">w. ...
...re amazing</h2> <p>published by <a class="p-author h-card" href="http://example.com">w. developer</a> on <time class="dt-published" datetime="2013-06-13 12:00:00">13<sup>th</sup> june 2013</time> </p> <p class="p-summary">in which i extoll the virtues of using microformats.</p> <div class="e-content"> <p>blah blah blah</p> </div> </article> </div> properties property
description p-name name of the feed p-author author of the feed, optionally embed an h-card children nested h-entry objects representing the items of the feed h-event the h-event is for events on the web. h-event is often used with both event listings and individual event pages <div class="h-event"> <h1 class="p-name">microformats meetup</...
... <h1 class="p-name">microformats meetup</h1> <p>from <time class="dt-start" datetime="2013-06-30 12:00">30<sup>th</sup> june 2013, 12:00</time> to <time class="dt-end" datetime="2013-06-30 18:00">18:00</time> at <span class="p-location">some bar in sf</span></p> <p class="p-summary">get together and discuss all things microformats-related.</p> </div> properties property
description p-name event name (or title) p-summary short summary of the event dt-start datetime the event starts dt-end datetime the event ends p-location where the event takes place, optionally embedded h-card parsed h-event example <div class="h-event"> <h2 class="p-name">indieweb summit</h2> <time class="dt-start" datetime="2019-06-2...
JavaScript data types and data structures - JavaScript
property has corresponding attributes. attributes are used internally by the javascript engine, so you cannot directly access them. that's why attributes are listed in double square brackets, rather than single. see object.defineproperty() to learn more. data property associates a key with a value, and has the following attributes: attributes of a data property attribute type
description default value [[value]] any javascript type the value retrieved by a get access of the property. undefined [[writable]] boolean if false, the property's [[value]] cannot be changed. false [[enumerable]] boolean if true, the property will be enumerated in for...in loops. see also enumerability and ownership of properties. f...
... in for...in loops. see also enumerability and ownership of properties. false [[configurable]] boolean if false, the property cannot be deleted, cannot be changed to an accessor property, and attributes other than [[value]] and [[writable]] cannot be changed. false obsolete attributes (as of ecmascript 3, renamed in ecmascript 5) attribute type
description read-only boolean reversed state of the es5 [[writable]] attribute. dontenum boolean reversed state of the es5 [[enumerable]] attribute. dontdelete boolean reversed state of the es5 [[configurable]] attribute. accessor property associates a key with one of two accessor functions (get and set) to retrieve or store a value, and has the follow...
...ute. dontenum boolean reversed state of the es5 [[enumerable]] attribute. dontdelete boolean reversed state of the es5 [[configurable]] attribute. accessor property associates a key with one of two accessor functions (get and set) to retrieve or store a value, and has the following attributes: attributes of an accessor property attribute type
description default value [[get]] function object or undefined the function is called with an empty argument list and retrieves the property value whenever a get access to the value is performed. see also get. undefined [[set]] function object or undefined the function is called with an argument that contains the assigned value and is executed whenever a specified ...
...ndexof (searching a value in the array) or push (adding an element to the array), and so on. this makes arrays a perfect candidate to represent lists or sets. typed arrays are new to javascript with ecmascript 2015, and present an array-like view of an underlying binary data buffer. ...
Numbers and dates - JavaScript
smallestnum = number.min_value; var infinitenum = number.positive_infinity; var neginfinitenum = number.negative_infinity; var notanum = number.nan; you always refer to a property of the predefined number object as shown above, and not as a property of a number object you create yourself. the following table summarizes the number object's properties. ...
... same as the global parsefloat() function. number.parseint() parses a string argument and returns an integer of the specified radix or base. same as the global parseint() function. number.isfinite() determines whether the passed value is a finite number. number...
...value is nan. more robust version of the original global isnan(). number.issafeinteger() determines whether the provided value is a number that is a safe integer. the number prototype provides methods for retrieving information from number objects in various formats. the following table summarizes the methods of number.prototype. methods of number.prototype method
description toexponential() returns a string representing the number in exponential notation. tofixed() returns a string representing the number in fixed-point notation. toprecision() returns a string representing the number to a specified precision in fixed-point notation. math object the built-in math object has properties and methods for mathematical constan...
...rly, standard mathematical functions are methods of math. these include trigonometric, logarithmic, exponential, and other functions. for example, if you want to use the trigonometric function sine, you would write math.sin(1.56) note that all trigonometric methods of math take arguments in radians. the following table summarizes the math object's methods. methods of math method
description abs() absolute value sin(), cos(), tan() standard trigonometric functions; with the argument in radians. asin(), acos(), atan(), atan2() inverse trigonometric functions; return values in radians. sinh(), cosh(), tanh() hyperbolic functions; argument in hyperbolic angle. asinh(), acosh(), atanh() inverse hyperbolic functions; return v...
Regular expressions - JavaScript
l characters in the pattern. for example, to match a single "a" followed by zero or more "b"s followed by "c", you'd use the pattern /ab*c/: the * after "b" means "0 or more occurrences of the preceding item." in the string "cbbabbbbcdebc", this pattern will match the substring "abbbbc". the following pages provide lists of the different special characters that fit into each category, along with
descriptions and examples. assertions assertions include boundaries, which indicate the beginnings and endings of lines and words, and other patterns indicating in some way that a match is possible (including look-ahead, look-behind, and conditional expressions). character classes distinguish different types of characters. for example, distinguishing between letters and digits. groups and ranges indi...
...ered, the substring can be recalled for other use. see groups and ranges for more details. using regular expressions in javascript regular expressions are used with the regexp methods test() and exec() and with the string methods match(), replace(), search(), and split(). these methods are explained in detail in the javascript reference. methods that use regular expressions method
description exec() executes a search for a match in a string. it returns an array of information or null on a mismatch. test() tests for a match in a string. it returns true or false. match() returns an array containing all of the matches, including capturing groups, or null if no match is found. matchall() returns an iterator containing all of the matches,...
...ent behaviors.) if you want to construct the regular expression from a string, yet another alternative is this script: var myre = new regexp('d(b+)d', 'g'); var myarray = myre.exec('cdbbdbsbz'); with these scripts, the match succeeds and returns the array and updates the properties shown in the following table. results of regular expression execution. object property or index
description in this example myarray the matched string and all remembered substrings. ['dbbd', 'bb', index: 1, input: 'cdbbdbsbz'] index the 0-based index of the match in the input string. 1 input the original string. 'cdbbdbsbz' [0] the last matched characters. 'dbbd' myre lastindex the index at which to start the next mat...
...ular expression created with an object initializer, you should first assign it to a variable. advanced searching with flags regular expressions have six optional flags that allow for functionality like global and case insensitive searching. these flags can be used separately or together in any order, and are included as part of the regular expression. regular expression flags flag
description corresponding property g global search. regexp.prototype.global i case-insensitive search. regexp.prototype.ignorecase m multi-line search. regexp.prototype.multiline s allows . to match newline characters. regexp.prototype.dotall u "unicode"; treat a pattern as a sequence of unicode code points. regexp.prototype.un...
Deprecated and obsolete features - JavaScript
obsolete (that is, no longer usable). deprecated features these deprecated features can still be used, but should be used with caution because they are expected to be removed entirely sometime in the future. you should work to remove their use from your code. regexp properties the following properties are deprecated. this does not affect their use in replacement strings: property
description $1-$9 parenthesized substring matches, if any. warning: using these properties can result in problems, since browser extensions can modify them. avoid them! $_ see input. $* see multiline. $& see lastmatch. $+ see lastparen. $` see leftcontext. $' see rightcontext. input the string agains...
...pression is matched. lastmatch the last matched characters. lastparen the last parenthesized substring match, if any. leftcontext the substring preceding the most recent match. rightcontext the substring following the most recent match. the following are now properties of regexp instances, no longer of the regexp object: property
description global whether or not to test the regular expression against all possible matches in a string, or only against the first. ignorecase whether or not to ignore case while attempting a match in a string. lastindex the index at which to start the next match. multiline whether or not to search in strings across multiple lines. source the text...
...on, but it's defined in annex b of the ecma-262 standard, whose introduction states: "… programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code. …" obsolete features these obsolete features have been entirely removed from javascript and can no longer be used as of the indicated version of javascript. object property
description __count__ returns the number of enumerable properties directly on a user-defined object. __parent__ points to an object's context. object.prototype.eval() evaluates a string of javascript code in the context of the specified object. object.observe() asynchronously observing the changes to an object. object.unobserve() remove observers. ...
...an object's context. object.prototype.eval() evaluates a string of javascript code in the context of the specified object. object.observe() asynchronously observing the changes to an object. object.unobserve() remove observers. object.getnotifier() creates an object that allows to synthetically trigger a change. function property
description arity number of formal arguments. array property
description array.observe() asynchronously observing changes to arrays. array.unobserve() remove observers. number number.tointeger() parallelarray parallelarray statements for each...in is deprecated. use for...of instead. destructuring for...in is deprecated. use for...o...
The "codecs" parameter in common media types - Web media technologies
eter string's components are described in more detail in the table below. each component is a fixed number of characters long; if the value is less than that length, it must be padded with leading zeros. av1 codec parameter string components component details p the one-digit profile number: av1 profile numbers profile number
description 0 "main" profile; supports yuv 4:2:0 or monochrome bitstreams with bit depth of 8 or 10 bits per component. 1 "high" profile adds support for 4:4:4 chroma subsampling. 2 "professional" profile adds support for 4:2:2 chroma subsampling and 12 bit per component color. ll ...
...ed upon the iso base media file format (iso bmff) share the same syntax for the codecs parameter. these media types include mpeg-4 (and, in fact, the quicktime file format upon which mpeg-4 is based) as well as 3gp. ...
...y mpeg surround)[1] 45 and up reserved [1] saoc and ld mpeg surround are defined in iso/iec 14496-3:2009/amd.2:2010(e). webm the basic form for a webm codecs parameter is to simply list one or more of the four webm codecs by name, separated by commas. the table below shows some examples: examples of classic webm mime types with codecs parameter mime type
description video/webm;codecs="vp8" a webm video with vp8 video in it; no audio is specified. video/webm;codecs="vp9" a webm video with vp9 video in it. audio/webm;codecs="vorbis" vorbis audio in a webm container. audio/webm;codecs="opus" opus audio in a webm container. video/webm;codecs="vp8,vorbis" a webm container with vp8 video and vorbis au...
...-supported codecs four-character code codec vp08 vp8 vp09 vp9 vp10 vp10 pp the two-digit profile number, padded with leading zeroes if necessary to be exactly two digits. webm profile numbers profile
description 00 only 4:2:0 (chroma subsampled both horizontally and vertically). allows only 8 bits per color component. 01 all chroma subsampling formats are allowed. allows only 8 bits per color component. 02 only 4:2:0 (chroma subsampled both horizontally and vertically). supports 8, 10, or 12 bits per color sam...
Progressive web app structure - Progressive web apps (PWAs)
ure is quite simple: it consists of a single html file (index.html) with basic css styling (style.css), and a few images, scripts, and fonts. ...
...you can <a href="https://github.com/mdn/pwa-examples/blob/master/js13kpwa">fork js13kpwa on github</a> to check its source code.</p> <button id="notifications">request dummy notifications</button> <section id="content"> // con...
... the app's only job is to list all the a-frame entries from the js13kgames 2017 competition. as you can see it is ...
... the app's only job is to list all the a-frame entries from the js13kgames 2017 competition. ...
Navigator.mozNotification - Archive of obsolete content
ing notification objects, which are used to display desktop notification alerts to the user. currently, these are only supported on firefox mobile and firefox os. see displaying notifications for an example. the support for this property as been dropped in favor of the standard notification constructor. ...
... iconurl optional a url identifying the image to display in the notification. return value a new notification object. ...
... iconurl optional a url identifying the image to display in the notification. return value a new notification object. ...
Custom about: URLs - Archive of obsolete content
and the signature of the newchannel method changed. this change is reflected in the code below. this code will work for all versions of firefox 4 and up. ...
... sure you generate a unique id from https://www.famkruithof.net/uuid/uuidgen const aboutpage_word = 'myaboutpage' const aboutpage_uri = 'data:text/html,hi this is the page that is shown when navigate to about:myaboutpage'; // const aboutpage_uri = 'chrome://myaboutaddon/content/index.html'; class aboutpage { static get classid() { return components.id(`{${aboutpage_id}}`); } static get class
description() { return aboutpage_
description; } static get contractid() { return `@mozilla.org/network/protocol/about;1?what=${aboutpage_word}`; } static get queryinterface() { return xpcomutils.generateqi([ci.nsiaboutmodule]); } constructor() { object.freeze(this); } geturiflags(auri) { return ci.nsiaboutmodule.allow_script; } newchannel(auri, asecurity_or_aloadinfo) { let chann...
... factory = new factory(a...
The Essentials of an Extension - Archive of obsolete content
, which is extremely unlikely to be duplicated. unix-based systems have a command line tool called uuidgen that generates uuids. there are also downloadable tools for all platforms that generate them. the enclosing brackets are just notation, and they're just common practice. as long as your id has some uniqueness to it, it's ok to use either form. <em:name>xul school hello world</em:name> <em:
description>welcome to xul school!</em:
description> <em:version>0.1</em:version> <em:creator>appcoast</em:creator> <em:homepageurl>https://developer.mozilla.org/docs/xul_school</em:homepageurl> this is the data that is displayed before and after the extension is installed, that you can see in the add-ons manager. there are many other tags that can be added, for contributors and translators. the full speci...
...l</em:homepageurl> this is the data that is displayed before and after the extension is installed, that you can see in the add-ons manager. there are many other tags that can be added, for contributors and translators. the full specification of the install.rdf file has all the details. since extensions can be translated to multiple languages, it is often necessary to translate the extension's
description, or even its name. a localized
description and name can be added with the following code: <em:localized> <
description> <em:locale>es-es</em:locale> <em:name>xul school hola mundo</em:name> <em:
description>bienvenido a xul school!</em:
description> </
description> </em:localized> the es-es locale string indicates that this is the spanish (es) localization for spain (es). you ca...
...tion for spain (es). you can add as many <em:localized> sections as you need. for firefox 2, localizing this file is a little more complicated. we'll discuss localization further ahead in this section. <em:type>2</em:type> this specifies that the add-on being installed is an extension. you can read about different possible types in the install.rdf specification. <em:targetapplication> <
description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>4.0</em:minversion> <em:maxversion>10.*</em:maxversion> </
description> </em:targetapplication> this node specifies the target application and target versions for the extension, specifically firefox, from version 4 up to version 10. the uuid is firefox's unique id. other mozilla and mozilla-based applications s...
Supporting search suggestions in search plugins - Archive of obsolete content
offer using whatever means it sees fit, and return a json array of results: query string the first element in the array is the original query string. this allows firefox to verify that the suggestions match the current search term. completion list an array of suggested search terms. the array should be enclosed in square brackets. for example: ["term 1", "term 2", "term 3", "term 4"]
descriptions this optional element is an array of
descriptions for each of the suggestions in thecompletion list . these can be any additional information the search engine might want to return to be displayed by the browser, such as the number of results available for that search.
descriptions are not supported in firefox, and are ignored if any are specified. query urls this optional element is an a...
... this optional element is an array of alternate urls for each of the suggestions in thecompletion list . for example, if you want to offer a map link instead of just a search result page for a given suggestion, you can return an url to a map in this array. if you don't specify a query url, the default query is used based on the search described by the <url> element in the search plugin's xml
description. ...
...used based on the search described by the <url> element in the search plugin's xml
description. query urls are not supported in firefox, and are ignored. this enhancement request - the handling of a selected suggestion, namely calling of a full specified url as proposed in the opensearch standard - is tracked in bug 386591. for example, if the search term is "fir", and you don't need to return
descriptions or alternate query urls, you might return the following json: ["fir", ["firefox", "first choice", "mozilla firefox"]] note that in this example, only the query string and completion array are specified, leaving out the optional elements. your completion list can include as many suggestions as you like, although it should be kept manageable, given that the display will be updating live while ...
Getting Started - Archive of obsolete content
r!/communicator/ skin help my_theme jar:chrome/my_theme.jar!/help/ skin navigator my_theme jar:chrome/my_theme.jar!/navigator/ skin editor my_theme jar:chrome/my_theme.jar!/editor/ save the file and exit the text editor. install.rdf make a copy of install.rdf and place it in the my_theme directory, then open it up in your text editor. this file is a small xml database that describes the skin. <
description about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number. once you've done this, insert the information as above, and scroll down. you will also have to update the minimum and maximum compatible versions for the target application...
... <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number. once you've done this, insert the information as above, and scroll down. ...
...and scroll down. you will also have to update the minimum and maximum compatible versions for the target application (seamonkey) in the following section: <em:targetapplication> <
description> <!-- seamonkey's uuid --> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>min_sm_version</em:minversion> <em:maxversion>max_sm_version</em:maxversion> </
description> </em:targetapplication> establishing both minimum and maximum compatible versions lets you avoid conflicts with versions of seamonkey your theme wasn't designed for -- or wasn't tested on. see install manifests for the reference information about the install.rdf file. css files the css files in these directories tell the browser how to display the buttons and other controls, where to put the ...
contents.rdf - Archive of obsolete content
ext and paste it into a text file, then save that file as "contents.rdf": <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <!-- list all the skins being supplied by this theme --> <rdf:seq about="urn:mozilla:skin:root"> <rdf:li resource="urn:mozilla:skin:myskin/1.0" /> </rdf:seq> <rdf:
description about="urn:mozilla:skin:myskin/1.0" chrome:displayname="my skin" chrome:accesskey="m" chrome:author="me" chrome:
description="this is my custom skin for mozilla" chrome:name="myskin/1.0" chrome:image="preview.png"> <chrome:packages> <rdf:seq about="urn:mozilla:skin:myskin/1.0:packages"> <rdf:li resource="urn:mozilla:skin:myskin/1.0:...
...skin/1.0:packages"> <rdf:li resource="urn:mozilla:skin:myskin/1.0:communicator"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:editor"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:global"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:messenger"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:navigator"/> </rdf:seq> </chrome:packages> </rdf:
description> <!-- version information. state that we work only with major version 1 of this package. --> <rdf:
description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:communicator"/> <rdf:
description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:editor"/> <rdf:
description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:global"/> <rdf:
description chr...
...of this package. ...
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
ditor"/> <rdf:li resource="urn:mozilla:skin:my_theme:global"/> <rdf:li resource="urn:mozilla:skin:my_theme:messenger"/> <rdf:li resource="urn:mozilla:skin:my_theme:navigator"/> save the file and exit the text editor. install.rdf make a copy of install.rdf and place it in the my_theme directory, then open it up in your text editor. this file is a small xml database that describes the skin. <
description about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number. once you've done this, insert the information as above, and scroll down. you will also have to update the minimum and maximum compatible versions for the target applicati...
... <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number. once you've done this, insert the information as above, and scroll down. ...
..., and scroll down. you will also have to update the minimum and maximum compatible versions for the target application (firefox) in the following section: <em:targetapplication> <
description> <!-- firefox's uuid --> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>min_ff_version</em:minversion> <em:maxversion>max_ff_version</em:maxversion> </
description> </em:targetapplication> establishing both minimum and maximum compatible versions lets you avoid conflicts with versions of firefox your theme wasn't designed for -- or wasn't tested on. see install manifests for the reference information about the install.rdf file. css files the css files in these directories tell the browser how to display the buttons and other controls, where to put th...
Menu - Archive of obsolete content
mpty menu. jetpack.menu(menuitems) creates a menu with the given items. parameters menuitems an array of menuitems. jetpack.menu(properties) creates a menu with specific properties. parameters properties an object defining any of the properties below. the items property may be used to define an array of menuitems. properties property type
description beforehide function a function invoked just before the menu is hidden. if the menu is a context menu, it is called as beforehide(menu, context) and otherwise as beforehide(menu). menu is the menu object to which beforehide is attached. context is an object describing the context in which the menu was shown. beforeshow function a function i...
...menuitem. if the item belongs to a context menu, the function is called as function(context) and otherwise function(). context is an object describing the context in which the menu was shown. string a simple menuitem with the given string label. object a menuitem with specific properties. the object may define any of the properties listed below. properties property type
description command function a function that will be called when the menuitem is clicked. if the menu property is present, command will instead be called when any of the item's descendants is clicked. in that case, the commands of descendants will be invoked first. in either case, it is called as command(clickedmenuitem), where clickedmenuitem is the menuitem that was cl...
...the content context menu. this is the context menu that appears when right-clicking on a web page. a contextmenuset object. context objects some callbacks passed into the api are called with a context object, such as contextmenuset.beforeshow(). context objects are objects that describe the context in which a context menu is shown. they have the following properties: property
description node the dom node on which the menu is shown. this is the node the user clicked to open the menu. be careful when dealing with nested nodes. for example, if the user clicks on an image inside a link, this property will be set to the image, not the link. similarly, if the user clicks a node within a div, this property will be the node, not the div. document ...
Attribute Substitution - Archive of obsolete content
ast thing to point out is that since the only characters that can separate a variable are a caret, a space or the end of the attribute, this means that any other character is valid as a variable name. however, for readability, you should restrict variable names to letters, numbers and perhaps hyphens to separate words. it may be desirable to have longer text wrap by placing it as the content of a
description element. this means that we want to do variable replacement as text, not as an attribute value. a special tag is used for this purpose, the textnode tag. it has one attribute, the value attribute, which may use variable substitution like other attributes. however, the textnode element is not copied into the generated content, but instead a dom text node is created with the value of the value attr...
...ext, not as an attribute value. a special tag is used for this purpose, the textnode tag. it has one attribute, the value attribute, which may use variable substitution like other attributes. however, the textnode element is not copied into the generated content, but instead a dom text node is created with the value of the value attribute as its contents. for instance, if the template contained: <
description><textnode value="?
description"/></
description> the resulting generated content might be: <
description>view from the top of the tower looking east of the doges palace</
description> note that the textnode has been replaced with the substituted value attribute. note that in firefox 2 and earlier, a bug can make this appear to not work at times. recall that the template builder doesn't load the dat...
...iables determined from a binding are evaluated using a much simpler process. the bug is that this code path for bindings doesn't handle the textnode element properly. thus, if you use a variable set in a binding, you must ensure the datasource is loaded before the template is built, or just rebuild the template. another possibilty is to rearrange the rdf such that the values, in this example, the
descriptions, are specified before the containers. this issue is fixed in firefox 3 (mozilla 1.9) and later. « previousnext » ...
Sorting Results - Archive of obsolete content
e template builder generates the results. for ascending or descending sorts, this doesn't matter, since it will ignore whether results are containers and just sort by a value, alphabetically or numerically depending on the type of data. when using a tree, sorting may be performed on each column of the tree. for instance, if a list of photos was displayed in a two column tree showing the title and
description, you could sort by either title or
description. the user can change the sort column and direction by clicking the column headers, however, you can programmatically change the sort as well. sorting tree results we'll examine sorting of trees first since trees are the most common element used with sorted items. using a tree builder, you can sort the results in a tree by a column. to do this, place ...
... sort by. here is a complete example of sorting a tree. the sort attribute should be set to the variable that holds the values to sort by. usually, this would be the same variable that is used to generate the label for the cells in that column, however this is not actually necessary. for instance, in the example the second column sorts by date, but if you were to use a different variable such as ?
description, the tree would sort by the value of the
description variable for each row. in almost all situations however, you would normally sort using the same variable used for the label value. however, one situation where this is not desirable is if the displayed values would not generate the correct order as there is a different representation that is more accurate. for example, the date 'may 15' would a...
...the user's current locale (meaning that the date is formatted so as to be suitable for the user's language). here is a sample of how to specify this in the rdf/xml datasource: <rdf:rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:r="http://www.xulplanet.com/rdf/" xmlns:nc="http://home.netscape.com/nc-rdf#"> <rdf:
description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg"> <r:date nc:parsetype="date">1125966767295<r:date> </rdf:
description> </rdf:rdf> you can also specify parsetype="integer" for numbers which will allow sorting numerically. by specifing different types for different values, you can sort alphabetically, numerically or by date. if you are using the simple rdf query syntax, there...
Localization - Archive of obsolete content
e findlabel and the value "find". this means that wherever the text "&findlabel;" appears in the xul file, it will be replaced with the text "find". note that entity declarations do not have a trailing slash at the end of them. in the dtd file for a different language, the text for that language will be used instead. for japanese: <!entity findlabel "検索"> for example, the following text: <
description value="&findlabel;"/> is translated as: english version: <
description value="find"/> japanese version: <
description value="検索"/> you would declare an entity for each label or string of text that you use in your interface. you should not have any directly displayed text in the xul file at all. in addition to using entities for text labels, you should use them for any value that could be...
...ar> <toolbar id="findfiles-toolbar"> <toolbarbutton id="opensearch" label="&opencmdtoolbar.label;"/> <toolbarbutton id="savesearch" label="&savecmdtoolbar.label;"/> </toolbar> </toolbox> <tabbox> <tabs> <tab label="&searchtab;" selected="true"/> <tab label="&optionstab;"/> </tabs> <tabpanels> <tabpanel id="searchpanel" orient="vertical" context="editpopup"> <
description> &find
description; </
description> <spacer class="titlespace"/> <groupbox orient="horizontal"> <caption label="&findcriteria;"/> <menulist id="searchtype"> <menupopup> <menuitem label="&type.name;"/> <menuitem label="&type.size;"/> <menuitem label="&type.date;"/> </menupopup> </menulist> <spacer class="springspace"/> ...
... copycmd.label "copy"> <!entity pastecmd.label "paste"> <!entity cutcmd.accesskey "t"> <!entity copycmd.accesskey "c"> <!entity pastecmd.accesskey "p"> <!entity cutcmd.commandkey "x"> <!entity copycmd.commandkey "c"> <!entity pastecmd.commandkey "v"> <!entity opencmdtoolbar.label "open"> <!entity savecmdtoolbar.label "save"> <!entity searchtab "search"> <!entity optionstab "options"> <!entity find
description "enter your search criteria below and select the find button to begin the search."> <!entity findcriteria "search criteria"> <!entity type.name "name"> <!entity type.size "size"> <!entity type.date "date modified"> <!entity mode.is "is"> <!entity mode.isnot "is not"> <!entity casesensitive "case sensitive search"> <!entity matchfilename "match entire filename"> <!entity results.filename "filename...
XUL accessibility guidelines - Archive of obsolete content
ow" title="my application" ...> <wizard id="reg_window" title="register your software" ...> form labels labels are not automatically associated to form elements. use the control attribute to bind a text label (from a label element) to a form element. screen readers will then read aloud the label when entering a form field. for labels that may wrap to a second line, do not use the
description element. instead, use the text of a label enclosed in the label tags, and do not use the value attribute, as shown below for the password field. <label control="login-username" value="username:"/> <textbox id="login-username"/> <label control="login-password">password:</label> <textbox id="login-password" type="password"/> larger forms can be difficult to layout and structure. while there are...
...allow users to correct errors. some users with disabilities have difficulties with quick responses. allow users adequate time to perform tasks. instruction provide users with help documentation. even simple applications should include a help document or manual for user reference. describe keyboard shortcuts and any other accessibility considerations. users should be able to reference a complete
description of all major functionality of an application. also provide details on how to use long or complex help documentation. alerts provide accessible alerts for presenting important information to the user. use scripting or the notificationbox element to flag alerts. avoid using audio or visual alerts alone to signal urgent events. users who have audio turned down or off and users who are deaf or har...
...color and background color. color alone is used to convey meaning, or font and background color do not provide sufficient contrast. flex visual elements and containers resize gracefully. visual elements and containers do not resize gracefully. human computer interaction checkpoint pass fail instruction help documentation is provided including a
description of keyboard shortcuts. help documentation is not provided or is incomplete. alerts alerts are displayed using the alert scripting function or the notificationbox element. alerts are conveyed visually or audibly, or use a method other than the alert scripting function or the notificationbox element. interactive elements interactive elements are sufficiently large and ...
richlistbox - Archive of obsolete content
you can click on any richlistitem element and use the keyboard to move the selection around. attributes disabled type: boolean indicates whether the elemen...
...you can click on any richlistitem element and use the keyboard to move the selection around. attributes disabled type: boolean indicates whether the element is disabled or n...
...you can click on any richlistitem element and use the keyboard to move the selection around. attributes disabled type: boolean indicates whether the element is disabled or not. if this at...
Adobe Flash - Archive of obsolete content
ng the flash plugin version below, javascript identifies the version of flash, and whether it is scriptable in netscape gecko: can we have javascript in a wiki page? <script type="text/javascript">identifyflash();</script> typically, javascript code that determines what version of the plugin is installed looks at the mimetypes array that is part of the navigator object. every plugin exposes a
description string that typically includes the plugin's name and version number. the flash plugin's
description string uses a standard versioning nomenclature that can then be parsed for meaningful information. for example, the current flash plugin version is flash 6 r79. the
description string exposes this version. furthermore, it is also necessary weed out versions of flash that are not scriptable in mach-...
...tring exposes this version. furthermore, it is also necessary weed out versions of flash that are not scriptable in mach-o browsers on os x. fortunately, mach-o browsers based on netscape gecko expose this information in their user-agent string. an algorithmic approach to detecting flash plugin version might be: var plugin = navigator.mimetypes["application/x-shockwave-flash"].enabledplugin; var
description = plugin.
description; // 1. tokenize
description string to its constituent parts var versionarray =
description.match(/[\d.]+/g); // 2. determine if the flash version is greater than 6r.49 // 3. if so, the plugin is scriptable on windows and linux // 4. determine whether the browser is a mach-o browser // 5. if the browser is a mach-o browser, determine whether the version of the plugin // is g...
...x the plugin to be // scriptable on mach-o browsers also var flashversionosxscriptable = 12; if(navigator.useragent.indexof("mach-o")!=-1) { if(flashversion < flashversionosxscriptable) // flash version is less than version 12, thus not scriptable on os x } // 6. handle errors (no flash installed, etc.) example 1 uses the regexp (regular expression) object exposed to javascript strings. the
description string is broken into an array of constituent strings based on an invocation of the match method with a regular expression that assumes that the string format will be in the format flash major rminor where major can be a major revision such as "5" or "6" and minor is the subsidiary version number. example 1 also creates a constant flashversionosxscriptable that declares (arbitrarily) that macrome...
Sunbird Theme Tutorial - Archive of obsolete content
ectory is your theme directory. go into your theme directory. creating information about your theme in your theme directory, create a plain text file named <tt>install.rdf</tt>. ...
...e named <tt>install.rdf</tt>. ...
...://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest" em:id="just-testing@example.com" em:name="just testing" em:creator="rod whiteley" em:
description="a test theme for sunbird" em:homepageurl="http://developer.mozilla.org/" em:version="0.1" em:internalname="testing" em:type="4" > <em:targetapplication><!-- sunbird --> <
description em:id="{718e30fb-e89b-41dd-9da7-e25a45638b28}" em:minversion="0.2.9" em:maxversion="0.4" /> </em:targetapplication> </
description> </rdf> in the line that starts <tt>em:id</tt>, paste your identifier between the double-quote characters, replacing the identifier that is there now. change the next six lines to describe your theme. ensure that the internal name is a ...
contents.rdf - Archive of obsolete content
owing text and paste it into a text file, then save that file as "contents.rdf": <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <!-- list all the skins being supplied by this theme --> <rdf:seq about="urn:mozilla:skin:root"> <rdf:li resource="urn:mozilla:skin:my_theme"/> </rdf:seq> <rdf:
description about="urn:mozilla:skin:my_theme" chrome:displayname="my theme" chrome:accesskey="n" chrome:author="" chrome:authorurl="" chrome:
description="" chrome:name="my_theme" chrome:image="preview.png"> <chrome:packages> <rdf:seq about="urn:mozilla:skin:my_theme:packages"> <rdf:li resource="urn:mozilla:skin:my_theme:browser"/> ...
...rn:mozilla:skin:my_theme:packages"> <rdf:li resource="urn:mozilla:skin:my_theme:browser"/> <rdf:li resource="urn:mozilla:skin:my_theme:communicator"/> <rdf:li resource="urn:mozilla:skin:my_theme:global"/> <rdf:li resource="urn:mozilla:skin:my_theme:mozapps"/> <rdf:li resource="urn:mozilla:skin:my_theme:help"/> </rdf:seq> </chrome:packages> </rdf:
description> <!-- version information. state that we work only with major version 1 of this package. --> <rdf:
description chrome:skinversion="1.5" about="urn:mozilla:skin:my_theme:browser"/> <rdf:
description chrome:skinversion="1.5" about="urn:mozilla:skin:my_theme:communicator"/> <rdf:
description chrome:skinversion="1.5" about="urn:mozilla:skin:my_theme:global"/> <rdf:
description chrome:skinversi...
...major version 1 of this package. ...
JSException - Archive of obsolete content
summary the public class jsexception extends runtimeexception java.lang.object | +----java.lang.throwable | +----java.lang.exception | +----java.lang.runtimeexception | +----netscape.javascript.jsexception
description jsexception is an exception which is thrown when javascript code returns an error. constructor summary the netscape.javascript.jsexception class has the following constructors: jsexception deprecated constructors optionally let you specify a detail message and other information. method summary the netscape.javascript.jsexception class has the following methods: getwrappedexception instance method getwrappedexception. getwrappe...
...l message. filename the url of the file where the error occurred, if possible. lineno the line number of the file, if possible. source the string containing the javascript code being evaluated. tokenindex the index into the source string where the error occurred. getwrappedexception instance method getwrappedexception. ...
... object getwrappedexception()
description getwrappedexception() returns an object that represents the value that the javascript actually threw. javascript can throw any type of value. use getwrappedexception() to determine what kind of value the object return type represents. getwrappedexceptiontype instance method getwrappedexceptiontype. ...
RDF in Fifty Words or Less - Archive of obsolete content
first, rdf is a graph-based model for describing internetresources (like web pages and email messages), and how these resources relate to one another. but what does that mean,really? to a mozilla developer, it means that the rdf data model (the "graph") can be used as a mechanism for integrating and organizing internet resources. ...
... the graph. that "internet resource" was a uri that pointed to a cgi script (say, http://www.mozilla.org/smart-mail/get-mail.cgi?user=waterson&folder=inbox). ...
... this isexactly how smartmail works. contact: chris waterson (waterson@netscape.com) original d...
Accessible multimedia - Learn web development
have categories? video and choose the three dot menu (. . .) > show transcript. you'll see the transcript come up in a separate panel. if you are creating your own user interface to present your audio and associated transcript, you can do it however you like, but it might make sense to include it in a showable/hideable panel; see our audio-transcript-ui example (also see the source code). audio
descriptions on occasions where there are visuals accompanying your audio, you'll need to provide audio
descriptions of some kind to describe that extra content. in many cases this will simply take the form of video, in which case you can implement captions using the techniques described in the next section of the article. however, there are some edge cases. you might for example have an audio recording o...
...ones you'll come across are: captions — there for the benefit of deaf users who can't hear the audio track, including the words being spoken, and contextual information such as who spoke the words, if the people were angry or sad, and what mood the music is currently creating. subtitles — include translations of the audio dialog, for users that don't understand the language being spoken.
descriptions — these include
descriptions for blind people who can't see the video, for example what the scene looks like. chapter titles — chapter markers intended to help the user navigate the media resource implementing html5 video text tracks text tracks for displaying with html5 video need to be written in webvtt, a text format containing multiple strings of text along with metadata such as what...
...btitle. 2 00:00:30.739 --> 00:00:34.074 this is the second. ... to get this displayed along with the html media playback, you need to: save it as a .vtt file in a sensible place. link to the .vtt file with the <track> element. <track> should be placed within <audio> or <video>, but after all <source> elements. use the kind attribute to specify whether the cues are subtitles, captions, or
descriptions. furthermore, use srclang to tell the browser what language you have written the subtitles in. here's an example: <video controls> <source src="example.mp4" type="video/mp4"> <source src="example.webm" type="video/webm"> <track kind="subtitles" src="subtitles_en.vtt" srclang="en"> </video> this will result in a video that has subtitles displayed, kind of like this: for more details,...
Package management basics - Learn web development
ollowing command, making sure you are inside the parcel-experiment directory: npm init you will now be asked some questions; npm will then create a default package.json file based on the answers: name: a name to identify the app. just press return to accept the default parcel-experiment. version: the starting version number for the app: again, just press return to accept the default 1.0.0.
description: a quick
description of the app's purpose. type in something really simple, like "a simple npm package to learn about using npm", then press return. entry point: this will be the top-level javascript file of the app. the default index.js is fine for now — press return. test command, git repository, and keywords: press return to leave each of these blank for now. author: the author of the pro...
...t. type your own name, and press return. license: the license to publish the package under: press return to accept the default for now. press return one more time to accept these settings. go into your parcel-experiment directory and you should now find you've got a package.json file. open it up and it should look something like this: { "name": "parcel-experiment", "version": "1.0.0", "
description": "a simple npm package to learn about using npm", "main": "index.js", "scripts": { "test": "echo \"error: no test specified\" && exit 1" }, "author": "chris mills", "license": "isc" } so this is the config file that defines your package. this is good for now, so let's move on. installing parcel run the following command to install parcel locally: npm install parcel-bundler onc...
...re the same name. pnpm and yarn can consume the same package.json format as npm, and can install any package from the npm and other package registries. let’s review the common actions you’ll want to perform with package managers. initialise a new project npm init yarn init as shown above, this will prompt and walk you through a series of questions to describe your project (name, license,
description and so on) then generate a package.json for you that contains meta information about your project and its dependencies. installing dependencies npm install date-fns yarn add date-fns we also saw install in action above. this would directly add the date-fns package to the working directory in a sub-directory called node_modules, along with date-fns’s own dependencies. by default this command...
A bird's-eye view of the Mozilla framework
associated with a graphical user interface (gui) control. the various x toolkit implementations provide a set of widgets for ui controls such as menus, command buttons, dialog boxes and scroll bars. the mozilla xptoolkit module provides a similar set of facilities for building cross-platform ui controls implemented as xml user interface language (xul) packages. a xul package consists of a xul
description of the ui widget cascading style sheets customizing appearance javascript services implementing the ui behavior a package (also known as chrome) is really just a bundling of a set of ui widgets and associated services implementing a particular application feature. chrome and extensions are examples of packages. content (dom) the mozilla document object model (dom) specifies a logical tree s...
......
...programming language used to implement the object itself. for example, a javascript object or c++ class could both implement the same xpidl interface. scripting languages such as javascript cannot directly access xpcom components, but access them indirectly using xpconnect. xpconnect also provides a required layer for xpcom components written in a scripting language. let’s consider a resource
description framework (rdf) example, where rdf is a framework for describing and interchangingmetadata, that is, information about information. in this example, we’re interested in the rdf sub-graph underlying thecontents panel widget within thehelp viewer window. suppose the client already has an nsirdfdatasource object representing a sub-graph of an rdf graph and calls nsirdfdatasource.gettarget(resource...
PR_Open
may be used. if the flags parameter does not include any of the first three flags (pr_rdonly, pr_wronly, or pr_rdwr), the open file can't be read or written, which is not useful. note: the constants pr_rdwr and friends are not in any interface (bug 433295). thus they cannot be used in javascript, you have to use the octal constants (see file i/o snippets). name value
description pr_rdonly 0x01 open for reading only. pr_wronly 0x02 open for writing only. pr_rdwr 0x04 open for reading and writing. pr_create_file 0x08 if the file does not exist, the file is created. if the file exists, this flag has no effect. pr_append 0x10 the file pointer is set to the end...
... mode when pr_create_file flag is set and the file is created, these flags define the access permission bits of the newly created file. this feature is currently only applicable on unix platforms. it is ignored by any other platform but it may apply to other platforms in the future. possible values of the mode parameter are listed in the table below. name value
description pr_irwxu 0700 read, write, execute/search by owner. pr_irusr 0400 read permission, owner. pr_iwusr 0200 write permission, owner. pr_ixusr 0100 execute/search permission, owner. pr_irwxg 0070 read, write, execute/search by group pr_irgrp 0040 read permission, group pr...
...0002 write permission, others pr_ixoth 0001 execute/search permission, others returns the function returns one of the following values: if the file is successfully opened, a pointer to a dynamically allocated prfiledesc for the newly opened file. the prfiledesc should be freed by calling pr_close. if the file was not opened successfully, a null pointer.
description pr_open creates a file descriptor (prfiledesc) for the file with the pathname name and sets the file status flags of the file descriptor according to the value of flags. if a new file is created as a result of the pr_open call, its file mode bits are set according to the mode parameter. ...
Function_Name
describe all side-effects on "out" parameters. ...
...st what it returns). syntax #include <headers.h> returntype function_name( paramtype paramname, paramtype paramname, ); parameters paramname sample: in pointer to a certcertdbhandle representing the certificate database to look in paramname sample: in pointer to an secitem whose type must be sidercertbuffer and whose data contains a der-encoded certificate
description long
description of this function, what it does, and why you would use it. describe all side-effects on "out" parameters. avoid describing the return until the next section, for example: this function looks in the nsscryptocontext and the nsstrustdomain to find the certificate that matches the der-encoded certificate. a match is found when the issuer and serial number of the der-encoded certific...
... describe all side-effects on "out" parameters. avoid describing the return until the next section, for example: this function looks in the nsscryptocontext and the nsstrustdomain to find the certificate that matches the der-encoded certificate. a match is found when the issuer and serial number of the der-encoded certificate are found on a certificate in the certificate database. returns full
description of the return value, for example: a pointer to a certcertificate representing the certificate in the database that matched the dercert, or null if none was found. the certificate is a shallow copy, use cert_destroycertificate to decrement the reference count on the certificate instance. see also copy of the mxr link, with the following text occurrences of function_name in the current nss sourc...
NSS Key Functions
nss. this was converted from "chapter 6: key functions". back to the nss reference main page. seckey_getdefaultkeydb seckey_destroyprivatekey seckey_getdefaultkeydb returns a handle to the default key database opened by nss_init. syntax include <key.h> include <keyt.h> seckeykeydbhandle *seckey_getdefaultkeydb(void); returns the function returns a handle of type seckeykeydbhandle.
description nss_init opens the certificate, key, and security module databases that you specify for use with nss. seckeykeydbhandle returns a handle to the key database opened by nss_init. seckey_destroyprivatekey destroys a private key structure. syntax include <key.h> include <keyt.h> void seckey_destroyprivatekey(seckeyprivatekey *key); parameter this function has the following parameter: key a poi...
...rity module databases that you specify for use with nss. seckeykeydbhandle returns a handle to the key database opened by nss_init. seckey_destroyprivatekey destroys a private key structure. syntax include <key.h> include <keyt.h> void seckey_destroyprivatekey(seckeyprivatekey *key); parameter this function has the following parameter: key a pointer to the private key structure to destroy.
description certificate and key structures are shared objects. when an application makes a copy of a particular certificate or key structure that already exists in memory, ssl makes a shallow copy--that is, it increments the reference count for that object rather than making a whole new copy. when you call cert_destroycertificate or seckey_destroyprivatekey, the function decrements the reference count and, i...
..., ssl makes a shallow copy--that is, it increments the reference count for that object rather than making a whole new copy. when you call cert_destroycertificate or seckey_destroyprivatekey, the function decrements the reference count and, if the reference count reaches zero as a result, both frees the memory and sets all the bits to zero. the use of the word "destroy" in function names or in the
description of a function implies reference counting. never alter the contents of a certificate or key structure. if you attempt to do so, the change affects all the shallow copies of that structure and can cause severe problems. ...
sslerr.html
current nss reference nss and ssl error codes chapter 8 nss and ssl error codes nss error codes are retrieved using the nspr function pr_geterror. in addition to the error codes defined by nspr, pr_geterror retrieves the error codes described in this chapter. ssl error codes sec error codes ssl error codes table 8.1 error codes defined in sslerr.h constant value
description ssl_error_export_only_server -12288 "unable to communicate securely. peer does not support high-grade encryption." the local system was configured to support the cipher suites permitted for domestic use. the remote system was configured to support only the cipher suites permitted for export use. ssl_error_us_only_server -12287 "unable to communicate sec...
...robably indicates a flaw in the remote peer's implementation. ssl_error_rx_unknown_record_type -12233 "ssl received a record with an unknown content type." ssl_error_rx_unknown_handshake -12232 "ssl received a handshake message with an unknown message type." ssl_error_rx_unknown_alert -12231 "ssl received an alert record with an unknown alert
description." received an alert report: all the error codes in the following block indicate that the local socket received an ssl3 or tls alert record from the remote peer, reporting some issue that it had with an ssl record or handshake message it received. (some _alert codes are listed in other blocks.) ssl_error_handshake_unexpected_alert -12229 "ssl peer was no...
...ization vectors from the master secret. if encountered repeatedly on a server socket, this can indicate that the server is actively under a "million question" attack. ssl_error_decompression_failure -12177 "ssl received a compressed record that could not be decompressed." sec error codes table 8.2 security error codes defined in secerr.h constant value
description sec_error_io -8192 an i/o error occurred during authentication; or an error occurred during crypto operation (other than signature verification). sec_error_library_failure -8191 security library failure. sec_error_bad_data -8190 security library: received bad data. sec_error_output_len -8189 security library: output length error. ...
sslkey.html
te private keys and key databases such as the key3.db database provided with communicator. seckey_getdefaultkeydb seckey_destroyprivatekey seckey_getdefaultkeydb returns a handle to the default key database opened by nss_init. syntax #include <key.h> #include <keyt.h> seckeykeydbhandle *seckey_getdefaultkeydb(void); returns the function returns a handle of type seckeykeydbhandle.
description nss_init opens the certificate, key, and security module databases that you specify for use with nss. seckeykeydbhandle returns a handle to the key database opened by nss_init. seckey_destroyprivatekey destroys a private key structure. syntax #include <key.h> #include <keyt.h> void seckey_destroyprivatekey(seckeyprivatekey *key); parameter this function has the following parameter: ...
... returns a handle to the key database opened by nss_init. seckey_destroyprivatekey destroys a private key structure. syntax #include <key.h> #include <keyt.h> void seckey_destroyprivatekey(seckeyprivatekey *key); parameter this function has the following parameter: key a pointer to the private key structure to destroy.
description certificate and key structures are shared objects. when an application makes a copy of a particular certificate or key structure that already exists in memory, ssl makes a shallow copy--that is, it increments the reference count for that object rather than making a whole new copy. when you call cert_destroycertificate or seckey_destroyprivatekey, the function decrements the reference count and,...
..., ssl makes a shallow copy--that is, it increments the reference count for that object rather than making a whole new copy. when you call cert_destroycertificate or seckey_destroyprivatekey, the function decrements the reference count and, if the reference count reaches zero as a result, both frees the memory and sets all the bits to zero. the use of the word "destroy" in function names or in the
description of a function implies reference counting. never alter the contents of a certificate or key structure. if you attempt to do so, the change affects all the shallow copies of that structure and can cause severe problems. ...
JS::CallArgs
this article covers features introduced in spidermonkey 17 helper class encapsulating access to the callee, this value, arguments, and argument count for a function call. syntax js::callargs js::callargsfromvp(unsigned argc, js::value *vp); name type
description args unsigned number of argument. (2nd argument of jsnative) vp js::value * a pointer to the argument value array. (3nd argument of jsnative) methods methods of js::callargs method
description bool requireatleast(jscontext *cx, const char *fnname, unsigned required) returns true if there are at least required arguments passed in. if false, it reports an error message on the context. methods inherited from js::callargsbase method des...
...](unsigned i) const returns the i-th zero-indexed argument. js::handlevalue get(unsigned i) const returns the i-th zero-indexed argument, or undefined if there's no such argument. bool hasdefined(unsigned i) const returns true if the i-th zero-indexed argument is present and is not undefined. methods inherited from js::detail::callreceiverbase method
description jsobject &callee() const returns the function being called, as an object. must not be called after rval() has been used! js::handlevalue calleev() const returns the function being called, as a value. must not be called after rval() has been used! js::handlevalue thisv() const returns the this value passed to the function. this method must not be called when the...
...s been called, callee() and calleev() can no longer be used. (if you're compiling against a debug build of spidermonkey, these methods will assert to aid debugging.) if the method you're implementing succeeds by returning true, you *must* set this. (spidermonkey doesn't currently assert this, but it will do so eventually.) you don't need to use or change this if your method fails.
description js::callargs is helper class encapsulating access to the callee, this value, arguments, and argument count for a function call. the intent of js::callargs is that they be used to encapsulate access to the un-abstracted unsigned argc, value *vp arguments to a function. new code should use callargs instead of js_callee etc. whenever possible. the eventual plan is to change jsnative to take const...
JS::PersistentRooted
spidermonkey 31 a copyable, assignable global gc root type with arbitrary lifetime, an infallible constructor, and automatic unrooting on destruction. ...
... initial); name type
description cx jscontext * the context to get the runtime in which to add the root rt jsruntime * the runtime in which to add the root. initial t an initial value for the persistent rooted variable. methods here, ptr represents the private member of js::persistentrooted<t>, typed with t. method
description void init(jscontext* cx) initialize with optional initial value (if not provided, it will be initialized with the initial value of the type). added in spidermonkey 38 void init(jscontext* cx, t initial) void init(jsruntime* rt) void init(jsruntime* rt, t initial) void reset() reset the value to initial value of the type. added in spidermonkey 38 ...
... const t& operator->() const t* address() returns a pointer to ptr. const t* address() const persistentrooted<t>& operator=(const t& p) sets the value of ptr. persistentrooted<t>& operator=(const persistentrooted<t>& other) bool operator!=(const t& other) const compares ptr and other. bool operator==(const t& other) const
description js::persistentrooted<t> declares a variable of type t whose value is always rooted. this is typically used for global variables. js::persistentrooted<t> is a copyable, assignable global gc root type with arbitrary lifetime, an infallible constructor, and automatic unrooting on destruction. these roots can be used in heap-allocated data structures, so they are not associated with any particular...
JSErrorReport
if null, the error is local to the script in the current html page. lineno unsigned line number in the source that caused the error. column unsigned zero-based column index in line in the source that caused the error. ...
... the constant jsreport_error is 0 and can be used to indicate an error report without any of the above flags. errornumber unsigned the error number. ucmessage const char16_t * the default unicode error message. messageargs const char16_t ** arguments for the error message. exntype int16_t one of the jsexntype constants.
description jserrorreport describes a single error that occurs in the execution of script. in the event of an error, filename will either contain the name of the external source file or url containing the script (script src=) or null, indicating that a script embedded in the current html page caused the error. lineno indicates the line number of the script containing the error. in the case of an error in a s...
... variable of type jserrorreport and allocate a buffer to hold the text that generated the error condition. set linebuf to point at the buffer before your application executes a script. for unicode scripts, define a second buffer that holds the unicode version of the text the generated the error. for application that do not use unicode, set uclinebuf and uctokenptr to null. macros name
description jsreport_is_warning(flags) returns true if flags has jsreport_warning. jsreport_is_exception(flags) returns true if flags has jsreport_exception. jsreport_is_strict(flags) returns true if flags has jsreport_strict. jsreport_is_strict_mode_error(flags) returns true if flags has jsreport_strict_mode_error. see also mxr id search for jserrorrep...
JSObjectOps.getProperty
ooks; calling getters or setters; and actually getting, setting, or deleting the property once it is found. contrast jsclass.getproperty, jsclass.setproperty, and jsclass.delproperty, which are hooks called during property accesses and don't have to implement any of that. ...
...if getting or setting, the new value is returned in *vp on success. ...
...if getting or setting, the new value is returned in *vp on success. ...
JS_AddExternalStringFinalizer
obsolete since jsapi 13this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. register a custom string memory manager. syntax int js_addexternalstringfinalizer(jsstringfinalizeop finalizer); name type
description finalizer jsstringfinalizeop pointer to a callback function, described below. ...
...since the jsstringfinalizeop callback is called during garbage collection, it must avoid most jsapi functions. (is cx guaranteed to be non-null?) str jsstring * the string being finalized. ...
...ointer to the character buffer, which is the pointer which the application passed to js_newexternalstring() when creating the string. it is the callback's responsibility to free the memory. after this callback, the js engine will not use that memory anymore and will not keep a pointer to it. the callback may not keep a reference to this jsstring, as its memory is about to be freed.
description add a finalizer for external strings created by js_newexternalstring using a type-code returned from this function, and that understands how to free or release the memory pointed at by js_getstringchars(str). returns a nonnegative type index if there is room for finalizer in the global gc finalizers table, else returns -1. in a js_threadsafe build, this function must be invoked on the primordia...
JS_CompareStrings
if the strings are identical in content and length, js_comparestrings stores 0 in *result. ...
...if the strings are identical in content and length, js_comparestrings stores 0 in *result. if str1 is less than str2, *result is less than 0. ...
...if the strings are identical in content and length, js_comparestrings stores 0 in *result. if str1 is less than str2, *result is less than 0. if str1 is greater than str2, *result is greater than 0. on success the function returns js_true. ...
JS_CompileUCFunctionForPrincipalsVersion
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...equest on this jscontext. obj jsobject * principals jsprincipals * name const char * nargs unsigned int argnames const char ** chars const jschar * length size_t filename const char * lineno unsigned int version jsversion
description please provide a
description. see also please provide a
description. ...
JS_ConvertArguments
ries of js values, passed in an argument array, to their corresponding js types. syntax bool js_convertarguments(jscontext *cx, const js::callargs &args, const char *format, ...); // added in spidermonkey 31 bool js_convertarguments(jscontext *cx, unsigned argc, jsval *argv, const char *format, ...); // obsolete since jsapi 30 name type
description cx jscontext * the context in which to perform any necessary conversions. cx also affects the interpretation of format, if js_addargumentformatter has been called. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. args const js::callargs & reference to the arguments to convert. added in spidermonkey 31 ...
...e must be one pointer for each parameter described in format. variables for optional parameters must already be initialized, because if an optional parameter is not in argv, js_convertarguments does not modify the corresponding variable. the variables do not need to be rooted. (if conversion creates a new gc thing, the corresponding jsval is written back to argv, which is rooted.)
description js_convertarguments provides a convenient way to translate a series of js values into their corresponding js types with a single function call. it saves you from having to write separate tests and elaborate if...else statements in your function code to retrieve and translate multiple js values for use with your own functions. cx is the context for the call. argc indicates the number of js value...
...for the call. argc indicates the number of js values you are passing in for conversion. argv is a pointer to the array of js values to convert. format is a null-terminated c string. each element of the array indicates the c type into which to convert the next available js value. ...
JS_DefineFunctions
requires request. ...
...to be defined. fs const jsfunctionspec * a null-terminated array of function specifications. each element of the array defines an individual function. behavior propertydefinitionbehavior see below. ...
... fs is a pointer to the first element of an array of jsfunctionspec records. ...
JS_DumpNamedRoots
obsolete since jsapi 19this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. enumerate all the named roots in a runtime. syntax void js_dumpnamedroots(jsruntime *rt, void (*dump)(const char *name, void *rp, void *data), void *data); name type
description rt jsruntime * pointer to a jsruntime from which to dump named roots. dump void (*)(const char *, void *, void *) pointer to function that actually dumps the named roots. this may not be null. data void * a pointer that is passed to dump each time it is called. the javascript engine does not read from or write to this pointer at all. it is passed to the dump function...
...time from which to dump named roots. dump void (*)(const char *, void *, void *) pointer to function that actually dumps the named roots. this may not be null. data void * a pointer that is passed to dump each time it is called. the javascript engine does not read from or write to this pointer at all. it is passed to the dump function unchanged. it may be null.
description each call to js_addnamedroot creates a record in a table of named roots maintained by the garbage collector. js_dumpnamedroots provides a way for the application to access the contents of that table. it calls the dump function once for each named root in the given runtime rt. in pseudocode: /* pseudocode explanation of what js_dumpnamedroots does */ void js_dumpnamedroots(jsruntime *rt, dumpfn du...
...ime rt. in pseudocode: /* pseudocode explanation of what js_dumpnamedroots does */ void js_dumpnamedroots(jsruntime *rt, dumpfn dump, void *data) { for each (root in rt->namedroots) dump(root.name, root.address, data); } callback syntax dump is a pointer to a function provided by the application. when js_dumpnamedroots calls it, it passes three arguments: argument type
description name const char * the name of the named root. rp void * a pointer to the rooted variable, array element, or field. this is the pointer that the application passed to js_addnamedroot. it points to a variable, array element, or field of type jsval, jsobject *, jsstring *, or jsdouble *. data void * the data argument that the application passed to js_dump...
JS_GetCompartmentPrivate
it is especially useful for storing data needed by callbacks. ...
...it is especially useful for storing data needed by callbacks. ...
...it is especially useful for storing data needed by callbacks. ...
JS_GetGCParameter
on. syntax uint32_t js_getgcparameter(jsruntime *rt, jsgcparamkey key); void js_setgcparameter(jsruntime *rt, jsgcparamkey key, uint32_t value); uint32_t js_getgcparameterforthread(jscontext *cx, jsgcparamkey key); // added in spidermonkeysidebar 17 void js_setgcparameterforthread(jscontext *cx, jsgcparamkey key, uint32_t value); // added in spidermonkeysidebar 17 name type
description rt jsruntime * the runtime to configure. cx jscontext * the context to configure. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. key jsgcparamkey specifies which garbage collection parameter to get or set. value uint32_t (js_setgcparameter only) the value to assign to the parameter. ...
... jsgc_max_malloc_bytes / "maxmallocbytes" number of js_malloc bytes before last ditch gc. jsgc_max_nursery_bytes / "maxnurserybytes" maximum size the nursery may grow to, or 0 to disable generational gc. jsgc_min_nursery_bytes / "minnurserybytes" minimum size the nursery may shrin...
...ct groups to look for pretenuring candidates. jsgc_pretenure_group_threshold / "pretenuregroupthreshold" if more than this number of objects in a given object group are tenured, then pretenruing will be enabled for new objects in this group. jsgc_min_last_ditch_gc_period / "minlastditchgcperiod" the minimum time to allow between triggering last ditch gcs in seconds.
description js_getgcparameter returns the current parameter of the garbage collection. if successful, js_getgcparameter returns the current parameter. js_setgcparameter ajusts the parameter of the garbage collection. see also mxr id search for js_getgcparameter mxr id search for js_setgcparameter bug 474801 jsgc_bytes jsgc_number bug 474497 jsgc_max_code_cache_bytes this opti...
JS_GetLocaleCallbacks
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. callbacks jslocalecallbacks * pointer to a jslocalecallbacks struct. ...
... jslocaletolowercase implementation of string.prototype.tolocalelowercase() function. jslocalecompare implementation of string.prototype.localecompare() function. if expose_intl_api is defined, intl api is used instead. jslocaletounicode convert locale specific strin...
...se implementation of string.prototype.tolocaleuppercase() function. jslocaletolowercase implementation of string.prototype.tolocalelowercase() function. jslocalecompare implementation of string.prototype.localecompare() function. if expose_intl_api is defined, intl api is used instead. jslocaletounicode convert locale specific string to unicode string.
description js_setlocalecallbacks establishes locale callbacks. the pointer must persist as long as the jsruntime. passing nullptr restores the default behaviour. js_getlocalecallbacks returns the address of the current locale callbacks struct, which may be nullptr. see also mxr id search for js_getlocalecallbacks mxr id search for js_setlocalecallbacks mxr id search for jslocalecallbacks mxr id search ...
JS_GetOwnPropertyDescriptor
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the property. id const char * or js::handleid or const char16_t the name of the property to look up. desc js::mutablehandle<jspropertydescriptor> out parameter. on s...
...st be in a request on this jscontext. obj js::handleobject the object to search for the property. id const char * or js::handleid or const char16_t the name of the property to look up. desc js::mutablehandle<jspropertydescriptor> out parameter. on success, if no property is found, desc->obj is set to null. if a property is found, *desc receives a
description of it.
description js_getownpropertydescriptor and js_getownpropertydescriptorbyid get a detailed
description of that property (returned in desc->obj). if desc->obj is null, then this property was not found on the prototype chain. see also mxr id search for js_getownpropertydescriptor mxr id search for js_getownpropertydescriptorbyid mxr id search for js_getownucpropertydescriptor ...
JS_GetPropertyDescriptor
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the property. ...
... that property. syntax bool js_getpropertydescriptor(jscontext *cx, js::handleobject obj, const char *name, js::mutablehandle<jspropertydescriptor> desc); // added in spidermonkey 31 bool js_getpropertydescriptorbyid(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandle<jspropertydescriptor> desc); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the property. id const char * or js::handleid the name of the property to look up. desc js::mutablehandle<jspropertydescriptor> out parameter. on success, if no prop...
...ild, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the property. id const char * or js::handleid the name of the property to look up. desc js::mutablehandle<jspropertydescriptor> out parameter. on success, if no property is found, desc->obj is set to null. if a property is found, *desc receives a
description of it.
description js_getpropertydescriptor and js_getpropertydescriptorbyid find a specified property of an object and gets a detailed
description of that property on the prototype chain (returned in desc->obj). if desc->obj is null, then this property was not found on the prototype chain. see also mxr id search for js_getpropertydescriptor mxr id search for js_getpropertydescriptorbyid...
JS_ReportErrorNumber
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. flags unsigned error report flags. errorcallback jserrorcallback callback to fetch the error message. userref void * a pointer to application data. the javascript engine passes this point...
..._reporterrornumber or js_reporterrorflagsandnumber, or char16_t * for js_reporterrornumberuc or js_reporterrorflagsandnumberuc. the number of additional arguments required depends on the error message, which is determined by the errorcallback. ...
...ermined by the errorcallback. callback syntax typedef const jserrorformatstring * (* jserrorcallback)(void *userref, const unsigned errornumber); name type
description userref void * the userref pointer that was passed to the reporterrornumber api. errornumber const unsigned the errornumber that was passed to the reporterrornumber api.
description these functions create a jserrorreport, populate it with an error message obtained from the given jserrorcallback, and either report it to the current error reporter callback or create an error object and set it as the pending exception. first errorcallback(userref, errornumber) is called. if errorcallback returns null, (??? what happens?). otherwise, if the jserrorformatstring returned by the js...
JS_SetFunctionCallback
lers since it works across all run modes (interpreter, method jit, trace jit). using this function may have a significant performance impact. see function tracing for an example. note: this method is only available if moz_trace_jscalls was defined at compile time using --enable-trace-jscalls. syntax void js_setfunctioncallback(jscontext *cx, jsfunctioncallback fcb); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. fcb jsfunctioncallback the callback to execute when javascript functions are invoked and exited. specify null to stop calling the current callback. the callback must not modify the current stat...
... jscontext. fcb jsfunctioncallback the callback to execute when javascript functions are invoked and exited. specify null to stop calling the current callback. the callback must not modify the current state of execution. the call stack cannot be relied upon, because this callback may be invoked from the jit code when the stack frame and context are in an indeterminate state.
description js_setfunctioncallback sets a c function to be called each time a javascript function is invoked or exits. fcb is a pointer to the c function to call. note that debuggers should probably use js_setcallhook in preference to this function, because it is invoked when the javascript stack is guaranteed to be in a consistent state (and therefore it is valid to inspect and modify local variables, ge...
... scr const jsscript * the script being executed. cx jscontext * the javascript context in which the script is being run. entering int true if the callback is being called because the specified function is being invoked or false if the function is exiting. see a...
JS_SetOperationCallback
vascript code runs. these methods/types are renamed to js_setinterruptcallback, js_getinterruptcallback, js_requestinterruptcallback and jsinterruptcallback in spidermonkey 30. ...
... the callback may use this context to call jsapi functions, but it should first use js_setoperationcallback to set the context's operation callback to null. ...
...s operation callback to null. otherwise the engine may call the operation callback again, reentering it. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). applications must not use both the operation callback api and the older branch callback api.
description these functions allow setting an operation callback that will be called from the js thread some time after any thread triggered the callback using js_triggeroperationcallback. to schedule the gc and for other activities the engine internally triggers operation callbacks. the embedding should thus not rely on callbacks being triggered through the external api only. important note: additional c...
JS_TracerInit
se is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8 note: in jsapi 12, the macro js_tracer_init has been replaced by the function js_tracerinit initialize a jstracer for object graph tracing. syntax void js_tracerinit(jstracer *trc, jsruntime *rt, jstracecallback callback); name type
description trc jstracer * the tracer to be initialized. cx jscontext * the context in which to perform tracing. callback jstracecallback a callback, described below, which the tracing apis will call each time a pointer is found from one gc thing to another. callback syntax typedef void (*jstracecallback)(jstracer *trc, void *thing, uint32 kind); n...
... jstracer * the tracer to be initialized. cx jscontext * the context in which to perform tracing. callback jstracecallback a callback, described below, which the tracing apis will call each time a pointer is found from one gc thing to another. callback syntax typedef void (*jstracecallback)(jstracer *trc, void *thing, uint32 kind); name type
description trc jstracer * the tracer visiting obj. thing void * a gc thing. kind uint32 one of the constants jstrace_object, jstrace_double, jstrace_string; or a tag denoting an internal implementation-specific traversal kind. in the latter case, the only operations the callback may perform on thing are to call js_tracechildren or the debug-only js_printtracethin...
...cer * the tracer visiting obj. thing void * a gc thing. kind uint32 one of the constants jstrace_object, jstrace_double, jstrace_string; or a tag denoting an internal implementation-specific traversal kind. in the latter case, the only operations the callback may perform on thing are to call js_tracechildren or the debug-only js_printtracethinginfo function.
description js_tracechildren and other tracing apis call the tracer callback for each traceable thing directly referenced by a particular object or runtime structure. it is the callback's responsibility to ensure the traversal of the full object graph, if desired, by eventually calling js_tracechildren on the passed thing. in this case the callback must be prepared to deal with cycles in the traversal graph.
mozIStorageConnection
this will be false if the connection failed to open, or it has been closed. read only. databasefile nsifile the current database nsifile. null if the database connection refers to an in-memory database. read only. lasterror long the last sqlite error code that occurred. read ...
...emaversion long the schema version of the database. this should not be used until the database is ready. the version will be reported as 0 if it is not set. transactioninprogress boolean returns true if there is a transaction in progress on the database. otherwise returns false. read only. constants transaction execution time constants. ...
...this is used by the storage api when creating new databases, and must match the sqlite_default_page_size configured in db/sqlite3/src/makefile.in. ...
nsIAccessible
accessible.takefocus() and nsiaccessible.focusedchild. to select an accessible you can use nsiaccessible.setselected(), nsiaccessible.takeselection() and nsiaccessible.extendselection(). actions you can prepare actions on some accessibles (for example on button accessible). the following methods are intended for this nsiaccessible.actioncount, nsiaccessible.getactionname(), nsiaccessible.getaction
description() and nsiaccessible.doaction().
descriptions nsiaccessible.
description and nsiaccessible.help provides additional text information about accessible. attributes many accessibles exposes attributes to provide more details that cannot be fit into existing api methods, please refer to attributes documentation for more information. you can use nsiaccessible.attributes to get a map of attributes. keybo...
...selection this method extends the current selection from its current accessible anchor node to this accessible. takeselection this method selects this accessible node only. takefocus this method focuses this accessible node. getactionname this method retrieves the name of the accessible action at the given zero-based index. getaction
description this method retrieves the
description of the accessible action at the given zero-based index. doaction this method performs the accessible action at the given zero-based index. action number 0 is the default action. attributes parent parent node in accessible tree. nextsibling next sibling in accessible tree. previoussibling p...
...parent the 0-based index of this accessible in its parent's list of children, or -1 if this accessible does not have a parent. name accessible name -- the main text equivalent for this node. value accessible value -- a number or a secondary text equivalent for this node. widgets that use role attribute can force a value using the valuenow attribute.
description accessible
description -- long text associated with this node. keyboardshortcut provides localized string of accesskey name, such as alt+d. the modifier may be affected by user and platform preferences. usually alt+letter, or just the letter alone for menu items. defaultkeybinding provides localized string of global keyboard accelerator for default action, s...
nsIAccessibleProvider
accessible/public/nsiaccessibleprovider.idlscriptable used to link element and accessible object. for that xbl binding, element should implement the interface. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type
description accessible nsiaccessible read only. obsolete since gecko 1.9 accessibletype long value representing the type of accessible object. see constants for details. read only. constants common use constants constant value
description noaccessible 0 do not create an accessible for this object this is useful if an ancestor binding already implements nsiaccessibleprovider, but no accessible is desired for the inheriting binding. outerdoc 0x00000001 for elements that spawn a new document. for example now it is used by <...
...t value
description noaccessible 0 do not create an accessible for this object this is useful if an ancestor binding already implements nsiaccessibleprovider, but no accessible is desired for the inheriting binding. outerdoc 0x00000001 for elements that spawn a new document. for example now it is used by <xul:iframe>, <xul:browser> and <xul:editor>. ...
...ollection of tab objects, usable in the tabbox and independent of as well. xultext 0x0000101a xultextbox 0x0000101b xulthumb 0x0000101c xultree 0x0000101d xultreecolumns 0x0000101e xultreecolumnitem 0x0000101f xultoolbar 0x00001020 xultoolbarseparator 0x00001021 xultooltip 0x00001022 xultoolbarbutton 0x00001023 xforms elements constants constant value
description xformscontainer 0x00002000 used for xforms elements that provide accessible object for itself as well for anonymous content. this property is used for upload, input[type="xsd:gday"] and input[type="xsd:gmonth"] xformslabel 0x00002001 used for label element. xformsouput 0x00002002 used for output element. xformstrigger 0x00002003 used for trigger and submit elements. xformsinput 0x000020...
nsIAccessibleStates
accessible/public/nsiaccessiblestates.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) prior to gecko 1.9, these constants were implemented in nsiaccessible. constants state constants msaa state flags - used for bitfield. more than 1 allowed. constant value
description state_unavailable 0x00000001 the object is unavailable, that is disabled. state_selected 0x00000002 the object is selected, that is it indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that has been selected. state_focused 0x00000004 the object is focused. state_pressed 0x00000008 the object is pressed. state_chec...
...le 0x00020000 the object can be resized. for example, a user could change the size of a window by clicking the border with a mouse and dragging the mouse. state_moveable 0x00040000 the object can be moved. for example, a user can click on the titlebar for the object and drag the object to a new location. state_selfvoicing 0x00080000 the object or child uses text-to-speech (tts) technology for
description purposes. a speech-based accessibility aid does not announce information when an object with this state has the focus because the object automatically announces information. currently unused. state_focusable 0x00100000 the object can be focused. state_selectable 0x00200000 the object can be selected. state_linked 0x00400000 the object is formatted as a hyperlink. the object role will usuall...
... role* atk_role_passwd_text, nothing for java? state_haspopup 0x40000000 new in msaa 2.0. state_required state_alert_low state_important state_alert_medium currently unused. state_invalid state_alert_high indicates a validation failure. state_checkable state_marqueed extended state constants extended state flags (for now non-msaa, for java and gnome/atk support) constant value
description ext_state_supports_autocompletion 0x00000001 for editable areas that have any kind of auto completion. ext_state_defunct 0x00000002 object no longer exists. ext_state_selectable_text 0x00000004 for text which is selectable, object must implement nsiaccessibletext. ext_state_editable 0x00000008 implements nsiaccessibleeditabletext. ext_state_active 0x00000010 this window is currently the...
nsIAccessibleText
g endoffset); void removeselection(in long selectionnum); void scrollsubstringto(in long startindex, in long endindex, in unsigned long scrolltype); void scrollsubstringtopoint(in long startindex, in long endindex, in unsigned long coordinatetype, in long x, in long y); void setselectionbounds(in long selectionnum, in long startoffset, in long endoffset); attributes attribute type
description caretoffset long the current current caret offset. if set < 0 then caret will be placed at the end of the text. charactercount long read only. defaulttextattributes nsipersistentproperties return the text attributes that apply to the entire accessible. read only. selectioncount long read only. constants text offset constants constant value
description text_offset_end_of_text -1 ...
... boundary_sentence_end 4 do not use in new code. ...
...do not use in new code. boundary_sentence_end 4 do not use in new code. boundary_line_start 5 boundary_line_end 6 boundary_attribute_range 7 coordinate type constants obsolete since gecko 1.9 (firefox 3)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. constant value
description coord_type_screen 0 coord_type_window 1 methods addselection() void addselection( in long startoffset, in long endoffset ); parameters startoffset endoffset getattributerange() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) get the accessible and start/end offsets around the given offset. this accessible get return the dom ...
nsIAppStartup
this can be used, for example, when doing performance testing of the startup process to discount numbers for tests that were interrupted by a user prompt. nativeappsupport nsinativeappsupport getter for "native application support." read only. obsolete since gecko 1.9.1 ...
...ppsupport getter for "native application support." read only. obsolete since gecko 1.9.1 constants the following flags may be passed as the amode parameter to the quit() method. one and only one of the "quit" flags must be specified. the erestart flag may be bit-wise combined with one of the "quit" flags to cause the application to restart after it quits. constant value
description econsiderquit 0x01 attempt to quit if all windows are closed. eattemptquit 0x02 try to close all windows, then quit if successful. eforcequit 0x03 force all windows to close, then quit. erestart 0x10 restart the application after quitting. the application will be restarted with the same profile and an empty command line. erestar...
...xitlastwindowclosingsurvivalarea(); parameters none. getstartupinfo() returns a javascript object with events from startup and the timestamps indicating when they occurred. parameters none. return value a javascript object with the following fields. keys are the event names and their values are the times. events that didn't occur are not in the object. event identifier (key)
description main time at which main application core was loaded. note: only available with libxul builds. firstpaint time the first paint occurred. note: only available with libxul builds. sessionrestored time session restore finished. example this example logs startup time information to the console. var aconsoleservice = compone...
nsIApplicationCache
read only. clientid acstring the client id for this application cache. clients can open a session with nsicacheservice.createsession() using this client id and a storage policy of store_offline to access this cache. read only. groupid acstring the group id for this cache group. this is the uri of the cache...
... application cache. clients can open a session with nsicacheservice.createsession() using this client id and a storage policy of store_offline to access this cache. read only. groupid acstring the group id for this cache group. this is the uri of the cache manifest file. read only. usage unsigned long the disk usage of the application cache, in bytes. read only. constants constant value
description item_manifest 1 this item is the application manifest. item_explicit 2 this item was explicitly listed in the application manifest. item_implicit 4 this item was navigated to in a top level browsing context, and named this cache's group as its manifest. item_dynamic 8 this item was added to the cache using the dynamic scripting api. item_foreign 16 this item was listed in the applicatio...
...trieve. return value a bit field indicating the entry's types. see constants for a list of types. initashandle() init this application cache instance to just hold the group id and the client id to work just as a handle to the real cache. used on content process to simplify the application cache code. void initashandle( in acstring groupid, in acstring clientid ); parameters groupid missing
description clientid missing
description markentry() adds item types to a given entry. void markentry( in acstring key, in unsigned long typebits ); parameters key the key for the cache entry to which to add types. typebits a bit field indicating the types to add to the entry. see constants for a list of types. unmarkentry() removes types from a given entry. if the resulting entry has no types left, ...
nsICacheDeviceInfo
read only. entrycount unsigned long get the number of stored cache entries. read only. maximumsize unsigned long get the upper limit of the size of the data the cache can store. read only. ...
...read only. entrycount unsigned long get the number of stored cache entries. read only. maximumsize unsigned long get the upper limit of the size of the data the cache can store. read only. ...
...read only. entrycount unsigned long get the number of stored cache entries. read only. maximumsize unsigned long get the upper limit of the size of the data the cache can store. read only. ...
nsIDOMFontFace
t changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) this object describes a single font. it's returned in a list you can get using inidomutils.getusedfontfaces(). attributes font source attributes these attributes indicate how the font was found during the font matching process. note: the same physical font may have been found in multiple ways within a range. attribute type
description fromfontgroup boolean indicates whether or not the font was located in a font group. read only. fromlanguageprefs boolean indicates whether or not the font was located using language preferences. read only. fromsystemfallback boolean indicates whether or not the font is the system fallback font. read only. attributes available for all fonts these attributes are always available. attri...
...tgroup boolean indicates whether or not the font was located in a font group. read only. fromlanguageprefs boolean indicates whether or not the font was located using language preferences. read only. fromsystemfallback boolean indicates whether or not the font is the system fallback font. read only. attributes available for all fonts these attributes are always available. attribute type
description cssfamilyname domstring a family name that could be used in css font-family (not necessarily the actual name that was used, due to aliases, generics, localized names, and so on). read only. name domstring full font name as obtained from the font resource. read only. attributes only available when specified with @font-face these attributes only have meaningful values when the font is a user...
...d be used in css font-family (not necessarily the actual name that was used, due to aliases, generics, localized names, and so on). read only. name domstring full font name as obtained from the font resource. read only. attributes only available when specified with @font-face these attributes only have meaningful values when the font is a user font defined using @font-face. attribute type
description format domstring the font format. read only. localname domstring null if not a src:local(...) rule. read only. metadata domstring xml metadata from woff file(if any). read only. rule nsidomcssfontfacerule null if no associated @font-face rule. read only. srcindex long index in the rule's src list, -1 if no @font-face rule. read only. uri domstring null if not a downloaded font, that i...
nsIDownloadManager
read only. activedownloads nsisimpleenumerator an enumeration of active nsidownloads. read only. cancleanup boolean whether or not there are downloads that can be cleaned up (removed) that is downloads that have completed, have failed or have been canceled. read only. dat...
...ation for files: 0: files are downloaded to the desktop by default. 1: files are downloaded to the system's downloads folder by default. 2: files are downloaded to the local path specified by the browser.download.dir preference. if this preference is invalid, the download directory falls back to the default. read only. constants constant value
description download_notstarted -1 the download has not been started yet. download_downloading 0 the download is in the process of being downloaded. download_finished 1 download completed including any processing of the target file. download_failed 2 the download failed due to error. download_canceled 3 the user canceled the download.
...ile, in nsicancelable acancelable, in boolean aisprivate ); parameters adownloadtype the download type for the transfer. should always be set to nsidownloadmanager.download_type_download (that is, zero). asource the source uri of the transfer. must not be null. atarget the uri indicating where the transferred file should be stored. must not be null. adisplayname a user-readable
description of the transfer. may be an empty string. amimeinfo the mime information associated with the target; this may include mime type and helper application when appropriate. this parameter is optional. astarttime the time at which the download began. atempfile the location of a temporary file (a file in which the received data will be stored but is not equal to the target file). the file will be ...
nsIFeed
interface represents a single atom or rss (really simple syndication) news feed. it includes attributes that provide information about the feed, as well as access to the items or entries in the feed. 1.0 66 introduced gecko 1.8 inherits from: nsifeedcontainer last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type
description cloud nsiwritablepropertybag2 the cloud element on a feed is used to identify the api endpoint of an rsscloud ping server, which distributes notifications of changes to this feed. enclosurecount long indicates the number of enclosures associated with a feed. generator nsifeedgenerator describes the software that produced a feed. image nsiwr...
...is rarely implemented. skiphours nsiarray an array of the hours of the day during which the feed should not be fetched. the hours are represented as integer values from 0 (midnight) to 23 (11:00 pm), and are always indicated using utc. note: this field is rarely implemented. subtitle nsifeedtextconstruct returns a subtitle for the feed, based on its
description, subtitle, and appropriate extensions. textinput nsiwritablepropertybag2 information about a text box that can be displayed along with the feed by aggregators that support it, to allow the reader to send a response back to the source of the feed. note: this field is almost never used, and is incompatible with many aggregators. type unsigned long indicat...
...ce of the feed. note: this field is almost never used, and is incompatible with many aggregators. type unsigned long indicates the type of content presented by a feed. see constants. note: you should consider this a bit mask of values; at some point, the type may include more than one of these values ored together. read only. constants constant value
description type_feed 0 a standard text-based feed. type_audio 1 an audio feed, such as a podcast. type_image 2 an image feed, such as a photocast. type_video 4 a video feed, such as a videocast. see also nsifeedcontainer ...
Building an Account Manager Extension
e following code to the previous. the javascript file has to be saved either in the extension's or thunderbird's component directory. // define the contract information needed for this component... // ... the unique component identifier (change it if you copied this example!)... devmoaccountmanagerextension.prototype.classid = components.id("{659ce960-9dfb-11dd-ad8b-0800200c9a55}"); // ... the
description and ... devmoaccountmanagerextension.prototype.class
description = "devmo account manager extension"; // ... textual unique identifier or rendez-vous point in the category manager. devmoaccountmanagerextension.prototype.contractid = "@mozilla.org/accountmanager/extension;1?name=example@mozilla.org"; // add the component to the mailnews-accountmanager-extensions category devmoaccountmanagerextens...
...as our account manager extension is named "devmo-account", we are required to include a property named prefpanel-devmo-account. prefpanel-devmo-account=devmo demo panel step4: the new panel and java...
...per/there.is.only.xul" onload="parent.onpanelloaded('am-devmo-account.xul');"> <script type="application/javascript" src="chrome://messenger/content/accountmanager.js"/> <script type="application/javascript" src="chrome://example@mozilla.org/content/am-devmo-account.js"/> <dialogheader title="devmo example panel"/> <
description> this panel is only shown in imap accounts... </
description> <vbox flex = "1"/> </page> as with the xul page, the content of the property file relies on a very strict naming. as our account manager extension is named "devmo-account", we are required to include a property named prefpanel-devmo-account. prefpanel-devmo-account=devmo demo panel step4: the new panel and javascript the javascript for an account manager panel needs to imp...
nsINavHistoryContainerResultNode
toolkit/components/places/public/nsinavhistoryservice.idlscriptable a foundation for the interfaces that provide a
description of a query result on the places service that describes a container (which is any kind of grouping, including bookmark folders). ...
...read only. childrenreadonly boolean false if the node's list of children can be modified (by adding or removing children, or rearranging them), or true if the user interface should not allow the list of children to be altered. read-only. this is false for bo...
...y. the container may be a result_type_remote_container node that has been dynamically generated by the remote container api, or a bookmark folder (result_type_folder) for which some service (such as livemarks) has registered to provide certain operations. state unsigned short the current state of the container. this is one of the state constants. constants state constants constant value
description state_closed 0 the container is closed. state_loading 1 the container has been opened asynchronously, but is still loading and is not all the way opened yet. state_opened 2 the container is open. methods findnodebydetails() returns a node matching specified details. nsinavhistoryresultnode findnodebydetails( in autf8string auristring, in prtime atime, in long long aitemid, ...
nsINavHistoryQuery
absoluteendtime prtime read only: retrieves the end time value that the currently loaded reference points + offset resolve to. annotation autf8string the annotation name. annotationisnot boolean test for existance or non-existance of a given annotation. we don...
...d a given uri. use uriisprefix to control whether this is an exact match. uriisprefix boolean controls the interpretation of uri. when unset (default), the uri will request an exact match of the specified uri. when set, any history entry beginning in uri will match. for example http://bar.com/foo will match http://bar.com/foo as well as http://bar.com/foo/baz.gif. constants constant value
description time_relative_epoch 0 default value. the time is relative to jan 1 1970 gmt, (this is a normal prtime). as a special case, a 0 time relative to time_relative_epoch indicates that the time is not part of the query. this is the default, so an empty query will match any time. time_relative_today 1 the time is relative to this morning at midnight. normally used for queries relative to today. for ...
...ery item with the same parameters of this one. nsinavhistoryquery clone(); parameters none. return value returns the newly created cloned query. gettransitions() get the transitions set for this query. void gettransitions( out unsigned long count, optional [retval,array,size_is(count)] out unsigned long transitions ); parameters count optional the number of transitions transitions missing
description settransitions() when the set of transitions is nonempty, results are limited to pages which have at least one visit for each of the transition types. limit results to the specified list of transition types. void settransitions( [const,array, size_is(count)] in unsigned long transitions, in unsigned long count ); parameters transitions missing
description. count the number of transitions. ...
nsIPermissionManager
it should not be used by consumers. allow_action 1 permission is allowed. ...
...rmission(in nsiuri uri, in string type); pruint32 testpermissionfromprincipal(in nsiprincipal principal, in string type); attributes attribute type
description enumerator nsisimpleenumerator enumerates all stored permissions. allows access to nsipermission objects. read only. constants permission type constants constant value
description unknown_action 0 default permission when no entry is found for a host. it should not be used by consumers. allow_action 1 permission is allowed. ...
... expire_session 1 permission expires at end of session. expire_time 2 permission expires at a specified time. methods add() add permission information and permission type for a given uri. if the permission already exists for a given type, it will be modified. ...
nsIScreen
read only. pixeldepth long the screen's pixel depth; this is the number of bits used to represent a pixel. read only. rotation unsigned long the screen's current rotation; you may set this to any of the values listed in screen rotation constants. this will o...
...nstants. this will only have an effect on platforms that support screen rotation. gecko 1.9.2 note starting in gecko 1.9.2, gecko running on microsoft windows reports 24 bits per pixel instead of 32 bits per pixel on 8-bits per color component displays, since this is typically what the caller is actually looking for. ...
... rotation_90_deg 1 90° of rotation. rotation_180_deg 2 180° of rotation. rotation_270_deg 3 270° of rotation. methods getavailrect() returns a rectangle indicating the portion of the screen that is available for use. ...
nsITelemetry
this is true if the fhr data reporting service or the self-support service is enabled. canrecordextended boolean a flag indicating if telemetry is allowed to record extended data. returns false if the user has not opted into "extended telemetry" on the release channel, when the u...
...istogram_exponential or histogram_linear counts - an array representing the values of buckets in the histogram. ranges - an array with corresponding bucket sizes. sum - sum of the counts array. static - true for histograms defined in histograms.json, false for ones defined with newhistogram(). read only. constants histogram types constant value
description histogram_exponential 0 buckets increase exponentially. histogram_linear 1 buckets increase linearly. histogram_boolean 2 for storing 0/1 values. histogram_flag 3 for storing a single value; its count is always == 1. histogram_count 4 for storing counter values without bucketing. histogram_categorical 5 f...
..._linear 1 buckets increase linearly. histogram_boolean 2 for storing 0/1 values. histogram_flag 3 for storing a single value; its count is always == 1. histogram_count 4 for storing counter values without bucketing. histogram_categorical 5 for storing enumerated values by label. scalar types constant value
description scalar_type_count 0 for storing a numeric value. scalar_type_string 1 for storing a string value. scalar_type_boolean 2 for storing a boolean value. dataset types constant value
description dataset_release_channel_optout 0 the basic dataset that is on-by-default on all channels. dataset_release_cha...
nsIWebNavigation
load_flags_none 0 this is the default value for the load flags parameter. load_flags_is_refresh 16 this flag specifies that the load should have the semantics of an html meta-refresh tag (that is, that the cache should be bypassed). this flag is only applicable to loaduri.
...etting incorrectly can cause us to assume that nothing was actually loaded in this object if the load ends up being handled by an external application. load_flags_allow_popups 32768 this flag specifies that the load should not be subject to popup blocking checks. note for valid load flag combinations look here nsdocshellloadtypes.h stop flags constant value
description stop_network 1 this flag specifies that all network activity should be stopped. this includes both active network loads and pending meta-refreshes. stop_content 2 this flag specifies that all content activity should be stopped. this includes animated images, plugins and pending javascript timeouts. stop_all 3 this flag specifies that all activity shoul...
...work activity should be stopped. this includes both active network loads and pending meta-refreshes. stop_content 2 this flag specifies that all content activity should be stopped. this includes animated images, plugins and pending javascript timeouts. stop_all 3 this flag specifies that all activity should be stopped. attributes attribute type
description cangoback prbool indicates if the object can go back. if true this indicates that there is back session history available for navigation. read only. cangoforward prbool indicates if the object can go forward. if true this indicates that there is forward session history available for navigation. read only. currenturi nsiuri the currently loaded uri or ...
nsIWebProgress
hildren of that nsiwebprogress instance. uriloader/base/nsiwebprogress.idlscriptable please add a summary to this article. last changed in gecko 1.8.0 inherits from: nsisupports method overview void addprogresslistener(in nsiwebprogresslistener alistener, in unsigned long anotifymask); void removeprogresslistener(in nsiwebprogresslistener alistener); attributes attribute type
description domwindow nsidomwindow the dom window associated with this nsiwebprogress instance. read only. exceptions thrown ns_error_failure indicates that there is no associated dom window. isloadingdocument prbool indicates whether or not a document is currently being loaded in the context of this nsiwebprogress instance. read only. constants the following flags may be combined to form the anoti...
...d in the context of this nsiwebprogress instance. read only. constants the following flags may be combined to form the anotifymask parameter for the addprogresslistener() method. they limit the set of events that are delivered to an nsiwebprogresslistener instance. these flags indicate the state transistions to observe, corresponding to nsiwebprogresslistener.onstatechange(). constant value
description notify_state_request 0x00000001 only receive the nsiwebprogresslistener.onstatechange() event if the astateflags parameter includes nsiwebprogresslistener::state_is_request. notify_state_document 0x00000002 only receive the nsiwebprogresslistener.onstatechange() event if the astateflags parameter includes nsiwebprogresslistener::state_is_document. notify_state_network 0x00000004 only receiv...
...state_window 0x00000008 only receive the nsiwebprogresslistener.onstatechange() event if the astateflags parameter includes nsiwebprogresslistener::state_is_window. notify_state_all 0x0000000f receive all nsiwebprogresslistener.onstatechange() events. these flags indicate the other events to observe, corresponding to the other four methods defined on nsiwebprogresslistener. constant value
description notify_progress 0x00000010 receive nsiwebprogresslistener.onprogresschange() events. notify_status 0x00000020 receive nsiwebprogresslistener.onstatuschange() events. notify_security 0x00000040 receive nsiwebprogresslistener.onsecuritychange() events. notify_location 0x00000080 receive nsiwebprogresslistener.onlocationchange() events. notify_refresh 0x00000100 receive nsiwebprogressliste...
Index
a list of partner providers. if the user already has an email account, the user can switch to the original account setup wizard. 3 account examples extensions, thunderbird this article provides examples on accessing and manipulating thunderbird accounts. account interfaces provides an overview of the related interfaces. see an overview of thunderbird components for a general
description of the thunderbird user interface and related programmatic interfaces. 4 account interfaces code snippets, extension development, thunderbird this page contains a list of the interfaces that you'll will most likely use when writing extensions that work with email or other accounts. see account examples for examples and code snippets. 5 activity manager thunderb...
...ook can be found here. address book examples show how to perform various tasks and provide code snippets. 8 address book examples mailnews, seamonkey, thunderbird this article provides examples on accessing and manipulating thunderbird address books. address book interfaces provides an overview of the related interfaces. see an overview of thunderbird components for a general
description of the thunderbird user interface and related programmatic interfaces. 9 address book sync client design by richard h. pizzarro <rhp@netscape.com> 10 autoconfiguration in thunderbird administration, enterprise author: ben bucksch please do not change this document without consulting the author 11 autoconfig file format no summary! ...
...benefit from your work. also, you will see that there are many topics for which there is a question, but no answer. please help by adding an answer! (adding another question helps too!) 91 activity manager examples the activity manager is a simple component that understands how to display a combination of user activity and history. see the activity manager page for a general
description of the component. see the activity manager interfaces page for an overview of the related interfaces. 92 /common_thunderbird_extension_techniques">common thunderbird extension techniques thunderbird no summary! 93 access stringbundle from overlay thunderbird no summary! 94 access thunderbird window areas thunderbird to access particul...
Using COM from js-ctypes
pvoice->speak(l"hello, firefox!", spf_default, null); pvoice->release(); } } // msdn documentation says that even if coinitalize fails, counitialize // must be called couninitialize(); return 0; } to run the code, save it as test.cpp, and run following command in the directory (needs visual studio). $ cl ole32.lib test.cpp vtable needs vtable
description here. the order of the vtable is very critical. when used from c or js-ctypes, the order of the vtable methods should match the order of the c++ vtable. __stdcall and __cdecl needs __stdcall and __cdecl (callback_abi)
description here. call by reference needs c++ reference (&) and c pointer (*)
description here. converted c code now we can translate whole code into c syntax. #include...
...>speak(pvoice, l"hello, firefox!", 0, null); pvoice->lpvtbl->release(pvoice); } } // msdn documentation says that even if coinitalize fails, counitialize // must be called couninitialize(); return 0; } to run the code, save it as test.c, and run following command in the directory. $ cl ole32.lib test.c c code with pseudo struct needs pseudo struct
description here. #include <sapi.h> struct myispvoicevtbl; struct myispvoice { struct myispvoicevtbl* lpvtbl; }; struct myispvoicevtbl { /* start inherit from iunknown */ void* queryinterface; void* addref; ulong (__stdcall *release)(struct myispvoice*); /* end inherit from iunknown */ /* start inherit from ispnotifysource */ void* setnotifysink; void* setnotifywindowme...
...l); pvoice->lpvtbl->release(pvoice); } } // msdn documentation says that even if coinitalize fails, counitialize // must be called couninitialize(); return 0; } converting c code to js-ctypes code now we have working c code. it could be converted into js-ctypes in almost straightforward way. clsid and iid needs clsid and iid of spvoice and ispvoice
description here. com types and functions needs com types (guid) and functions (coinitialize etc)
description here. converted js-ctypes code here's converted code. this example uses busy loop and thus firefox won't respond until the speaking is done. if this code were used in a production add-on, then to avoid firefox locking up, run this code from a chromeworker. let { ctypes } = components.utils.
ArrayType
ength is unspecified. return value a ctype represents the newly declared array type. exceptions thrown typeerror type is not a ctype, or type.size is undefined.if the length is specifed but if it is not a valid one,then it is also thrown rangeerror the size of the resulting array can't be represented as both a size_t and as a javascript number. ...
...read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, this is simply the string that was passed to the constructor. for other function, pointer, and array types, this should be a valid c type expression. ...
...d_arraytype and unsized_arraytype are arraytype ctype. parameters length the number of entries the array type should be able to contain. only for unsized arraytype. return value a cdata representing the newly allocated array. exceptions thrown typeerror length is not provided for unsized array, or is provided for sized array. arraytype cdata properties property type
description length number the length of the array. read only. in addition, each element in the array can be referenced by index using standard bracket notation, such as myarray[index]. properties inherited from cdata property type
description constructor ctype the data type of the cdata object, as a ctype. read only. note: this is never ctypes.v...
PointerType
s. this can be any ctype object to declare the new type as a pointer to that type. return value a ctype object describing the newly created data type. exceptions thrown typeerror thrown if the parameter isn't a ctype. examples creating a type "pointer to 32-bit integer" looks like this: var intptrtype = new ctypes.pointertype(ctypes.int32_t); properties property type
description targettype ctype the type of object the pointer points to. read only. properties inherited from ctype these properties are available on all ctype objects. property type
description name string the type's name. read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, th...
...y. note: ctypes.void_t.size is undefined. method overview methods inherited from ctype ctype array([n]) string tosource() string tostring() pointertype cdata syntax cdata pointertype(); pointertype is pointertype ctype. return value a cdata representing the newly allocated pointer. ...
...read only. note: this is never ctypes.void_t or an array type with an unspecified length. value object the javascript equivalent of the cdata object's value. this will throw a typeerror exception if the value can't be converted. ...
Constants - Plugins
nperr_generic_error 1 error with no specific error code occurred. nperr_invalid_instance_error 2 invalid instance passed to the plug-in. nperr_invalid_functable_error 3 function table invalid. nperr_module_load_failed_error 4 loading of plug-in failed. ...
...and communicator do not match. nperr_invalid_param 9 parameter missing or invalid. nperr_invalid_url 10 url missing or invalid. nperr_file_not_found 11 file missing or invalid. nperr_no_data 12 stream contains no data. nperr_stream_not_seekable 13 seekable stream expected. result codes constant value
description npres_done 0 (most common): completed normally; all data was sent to the instance. npres_network_err 1 stream failed due to problems with network, disk i/o, lack of memory, or other problems. npres_user_break 2 user canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or initiating higher-prior...
... instance. npres_network_err 1 stream failed due to problems with network, disk i/o, lack of memory, or other problems. npres_user_break 2 user canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations. plug-in version constants constant value
description np_version_major 0 major version number; changes with major code release number. np_version_minor 22 minor version number; changes with point release number. version feature constants npvers constant: version feature information value
description npvers_has_streamoutput 8 streaming data. npvers_has_notification 9 n...
IDBDatabaseSync - Web APIs
name readonly domstring the name of the connected database. objectstores readonly domstringlist the names of the object stores that exist in the connected database. version readonly domstring the version of the connected database. has the n...
... name readonly domstring the name of the connected database. objectstores readonly domstringlist the names of the object stores that exist in the connected database. version readonly domstring the version of the connected database. has the null value when the databa...
...d removeobjectstore (in domstring storename) raises (idbdatabaseexception); void setversion (in domstring version); idbtransactionsync transaction (in optional domstringlist storenames, in optional unsigned int timeout) raises (idbdatabaseexception); attributes attribute type
description description readonly domstring the human-readable
description of the connected database. name readonly domstring the name of the connected database. objectstores readonly domstringlist the names of the object stores that exist in the connected database. version readonly domstring the version of the connected database. has the null value when the database is first created. methods createobjectstore() ...
LocalFileSystem - Web APIs
persistent 1 storage that stays in the browser unless the user or the app expunges it. the user must grant permission before the app can use this type of storage. methods requestfilesystem() requests a file system where data should be stored. you access a sand...
...owser to the file system. root - the read-only directoryentry object representing the root of the file system. opt_errorcallback the error callback that is called when errors happen or when the request to obtain the file system is denied. its argument is the fileerror object. returns void exceptions this method can raise an fileerror with the following code: exception
description security_error the application does not have permission to access the file system interface. for example, you cannot run from file://. for more details, see the article on basic concepts. resolvelocalfilesystemurl() lets you look up the entry for a file or directory with a local url. void resolvelocalfilesystemurl( in domstring url, in entrycallback successcallback, in ...
... a local file in the file system. successcallback the success callback that is called when the browser provides the file or directory for the supplied url. errorcallback the error callback that is called when errors happen or when the request to obtain the entry object is denied. returns void exceptions this method can raise an fileerror with the following code: exception
description encoding_err the syntax of the url was invalid. not_found_err the url was structurally correct, but refers to a resource that does not exist. security_err the application does not have permission to access the file system interface. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contrib...
LocalFileSystemSync - Web APIs
ilesystemsync(temporary, 1024*1024 /*1mb*/); because you are using a synchronous api, you don't need success and error callbacks. method overview filesystemsync requestfilesystemsync (in unsigned short type, in long long size) raises fileexception; entrysync resolvelocalfilesystemsyncurl (in domstring url) raises fileexception; constants constant value
description temporary 0 transient storage that can be be removed by the browser at its discretion. persistent 1 storage that stays in the browser unless the user or the app expunges it. methods requestfilesystemsync() requests a file system where data should be stored. you access a sandboxed file system by requesting a localfilesystemsync object from within...
...unsigned short type, in unsigned long long size ); parameters type the storage type of the file system. the values can be either temporary or persistent. size the storage space—in bytes—that you need for your app. returns filesystemsync an object that represents the file system. exceptions this method can raise an fileexception with the following code: exception
description security_error the application does not have permission to access the file system interface. for example, you cannot run from file://. for more details, see the article on basic concepts. resolvelocalfilesystemsyncurl() allows the user to look up the entry for a file or directory referred to by a local url. void resolvelocalfilesystemurl( in domstring url ); parameter u...
...temsyncurl() allows the user to look up the entry for a file or directory referred to by a local url. void resolvelocalfilesystemurl( in domstring url ); parameter url the url of a local file in the file system. returns entrysync an object that represents entries in the file system. exceptions this method can raise a fileexception with the following codes: exception
description encoding_err the syntax of the url was invalid. not_found_err the url was structurally correct, but refers to a resource that does not exist. security_err the application does not have permission to access the file system interface. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contrib...
NavigatorPlugins.plugins - Web APIs
methods. examples the following example function returns the version of the shockwave flash plugin. function getflashversion() { var flash = navigator.plugins.nameditem('shockwave flash'); if (typeof flash != 'object') { // flash is not present return undefined; } if(flash.version){ return flash.version; } else { //no version property (e.g. ...
... flash.version; } else { //no version property (e.g. in chrome) return flash.
description.replace(/shockwave flash /,""); } } the following example displays information about the installed plugin(s). ...
...a list of plugins is also available by entering about:plugins in the browser's location bar. ...
RTCPeerConnection.createAnswer() - Web APIs
ted parameters in older code and documentation, you may see a callback-based version of this function. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-based version of createanswer() instead. the parameters for this form of createanswer() are described below, to aid in updating existing code. successcallback an rtcsession
descriptioncallback which will be passed a single rtcsession
description object describing the newly-created answer. failurecallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an answer failed. options optional an optional rtcofferoptions object providing options requested for the answer. exceptions notreadableerror the ...
...al an optional rtcofferoptions object providing options requested for the answer. exceptions notreadableerror the identity provider wasn't able to provide an identity assertion. operationerror generation of the sdp failed for some reason; this is a general failure catch-all exception. return value a promise whose fulfillment handler is called with an object conforming to the rtcsession
descriptioninit dictionary which contains the sdp answer to be delivered to the other peer. example here is a segment of code taken from the code that goes with the article signaling and video calling. this code comes from the handler for the message sent to carry an offer to another peer across the signaling channel. keep in mind that this is part of the signaling process, the transport layer for which ...
...tion is used to send a json message with a type field with the value "video-answer" to the other peer, carrying the answer to the device which sent the offer to connect. the contents of the object being passed to the sendtoserver() function, along with everything else in the promise fulfillment handler, depend entirely on your design pc.createanswer().then(function(answer) { return pc.setlocal
description(answer); }) .then(function() { // send the answer to the remote peer through the signaling server. }) .catch(handlegetusermediaerror); this asks rtcpeerconnection to create and return a new answer. in our promise handler, the returned answer is set as the
description of the local end of the connection by calling setlocal
description(). once that succeeds, the answer is sent to the signaling s...
SVGLength - Web APIs
it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_lengthtype_number 1 no unit type was provided (i.e., a unitless value was specified), which indicates a value in user units. svg_lengthtype_percentage 2 a...
...thtype_mm 7 a value was specified using the mm units defined in css2. svg_lengthtype_in 8 a value was specified using the in units defined in css2. svg_lengthtype_pt 9 a value was specified using the pt units defined in css2. svg_lengthtype_pc 10 a value was specified using the pc units defined in css2. properties name type
description unittype unsigned short the type of the value as specified by one of the svg_lengthtype_* constants defined on this interface. value float the value as a floating point value, in user units. setting this attribute will cause valueinspecifiedunits and valueasstring to be updated automatically to reflect this setting. exceptions on setting: a domexception...
...lly to reflect this setting. exceptions on setting: a domexception with code syntax_err is raised if the assigned string cannot be parsed as a valid <length>. a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. methods name & arguments return
description newvaluespecifiedunits(in unsigned short unittype, in float valueinspecifiedunits) void reset the value as a number with an associated unittype, thereby replacing the values for all of the attributes on the object. exceptions: a domexception with code not_supported_err is raised if unittype is svg_lengthtype_unknown or not a valid unit type constant (one of...
SVGMarkerElement - Web APIs
it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_marker_orient_auto 1 attribute orient has value 'auto'. ...
...f this type or to attempt to switch an existing value to this type. svg_marker_orient_auto 1 attribute orient has value 'auto'. svg_marker_orient_angle 2 attribute orient has an angle value. units name value
description svg_markerunits_unknown 0 the marker unit type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_markerunits_userspaceonuse 1 attribute markerunits is 'userspaceonuse'. ...
...vg_markerunits_strokewidth 2 attribute markerunits is 'strokewidth'. properties this interface also inherits properties from its parent interface, svgelement, and implements properties from svgexternalresourcesrequired, svganimatedpreserveaspectratio, and svgstylable. name type
description refx svganimatedlength corresponds to attribute refx on the given marker element. refy svganimatedlength corresponds to attribute refy on the given marker element. markerunits svganimatedenumeration corresponds to attribute markeru...
SVGTransform - Web APIs
it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_transform_matrix 1 a matrix(…) transformation svg_transform_translate 2 a translate(…) transformation svg_transform_scale 3 a scale(…) tra...
... angle float a convenience attribute for svg_transform_rotate, svg_transform_skewx and svg_transform_skewy. it holds the angle that was specified. for svg_transform_matrix, svg_transform_translate and svg_transform_scale, angle will be...
... for svg_transform_skewx and svg_transform_skewy, a, b, c and d represent the matrix which will result in the given skew (e=0 and f=0). for svg_transform_rotate, a, b, c, d, e and f together represent the matrix which will result in the given rotation. when the rotation is around the center point (0, 0), e and f will be zero. methods name & arguments return
description setmatrix(in svgmatrix matrix) void sets the transform type to svg_transform_matrix, with parameter matrix defining the new transformation. note that the values from the parameter matrix are copied. exceptions: a domexception with code no_modification_allowed_err is raised when attempting to modify a read only attribute or when the object itself is read onl...
WebGLRenderingContext.getParameter() - Web APIs
od of the webgl api returns a value for the passed parameter name. syntax any gl.getparameter(pname); parameters pname a glenum specifying which parameter value to return. see below for possible values. return value depends on the parameter. parameter names webgl 1 you can query the following pname parameters when using a webglrenderingcontext. ...
...ion_webgl glenum gl.unpack_flip_y_webgl glboolean gl.unpack_premultiply_alpha_webgl glboolean gl.vendor domstring gl.version domstring gl.viewport int32array (with 4 elements) webgl 2 you can query the following pname parameters when using a webgl2renderingcontext. constant returned type
description gl.copy_read_buffer_binding webglbuffer or null see bindbuffer. gl.copy_write_buffer_binding webglbuffer or null see bindbuffer. gl.draw_bufferi glenum gl.back, gl.none or gl.color_attachment{0-15}. see also drawbuffers. gl.draw_framebuffer_binding webglframebuffer or null null corresponds to a binding to the default framebuffer. see...
...kip_images glint see pixelstorei. gl.unpack_skip_pixels glint see pixelstorei. gl.unpack_skip_rows glint see pixelstorei. gl.vertex_array_binding webglvertexarrayobject or null see bindvertexarray. webgl extensions you can query the following pname parameters when using webgl extensions: constant returned type extension
description ext.max_texture_max_anisotropy_ext glfloat ext_texture_filter_anisotropic maximum available anisotropy. ext.fragment_shader_derivative_hint_oes glenum oes_standard_derivatives accuracy of the derivative calculation for the glsl built-in functions: dfdx, dfdy, and fwidth. ext.max_color_attachments_webgl glint webgl_draw_buffers the maximum ...
Using the alertdialog role - Accessibility
unlike regular alerts, an alert dialog must have at least one focusable control and focus must be moved to that control when the alert dialog appears. ...
... attention. as the name implies, alertdialog is a type of dialog. this means that most of the instructions provided in the 'using the dialog role' technique are applicable to the alertdialog role as well: the alert dialog must always be given an accessible name (through aria-labelledby or aria-label) , and in most cases the alert text will have to be marked up as the alert dialog's accessible
description (using aria-describedby). unlike regular alerts, an alert dialog must have at least one focusable control and focus must be moved to that control when the alert dialog appears. generally alert dialogs have at least a confirmation, close or cancel button that can be used to move focus to. additionally, alert dialogs can have other interactive controls such as text fields, tabs or checkboxes. whic...
...ialog in the operating system's accessibility api. fire an accessible alert event using the operating system's accessibility api if it supports it. when the alert dialog appears, screen readers should announce the alert. when the alert dialog is correctly labeled and focus is moved to a control inside the dialog, screen readers should announce the dialog's accessible role, name and optionally
description before announcing the focused element. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: a basic alert dialog the code snippet below shows how to mark up an alert dialog that only provides a message and an ok button. <div role="alertdialog" aria-labelled...
ARIA: figure role - Accessibility
the aria figure role can be used to identify a figure inside page content where appropriate semantics do not already exist. a figure is generally considered to be one or more images, code snippets, or other content that puts across information in a different way to a regular flow of text. <div role="figure" aria-labelledby="caption"> <img src="image.png" alt="full alternative image
description"> <p id="caption">figure 1: the caption</p> </div> in the above example, we have a figure that consists of two separate content items — an image and a caption. this is wrapped by a <div> element that identifies the content as a figure using role="figure". instead of using aria to create a figure, consider using the native, semantic html <figure> element. along with the <figcaption> element. se...
... the caption</p> </div> in the above example, we have a figure that consists of two separate content items — an image and a caption. this is wrapped by a <div> element that identifies the content as a figure using role="figure". instead of using aria to create a figure, consider using the native, semantic html <figure> element. along with the <figcaption> element. see best practices below.
description any content that should be grouped together and consumed as a figure (which could include images, video, audio, code snippets, or other content) can be identified as a figure using role="figure". there are no hard and fast rules about how you should write your figure content. you should make sure that it is accessible just like any other content. for example, make sure it is perceivable by user...
...an id to an element containing content that describes the figure, and then reference that id inside an appropriate attribute on the figure to associate the figure with the label: <div role="figure" aria-labelledby="figure-1"> ... <p id="figure-1">text that describes the figure.</p> </div> use aria-labelledby when the text is a concise label. use aria-describedby when the text is a longer
description. again, this can be done semantically, without aria, with html's <figure> and <figcaption> elements <figure> ... <figcaption>text that describes the figure.</figcaption> </figure> if you don't want the label to be visible on the screen, but still want to provide a descriptive label for assistive technology users, you can use the aria-label attribute on the figure container: <div role=...
ARIA: Navigation Role - Accessibility
landmark roles provide a way to identify the organization and structure of a web page. by classifying and labeling sections of a page, structural information conveyed visually through layout is represented programmatically. ...
... navigation landmark. if the html5 nav element technique is not being used, use a role="navigation" attribute to define a navigation landmark. using the <nav> element will automatically communicate a section has a role of navigation. developers should always prefer using the correct semantic html element over using aria. associated wai-aria roles, states, and properties aria-label a brief
description of the purpose of the navigation, omitting the term "navigation", as the screen reader will read both the role and the contents of the label. keyboard interactions none. required javascript features none. examples <div role="navigation" aria-label="customer service"> <ul> <li><a href="#">help</a></li> <li><a href="#">order tracking</li> <li><a href="#">shipping & delivery...
...tent, use the same label for each landmark. an example of this would be repeating the main navigation at the top and bottom of the page. <header> <nav id="main-nav" aria-label="main"> <!-- list of links to main website locations --> </nav> </header> ... <footer> <nav id="footer-nav" aria-label="main"> <!-- list of links to main website locations --> </nav> </footer> redundant
descriptions screen readers will announce the type of role the landmark is. because of this, you do not need to describe what the landmark is in its label. for example, a declaration of role="navigation" with an of aria-label="primary navigation" may be announced redundantly as, "primary navigation navigation". added benefits certain technologies such as browser extensions can generate lists of all landma...
ARIA: img role - Accessibility
the aria img role can be used to identify multiple elements inside page content that should be considered as a single image. these elements could be images, code snippets, text, emojis, or other content that can be combined to deliver information in a visual manner. <div role="img" aria-label="
description of the overall image"> <img src="graphic1.png" alt=""> <img src="graphic2.png"> </div>
description any set of content that should be consumed as a single image (which could include images, video, audio, code snippets, emojis, or other content) can be identified using role="img". you shouldn't count on the alt text of individual elements images for conveying context to assistive technologies; most screenreaders will consider the element with role="img" set on it to be to be like a black box...
...lement with role="img" set on it to be to be like a black box, and not access the individual elements inside it. therefore, provide a comprehensive overall descriptive alt text for image, either in the surrounding text, or by using an aria-label attribute, with optional alt attributes for search engines or sighted users to be written to the page should an image fail: <div role="img" aria-label="
description of the overall image"> <img src="graphic1.png" alt=""> <img src="graphic2.png"> </div> if you wish to add a caption or label to your image that is visible on the page, you can do using: aria-labelledby when the text is a concise label. aria-describedby when the text is a longer
description. for example: <div role="img" aria-labelledby="image-1"> ... <p id="image-1">text that descr...
...mage-1">text that describes the group of images.</p> </div> svg and role="img" if you are using embedded svg images in your page, it is a good idea to set role="img" on the outer <svg> element and give it a label. this will cause screen readers to just consider it as a single entity and describe it using the label, rather than trying to read out all the child nodes: <svg role="img" aria-label="
description of your svg image"> <!-- contents of the svg image --> </svg> using role="img" to confer meaning that is obscured or implied in certain cases, assistive technology users won't be able to get the meaning of content expressed in certain ways, through certain media, or implied in certain ways. this is obvious to fix in the case of images (you can use the alt attribute), but in the case of mixed ...
ARIA: dialog role - Accessibility
interact with content outside of the dialog) or modal (only the content in the dialog can be interacted with). <div role="dialog" aria-labelledby="dialog1title" aria-describedby="dialog1desc"> <h2 id="dialog1title">your personal details were successfully updated</h2> <p id="dialog1desc">you can change your details at any time in the user account section.</p> <button>close</button> </div>
description marking up a dialog element with the dialog role helps assistive technology identify the dialog's content as being grouped and separated from the rest of the page content. however, adding role="dialog" alone is not sufficient to make a dialog accessible. additionally, the following needs to be done: the dialog must be properly labeled keyboard focus must be managed correctly the sections ...
...describedby attribute. this approach is shown in the code snippet below: <div role="dialog" aria-labelledby="dialog1title" aria-describedby="dialog1desc"> <h2 id="dialog1title">your personal details were successfully updated</h2> <p id="dialog1desc">you can change your details at any time in the user account section.</p> <button>close</button> </div> keep in mind that a dialog's title and
description text do not have to be focusable in order to be perceived by screen readers operating in a non-virtual mode. the combination of the aria dialog role and labeling techniques should make the screen reader announce the dialog's information when focus is moved into it. required javascript features focus management a dialog has particular requirements for how keyboard focus should be managed: d...
...ts and assistive technology when the dialog role is used, the user agent should do the following: expose the element as a dialog in the operating system's accessibility api. when the dialog is correctly labeled and focus is moved to an element (often an interactive element, such as a button) inside the dialog, screen readers should announce the dialog's accessible role, name and optionally
description, along with announcing the focused element. note: opinions may differ on how assistive technology should handle this technique, and the order of announcements may differ depending on the assistive technolgy used. the information provided above is one of those opinions and therefore not normative. examples a dialog containing a form <div role="dialog" aria-labelledby="dialog1title" aria-desc...
CSS values and units - CSS: Cascading Style Sheets
ixels 1px = 1/96th of 1in when including a length value, if the length is 0, the unit identifier is not required. otherwise, the unit identifier is required, is case insensitive, and must come immediately after the numeric part of the value, with no space in-between. angle units angle values are represented by the type <angle> and accept the following values: unit name
description deg degrees there are 360 degrees in a full circle. grad gradians there are 400 gradians in a full circle. rad radians there are 2π radians in a full circle. turn turns there is 1 turn in a full circle. time units time values are represented by the type <time>. when including a time value, the unit identifier -- the s or ms ...
... grad gradians there are 400 gradians in a full circle. rad radians there are 2π radians in a full circle. turn turns there is 1 turn in a full circle. time units time values are represented by the type <time>. when including a time value, the unit identifier -- the s or ms -- is required. it accepts the following values. unit name
description s seconds ms milliseconds there are 1,000 milliseconds in a second. frequency units frequency values are represented by the type <frequency>. it accepts the following values. unit name
description hz hertz represents the number of occurrences per second. khz kilohertz a kilohertz is 1000 hertz. 1hz...
...a kilohertz is 1000 hertz. 1hz, which can also be written as 1hz or 1hz, is one cycle per second. resolution unit resolution units are represented by the type <resolution>. they represent the size of a single dot in a graphical representation, such as a screen, by indicating how many of these dots fit in a css inch, centimeter, or pixel. it accepts the following values: unit
description dpi dots per inch. dpcm dots per centimetre. dppx, x dots per px unit. percentages a <percentage> is a type that represents a fraction of some other value. percentage values are always relative to another quantity, for example a length. each property that allows percentages also defines the quantity to which the percentage refers. this quantity can...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
this is the default. auto div{ color: black; -moz-appearance: auto; -webkit-appearance: auto; appearance:auto; } <div>lorem</div> none the use...
...iv>lorem</div> chrome safari edge textarea div{ color: black; -webkit-appearance: textarea; } <div>lorem</div> firefox chrome safari edge non-standard keywords the following values are implemented only for one or both of the prefixed properties, but not on the standard appearance property. ...
...instead. -apple-pay-button div{ color: black; -webkit-appearance: -apple-pay-button; } <div>lorem</div> safari ios and macos only. available on the web starting in ios 10.1 and macos 10.12.1 obsolete values the following values were at some point implemented for a prefixed property, but are no longer supported. ...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content permitted content phrasing content tag omission none, both the starting and ending tag are mandatory. ...
...tory. permitted parents any element that accepts phrasing content implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only supports the global attributes. the title attribute has a specific semantic meaning when used with the <abbr> element; it must contain a full human-readable
description or expansion of the abbreviation. this text is often presented by browsers as a tooltip when the mouse cursor is hovered over the element. each <abbr> element you use is independent from all others; providing a title for one does not automatically attach the same expansion text to others with the same content text. usage notes typical use cases it's certainly not required that all abbreviatio...
... a <span> element. opera, firefox, and some others add a dotted underline to the content of the element. a few browsers not only add a dotted underline, but also put it in small caps; to avoid this styling, adding something like font-variant: none in the css takes care of this case. examples marking up an abbreviation semantically to mark up an abbreviation without providing an expansion or
description, simply use <abbr> without any attributes, as seen in this example. html <p>using <abbr>html</abbr> is fun and easy!</p> result styling abbreviations you can use css to set a custom style to be used for abbreviations, as seen in this simple example. html <p>using <abbr>css</abbr>, you can style your abbreviations!</p> css abbr { font-variant: all-small-caps; } result providing an...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
ng of the star wars films, or the date, time, and location of a scene. captions closed captions provide a transcription and possibly a translation of audio. it may include important non-verbal information such as music cues or sound effects. it may indicate the cue's source (e.g. music, text, character). suitable for users who are deaf or when the sound is muted.
descriptions textual
description of the video content. suitable for users who are blind or where the video cannot be seen. chapters chapter titles are intended to be used when the user is navigating the media resource. metadata tracks used by scripts. not visible to the user. label a user-readable title of the text track which is used by the browser ...
... the <audio> or <video> parent element of the track element has a crossorigin attribute. srclang language of the track text data. it must be a valid bcp 47 language tag. if the kind attribute is set to subtitles, then srclang must be defined. usage notes track data types the type of data that track adds to the media is set in the kind attribute, which can take values of subtitles, captions,
descriptions, chapters or metadata. the element points to a source file containing timed text that the browser exposes when the user requests additional data. a media element cannot have more than one track with the same kind, srclang, and label. detecting cue changes the underlying texttrack, indicated by the track property, receives a cuechange event every time the currently-presented cue is changed. th...
...change event handler: let texttrackelem = document.getelementbyid("texttrack"); texttrackelem.oncuechange = (event) => { let cues = event.target.track.activecues; }); examples <video controls poster="/images/sample.gif"> <source src="sample.mp4" type="video/mp4"> <source src="sample.ogv" type="video/ogv"> <track kind="captions" src="samplecaptions.vtt" srclang="en"> <track kind="
descriptions" src="sample
descriptions.vtt" srclang="en"> <track kind="chapters" src="samplechapters.vtt" srclang="en"> <track kind="subtitles" src="samplesubtitles_de.vtt" srclang="de"> <track kind="subtitles" src="samplesubtitles_en.vtt" srclang="en"> <track kind="subtitles" src="samplesubtitles_ja.vtt" srclang="ja"> <track kind="subtitles" src="samplesubtitles_oz.vtt" srclang="oz"> <...
An overview of HTTP - HTTP
http is a protocol which allows the fetching of resources, such as html documents. it is the foundation of any data exchange on the web and it is a client-server protocol, which means requests are initiated by the recipient, usually the web browser. a complete document is reconstructed from the different sub-documents fetched, for instance text, layout
description, images, videos, scripts, and more. clients and servers communicate by exchanging individual messages (as opposed to a stream of data). the messages sent by the client, usually a web browser, are called requests and the messages sent by the server as an answer are called responses. designed in the early 1990s, http is an extensible protocol which has evolved over time. it is an application layer protocol that is sent over tcp, or over ...
...teways or caches, for example. in reality, there are more computers between a browser and the server handling the request: there are routers, modems, and more. thanks to the layered design of the web, these are hidden in the network and transport layers. http is on top, at the application layer. although important to diagnose network problems, the underlying layers are mostly irrelevant to the
description of http. client: the user-agent the user-agent is any tool that acts on the behalf of the user. this role is primarily performed by the web browser; other possibilities are programs used by engineers and web developers to debug their applications. the browser is always the entity initiating the request. it is never the server (though some mechanisms have been added over the years to simulate s...
...nvey additional information for the servers. or a body, for some methods like post, similar to those in responses, which contain the resource sent. responses an example response: responses consist of the following elements: the version of the http protocol they follow. a status code, indicating if the request was successful, or not, and why. a status message, a non-authoritative short
description of the status code. http headers, like those for requests. optionally, a body containing the fetched resource. apis based on http the most commonly used api based on http is the xmlhttprequest api, which can be used to exchange data between a user agent and a server. the modern fetch api provides the same features with a more powerful and flexible feature set. another api, server-sent event...
Proxy Auto-Configuration (PAC) file - HTTP
y to http urls, but there is interest in changing this behavior to match https); in firefox, the preference is network.proxy.autoconfig_url.include_path. host the hostname extracted from the url. this is only for convenience; it is the same string as between :// and the first : or / after that. the port number is not included in this parameter. it can be extracted from the url when necessary.
description returns a string describing the configuration. the format of this string is defined in return value format below. return value format the javascript function returns a single string if the string is null, no proxies should be used the string can contain any number of the following building blocks, separated by a semicolon: direct connections should be made directly, without any proxie...
...ser package) was used to test the following syntax examples. the pac file is named proxy.pac command line: pactester -p ~/pacparser-master/tests/proxy.pac -u http://www.mozilla.org (passes the host parameter www.mozilla.org and the url parameter http://www.mozilla.org) isplainhostname() syntax isplainhostname(host) parameters host the hostname from the url (excluding port number).
description true if and only if there is no domain name in the hostname (no dots). examples isplainhostname("www.mozilla.org") // false isplainhostname("www") // true dnsdomainis() syntax dnsdomainis(host, domain) parameters host is the hostname from the url. domain is the domain name to test the hostname against.
description returns true if and only if the domain of hostname matches. examp...
...e domain name to test the hostname against.
description returns true if and only if the domain of hostname matches. examples dnsdomainis("www.mozilla.org", ".mozilla.org") // true dnsdomainis("www", ".mozilla.org") // false localhostordomainis() syntax localhostordomainis(host, hostdom) parameters host the hostname from the url. hostdom fully qualified hostname to match against.
description is true if the hostname matches exactly the specified hostname, or if there is no domain name part in the hostname, but the unqualified hostname matches. examples localhostordomainis("www.mozilla.org" , "www.mozilla.org") // true (exact match) localhostordomainis("www" , "www.mozilla.org") // true (hostname match, domain not specified) localhostordomainis("www.google.com" , "www.m...
Assertions - JavaScript
eanings of '^' control symbol are represented: // 1) matching begining of the input // 2) a negated or complemented character set: [^a] // that is, it matches anything that is not enclosed in the brackets. ...
...the input // 2) a negated or complemented character set: [^a] // that is, it matches anything that is not enclosed in the brackets. ...
...anything that is not enclosed in the brackets. ...
Symbol - JavaScript
every symbol value returned from symbol() is unique. a symbol value may be used as an identifier for object properties; this is the data type's primary purpose, although other use-cases exist, such as enabling opaque data types, or serving as an implementation-supported unique identifier in general. some further explanation about purpose and usage can be found in the glossary entry for symbol.
description to create a new primitive symbol, you write symbol() with an optional string as its
description: let sym1 = symbol() let sym2 = symbol('foo') let sym3 = symbol('foo') the above code creates three new symbols. note that symbol("foo") does not coerce the string "foo" into a symbol. it creates a new symbol each time: symbol('foo') === symbol('foo') // false the following syntax with the new ...
...hes the regular expression. used by string.prototype.search(). symbol.split a method that splits a string at the indices that match a regular expression. used by string.prototype.split(). symbol.species a constructor function that is used to create derived objects. symbol.toprimitive a method converting an object to a primitive value. symbol.tostringtag a string value used for the default
description of an object. used by object.prototype.tostring(). symbol.unscopables an object value of whose own and inherited property names are excluded from the with environment bindings of the associated object. static methods symbol.for(key) searches for existing symbols with the given key and returns it if found. otherwise a new symbol gets created in the global symbol registry with key. symbol.
...uded from the with environment bindings of the associated object. static methods symbol.for(key) searches for existing symbols with the given key and returns it if found. otherwise a new symbol gets created in the global symbol registry with key. symbol.keyfor(sym) retrieves a shared symbol key from the global symbol registry for the given symbol. instance properties symbol.prototype.
description a read-only string containing the
description of the symbol. instance methods symbol.prototype.tosource() returns a string containing the source of the symbol object. overrides the object.prototype.tosource() method. symbol.prototype.tostring() returns a string containing the
description of the symbol. overrides the object.prototype.tostring() method. symbol.prototype.valueof() returns...
Lexical grammar - JavaScript
s, control characters, line terminators, comments or white space. ecmascript also defines certain keywords and literals and has rules for automatic insertion of semicolons to end statements. control characters control characters have no visual representation but are used to control the interpretation of the text. unicode format-control characters code point name abbreviation
description u+200c zero width non-joiner <zwnj> placed between characters to prevent being connected into ligatures in certain languages (wikipedia). u+200d zero width joiner <zwj> placed between characters that would not normally be connected in order to cause the characters to be rendered using their connected form in certain languages (wikipedia). u+feff ...
...kipedia). white space white space characters improve the readability of source text and separate tokens from each other. these characters are usually unnecessary for the functionality of the code. minification tools are often used to remove whitespace in order to reduce the amount of data that needs to be transferred. white space characters code point name abbreviation
description escape sequence u+0009 character tabulation <ht> horizontal tabulation \t u+000b line tabulation <vt> vertical tabulation \v u+000c form feed <ff> page breaking control character (wikipedia). \f u+0020 space <sp> normal space u+00a0 no-break space <nbsp> normal space, but no point at whic...
...process of automatic semicolon insertion. line terminators are matched by the \s class in regular expressions. only the following unicode code points are treated as line terminators in ecmascript, other line breaking characters are treated as white space (for example, next line, nel, u+0085 is considered as white space). line terminator characters code point name abbreviation
description escape sequence u+000a line feed <lf> new line character in unix systems. \n u+000d carriage return <cr> new line character in commodore and early mac systems. \r u+2028 line separator <ls> wikipedia u+2029 paragraph separator <ps> wikipedia comments comments are used to add hints, notes, sugg...
How to make PWAs installable - Progressive web apps (PWAs)
nifest.webapp was popular in firefox os app manifests, and many use manifest.json for web manifests as the contents are organized in a json structure. however, the .webmanifest file format is explicitly mentioned in the w3c manifest specification, so that's what we'll use here. the content of the file looks like this: { "name": "js13kgames progressive web app", "short_name": "js13kpwa", "
description": "progressive web app that lists games submitted to the a-frame category in the js13kgames 2017 competition.", "icons": [ { "src": "icons/icon-32.png", "sizes": "32x32", "type": "image/png" }, // ... { "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png" } ], "start_url": "/pwa-examples/js13kpwa/index.html", "display...
...con-512.png", "sizes": "512x512", "type": "image/png" } ], "start_url": "/pwa-examples/js13kpwa/index.html", "display": "fullscreen", "theme_color": "#b12a34", "background_color": "#b12a34" } most of the fields are self-explanatory, but to be certain we're on the same page: name: the full name of your web app. short_name: short name to be shown on the home screen.
description: a sentence or two explaining what your app does. icons: a bunch of icon information — source urls, sizes, and types. be sure to include at least a few, so that one that fits best will be chosen for the user's device. start_url: the index document to launch when starting the app. display: how the app is displayed; can be fullscreen, standalone, minimal-ui, or browser. theme_color: a primary...
...eme_color: a primary color for the ui, used by operating system. background_color: a color used as the app's default background, used during install and on the splash screen. a minimal web manifest must have at least a name and an icons field with at least one icon defined; that icon must have at least the src, sizes, and type sub-fields as well. beyond that, everything is optional, though the
description, short_name, and start_url fields are recommended. there are even more fields you can use than listed above — be sure to check the web app manifest reference for details. add to home screen "add to home screen" (or a2hs for short) is a feature implemented by mobile browsers that takes the information found in an app's web manifest and uses them to represent the app on the device's home screen...
Structural overview of progressive web apps - Progressive web apps (PWAs)
s13kgames.png index.html js13kpwa.webmanifest style.css sw.js the html the html in the file index.html creates the structure of the app. the parts that are directly relevant to the app shell model are found outside the <section> with the id content within this page. ...
...you can <a href="https://github.com/mdn/pwa-examples/blob/master/js13kpwa"> fork js13kpwa on github</a> to check its source code.</p> <button id="notifications">request dummy notifications</button> <section...
...request dummy notifications</button> <section id="content"> // content inserted in here </section> </main> <footer> <p>© js13kgames 2012-2018, created and maintained by <a href="http://end3r.com"> andrzej mazur</a> from <a href="http://enclavegames.com">enclave games</a>.</p> </footer> </body> </html> the <head> section contains basic information about the app, including its title,
description, and the needed references to its css file, web manifest, the main application javascript file (app.js, in which the app is initialized) as well as an additional javascript code file. the <body> is split into the <header> (which displays an image) and the body of the app, which is found inside a <main> element. the app displays its title, a
description, and then a place for the app content to be ...
<metadata> - SVG: Scalable Vector Graphics
ic attributes none dom interface this element implements the svgmetadataelement interface. ...
...00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <metadata> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:connect="http://www.w3.org/1999/08/29-svg-connections-in-rdf#"> <rdf:
description about="#cablea"> <connect:ends rdf:resource="#socket1"/> <connect:ends rdf:resource="#computera"/> </rdf:
description> <rdf:
description about="#cableb"> <connect:ends rdf:resource="#socket2"/> <connect:ends rdf:resource="#computerb"/> </rdf:
description> <rdf:
description about="#cablen"> <connect:ends rdf:resource="#socket5"/> <connect:ends>everything</connect:ends> </rdf:
description> <rdf:
description about="#hub"> <connect:ends rdf:resource="#...
...used by hub symb...
context-menu - Archive of obsolete content
, image, or other non-text node, or while a selection exists. declarative contexts you can specify some simple, declarative contexts when you create a menu item by setting the context property of the options object passed to its constructor, like this: var cm = require("sdk/context-menu"); cm.item({ label: "my menu item", context: cm.urlcontext("*.mozilla.org") }); constructor
description pagecontext() the page context. selectioncontext() this context occurs when the menu is invoked on a page in which the user has made a selection. selectorcontext(selector) this context occurs when the menu is invoked on a node that either matches selector, a css selector, or has an ancestor that matches. selector may include multiple selectors separated by c...
...rn strings or regexps. predicatecontext(predicatefunction) new in firefox 29 creates a context that occurs when predicatefunction returns a true value. see specifying contexts above. parameters predicatefunction : function(context) a function which will be called with an object argument that provide information about the invocation context. context object properties: property
description documenttype the mime type of the document the menu was invoked in. e.g. text/html for html pages, application/xhtml+xml for xhtml, or image/jpeg if viewing an image directly. documenturl the url of the document the menu was invoked in. targetname the name of the dom element that the menu was invoked on, in lower-case. targetid the id attribute ...
Bootstrapped extensions - Archive of obsolete content
on ); parameters data a bootstrap data structure. reason one of the reason constants, indicating why the extension is being uninstalled. this will be one of addon_uninstall, addon_upgrade, or addon_downgrade. reason constants the bootstrap functions accept a reason parameter, which explains to the extension why it's being called. the reason constants are: constant value
description app_startup 1 the application is starting up. app_shutdown 2 the application is shutting down. addon_enable 3 the add-on is being enabled. addon_disable 4 the add-on is being disabled. (also sent during uninstallation) addon_install 5 the add-on is being installed. addon_uninstall 6 the add-on is being unins...
...addon_downgrade 8 the add-on is being downgraded. bootstrap data each of the entry points is passed a simple data structure containing some useful information about the add-on being bootstrapped. more information about the add-on can be obtained by calling addonmanager.getaddonbyid(). the data is a simple javascript object with the following properties: property type
description id string the id of the add-on being bootstrapped. version string the version of the add-on being bootstrapped. installpath nsifile the installation location of the add-on being bootstrapped. this may be a directory or an xpi file depending on whether the add-on is installed unpacked or not. resourceuri nsiuri a uri pointing at the root ...
JavaScript Daemons Management - Archive of obsolete content
arguments thisobject the this object on which will be called the callback function. it can be an object or null. if is null, the this object will point to the global daemon.contex...
...er constructors daemon.blank() constructs a new instance of daemon without own properties. this constructor is useful in order to create your own *mysomedaemon* constructors through the mysomedaemon.prototype = new daemon.blank(); assignment. daemon.safe() [optional module daemon-safe.js] syntax var mydaemon = new daemon.safe(thisobject, callback[, rate[, length[, init[, onstart]]]]);
description daemon.safe is a clone of the daemon constructor based on recursive invocations of settimeout rather than on a single invocation of setinterval. see the daemon-safe.js module for details. note: the daemon.safe constructor is not part of the base system. daemon.safe.blank() [optional module daemon-safe.js] the same as for daemon.blank, but applied to the daemon.safe constructor. note: ...
Deploying a Plugin as an Extension - Archive of obsolete content
r a browser plugin. rhapsodyplayerengine_inst_win.xpi install.rdf plugins/ license.rtf nprhapengine.dll the important file here is the install.rdf file. this contains information about our extension; all extensions have one. ...
...ions have one. here's what a basic install.rdf file looks like: <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:id>rhapsodyplayerengine@rhapsody.com</em:id> <em:name>rhapsody player engine</em:name> <em:version>1.0.0.487</em:version> <em:targetapplication> <
description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>1.5</em:minversion> <em:maxversion>1.5.0.*</em:maxversion> </
description> </em:targetapplication> </
description> </rdf> you can get more detailed information about this file at install.rdf. we'll cover the basics. the id specifies a unique id that uniquely identifes this extension of the fo...
Extension Etiquette - Archive of obsolete content
flict(true) will remove the window.jquery and window.$ variables, and return the jquery object itself, for future use by the caller. when available, these methods should always be used to prevent conflicts with third-party code. names and metadata naming be creative! don't be redundant and include "extension," "mozilla/firefox/thunderbird," or the version number in the name. be original!
descriptions use something that is descriptive, but that would fit in the default add-on manager width. the mozilla extensions (inspector/reporter/talkback) believe starting with a verb is the best way. for example, "does an action in the browser." documentation assume that the vast majority of your users don't have inner working knowledge of mozilla. make sure your extension's homepage states the "obviou...
...on to another language easier. it occurs more often than you would think. options firefox users like options. lots of options. try to include everything a user could ever want to customize in your extension, remembering more can be added later. for a large number of options for your extension, break the options window into multiple pages (tabs) that are well labeled. don't hesitate to give long
descriptions for each preference, as long as they are easy to understand, even for non-computer-savvy users. however, please make sure the default set of preferences is adequate — don't require people to tweak options in order to get your extension's core functionality. preferences' internal names internal firefox preference names for extensions or to be clear, the name of the preference as it appears in...
Inline options - Archive of obsolete content
label string directory browse button and label string menulist menulist dependent on the menu item values radio radio buttons dependent on the radio values control button no pref stored the pref attribute should have the full name of the preference to be stored. the title attribute is used as a label for the controls. ...
...ls. to set a
description, either use the desc attribute, or a text node as a child of the <setting> tag. settings are tied to actual preferences, except the button setting, which is designed more for actions. ...
Index of archived content - Archive of obsolete content
file i/o finding window handles forms related code snippets html in xul for rich tooltips html to dom isdefaultnamespace js xpcom javascript debugger service javascript timers javascript daemons management label and
description lookupnamespaceuri lookupprefix miscellaneous modules on page load page loading post data to window preferences progress listeners queryselector rosetta running applications svg animation svg general scrollbar ...
...npp_streamasfile npp_urlnotify npp_write npp_writeready npprint npprintcallbackstruct nprect npregion npsaveddata npsetwindowcallbackstruct npstream npstring nputf8 npvariant npvarianttype npwindow np_getmime
description np_getvalue np_initialize np_port np_shutdown samples and test cases shipping a plugin as a toolkit bundle supporting private browsing in plugins the first install problem writing a plugin for mac os x xembed extension for mozilla plugins sa...
List of Former Mozilla-Based Applications - Archive of obsolete content
the following is a list of all known applications that at one point used mozilla technologies or that are no longer being actively maintained. a list of actively maintained mozilla-based applications is also available. ...
...xulrunner app initially but now uses adobe air rift technologies software installation over internet no longer using mozilla technology -- need confirmation and details second life virtual world desktop client switched from embedded mozilla browser to a plugin architecture with a qtwebkit plugin applications that are no longer being developed name
description additional information aphrodite browser inactive aol client for mac internet software no longer available beonex communicator internet software last news item on site from 2004 chameleon theme builder inactive civil netizen p2p file delivery (email attachment replacement) site not updated since 2006 compuserve...
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
stalled and one called install.js that contains the code to install the component. ...
...#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <rdf:seq about="urn:mozilla:package:root"> <rdf:li resource="urn:mozilla:package:tinderstatus"/> </rdf:seq> <rdf:
description about="urn:mozilla:package:tinderstatus" chrome:displayname="mozilla tinderstatus extension" chrome:author="myk melez" chrome:name="tinderstatus" chrome:extension="true" chrome:
description="displays tinderbox status for the mozilla codebase."> </rdf:
description> <rdf:seq about="urn:mozilla:overlays"> <rdf:li resource="chrome://navigator/content/navigator.xul"/> </rdf:seq> <rdf:seq about="chrome://navigator/content/navigator.xul"> <rdf:li>chrome://tinderstatus/content/tinderstatusoverlay.xul</rdf:li> </rdf:seq> </rdf:rdf> install.js, on the other hand, goes into the tinders...
install.rdf - Archive of obsolete content
copy the following text and paste it into a text file, then save that file as "install.rdf": <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:id>author@oftheme.com</em:id> <em:version>2.0b1</em:version> <!-- seamonkey --> <em:targetapplication> <
description> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.0b1pre</em:minversion> <em:maxversion>2.0b2pre</em:maxversion> </
description> </em:targetapplication> <!-- front end metadata --> <em:name>my_theme</em:name> <em:
description>my first theme</em:
description> <!-- front end integration hooks (used by theme ma...
.../em:
description> <!-- front end integration hooks (used by theme manager)--> <em:creator>john johnson</em:creator> <em:contributor>john johnson</em:contributor> <em:homepageurl>https://mycoolskin.com/</em:homepageurl> <em:updateurl>https://mycoolskin.com/</em:updateurl> <em:abouturl>https://mycoolskin.com/</em:abouturl> <em:internalname>my_theme</em:internalname> </
description> </rdf> ...
Download Manager preferences - Archive of obsolete content
a boolean value that indicates whether the anti virus software should try to clean a downloaded file when a virus is detected. default value is false. browser.download.manager.addtorecentdocs a boolean value that indicates whether or not new downloads should be added to the recent documents list. default value is true. ...
...n mac the default value is false. on other oses the default value is true if a preference is not set when the download manager looks it up, the download manager assumes the default value but doesn't necessarily add the missing preference. the following table however, includes preferences which must be included in any product for the download manager to function. preference
description browser.download.dir a local folder the user may have selected for downloaded files to be saved. migration of other browser settings may also set this path. this folder is enabled when browser.download.folderlist equals 2. browser.download.folderlist indicates the default folder to download a file to. 0 indicates the desktop; 1 indicates the systems default downloads ...
generateCRMFRequest() - Archive of obsolete content
arameter will only be used for requests that pertain to a key that is being escrowed. after the "escrowauthoritycert" parameter, the method takes some javascript code that is invoked when the crmf request is ready. finally, there are 1 or more sets of key generation arguments. each key generation will be associated with its own request. all the requests will have the same dn. argument
description "requesteddn" an rfc 1485 formatted dn to include in the certificate request. "regtoken" a value used to authenticate the user to the ra/ca. "authenticator" a value that the user can authenticate with in the future when their private key is not available. can be used for key recovery or revocation requests. "escrowauthoritycert" if this value is nul...
...rn an instance of a crmf request object. the javascript passed in as the "crmf generation done code" parameter should look at the attribute request of the returned object to get the result of the crmf generation. the string found by accessing crmfobject.request is the base-64 encoded crmf message to be sent to the ca/ra, or an error string. the possible error strings are: error string
description "error:invalidparameter:xxx" the parameter xxx was an invalid value. "error:usercancel" the user has canceled the key generation operation "error:internalerror" the software encountered some internal error, such as out of memory ...
importUserCertificates - Archive of obsolete content
hat this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. resultstring = crypto.importusercertificates("nicknamestring","certstring",forcebackup); argument
description "nicknamestring" this is the nickname that will be used to describe the certificate in the client's certificate management ui. it should serve to uniquely identify the certificate to the user. for example, "john smith's verisign class 3 digital id" or "john smith's ford id certificate". however, if this certificate has the same dn as one or more certificates that alrea...
...user. the private key for the certificates must already reside in the user's personal private key database. the request id in the response being imported must match the request id in the associated certification request or recovery request. if the import operation succeeds, an empty string will be returned. ...
popChallengeResponse - Archive of obsolete content
your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. resultstring = crypto.popchallengeresponse("challengestring"); argument
description "challengestring" a base-64 encoded cmmf popodeckeychallcontent message. the current implementation does not conform to that defined in the cmmf draft, and we intend to change this implementation to that defined in the cmc rfc.. see below for the current implementation. the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following error...
...se-64 encoded cmmf popodeckeychallcontent message. the current implementation does not conform to that defined in the cmmf draft, and we intend to change this implementation to that defined in the cmc rfc.. see below for the current implementation. the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following error strings: error string
description "error:invalidparameter:xxx" the parameter xxx was an invalid value. "error:internalerror" the software encountered some internal error, such as out of memory challenge-response proof of possession expected input: popodeckeychallcontent ::= sequence of challenge -- one challenge per encryption key certification request (in the -- same order as these requests ap...
Makefile.mozextension.2 - Archive of obsolete content
9bdfdc6} #nvu {136c295a-4a5a-41cf-bf24-5cee526720d5} #mozilla suite {86c18b42-e466-45a9-ae7a-9b95ba6f5640} #seamonkey {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} #sunbird {718e30fb-e89b-41dd-9da7-e25a45638b28} #netscape browser {3db10fab-e461-4c80-8b97-957ad5f8ea47} ###### define install_rdf <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <id>$(project_id)</id> <name>$(project_name)</name> <version>$(project_version)</version> <
description>$(project_desc)</
description> <creator>$(project_author)</creator> <contributor>here is a place for you who helped me</contributor> <homepageurl>http://$(project).mozdev.org/</homepageurl> <optionsurl>chrome://$(project)/content/settings.xul</optionsurl> ...
...utor>here is a place for you who helped me</contributor> <homepageurl>http://$(project).mozdev.org/</homepageurl> <optionsurl>chrome://$(project)/content/settings.xul</optionsurl> <abouturl>chrome://$(project)/content/about.xul</abouturl> <iconurl>chrome://$(project)/skin/mainicon.png</iconurl> <updateurl>http://$(project).mozdev.org/update.rdf</updateurl> <type>2</type> <targetapplication> <
description> <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id> <minversion>2.0</minversion> <maxversion>9.0</maxversion> </
description> </targetapplication> </
description> </rdf> endef export install_rdf install.rdf: @echo generating $(project)/install.rdf @echo "$$install_rdf" > $(project)/install.rdf ###### define overlay_xul <overlay id="$(project)-overlay" xmlns="http://www.mozilla.o...
Tamarin Acceptance Test Template - Archive of obsolete content
delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the mpl, the gpl or the lgpl. * * ***** end license block ***** */ var section = "test"; // provide a document reference (ie, actionscript section) var version = "as3"; // version of ecmascript or actionscript var title = "test"; // provide ecma section title or a
description var bugnumber = ""; starttest(); // leave this alone /** * calls to addtestcase here. addtestcase is a function that is defined * in shell.as and takes three arguments: * - a string representation of what is being tested * - the expected result * - the actual result * * for example, a test might look like this: * * var helloworld = "hello world"; * * addtestcase( * "v...
... // leave this alone /** * calls to addtestcase here. addtestcase is a function that is defined * in shell.as and takes three arguments: * - a string representation of what is being tested * - the expected result * - the actual result * * for example, a test might look like this: * * var helloworld = "hello world"; * * addtestcase( * "var helloworld = 'hello world'", //
description of the test * "hello world", // expected result * helloworld ); // actual result * */ // add your tests here var helloworld = "hello world"; addtestcase( "var helloworld = 'hello world'", "hello world", helloworld ); test(); // leave this alone. this executes the test cases and // displays results. ...
Tamarin Build System Documentation - Archive of obsolete content
ach sandbox build occurs in the order they were submitted, the submitter may cancel a build. how do i build a sandbox build? create a user repository, instructions are https://developer.mozilla.org/en/publishing_mercurial_clones go to the request a sandbox build page http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm enter the repository url, revision number, email address, and
description. ...
...occurs in the order they were submitted, the submitter may cancel a build. how do i build a sandbox build? create a user repository, instructions are https://developer.mozilla.org/en/publishing_mercurial_clones go to the request a sandbox build page http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm enter the repository url, revision number, email address, and
description. ...
getFolder - Archive of obsolete content
parameters the getfolder method has the following parameters: foldername a string representing one of netscape's standard directories. there are two sets of possible values for this parameter. the first set contains platform-independent locations; the second set contains platform-specific locations. you are encouraged to use the platform-independent locations. see the list in the
description section for the two sets of locations. subdirectory a string that specifies the name of a subdirectory. if the specified subdirectory doesn't exist, it is created. this parameter is available in netscape 6 or later and may be case sensitive (depending on the operating system). localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getf...
...reated. this parameter is available in netscape 6 or later and may be case sensitive (depending on the operating system). localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getfolder. returns a filespecobject representing one of netscape's standard directories, or null in case of error or if subdirectory refers to a file that already exists.
description the getfolder method obtains an object representing one of netscape's standard directories, for use with the addfile and getwinprofile methods. the value of foldername must be one of the following (info is based on mozilla 1.7 stable branch, might also work in other versions): "chrome" "components" "current user" "defaults" "fil...
initInstall - Archive of obsolete content
the name can be absolute or relative. a relative pathname is relative to the netscape 6 namespace. a relative pathname must start with plugins/, to be relative to the plug-ins portion of that namespace or java/download/, to be relative to the java portion. all other parts of the netscape 6 area of the registry are reserved for use by netscape. the client version registry is a hierarchical
description of the software registered for use with netscape 6. the registry name provided here is not the location of the software on the machine, it is the location of information about the software inside the registry. this distinction is important when you add components with the addfile method. version an installversion object or a string representing the version of the package being inst...
... version an installversion object or a string representing the version of the package being installed. when version is a string it should be up to four integer values delimited by periods, such as "1.17.1999.1517". flags an optional field; reserved for future use. pass 0 as the default value. returns an integer error code. for a list of possible values, see return codes.
description the initinstall method initializes the installation of the specified software. you must call this method immediately after the constructor. it is an error to call any other install methods before calling initinstall. after calling initinstall, your script must call performinstall or cancelinstall before it finishes. if your script does not call performinstall or cancelinstall, netscape 6 will n...
Menus - Archive of obsolete content
ion will often wish to attach a new command to a menu. to do this, the new menu will need to be laid over the existing menu which the item should be displayed upon. for more information about how to use an overlay to modify a menu, see using menus and popups in extensions the following tables list the ids of menus in firefox that are commonly overlaid upon. firefox menus element id
description main-menubar the menubar element. menu_filepopup the menupopup associated with the 'file' menu. menu_editpopup the menupopup associated with the 'edit' menu. menu_viewpopup the menupopup associated with the 'view' menu. gopopup the menupopup associated with the 'go/history' menu. menu_toolspopup the menupopup associated w...
...nu. menu_toolspopup the menupopup associated with the 'tools' menu. menu_helppopup the menupopup associated with the 'help' menu. menu_viewsidebarmenu the menupopup for the 'sidebar' submenu on the 'view' menu. menuwebdeveloperpopup the menupopup for the 'web developer' submenu on the 'tools' menu. firefox context menu element id
description relevant context contentareacontextmenu the popup for the context menu when a web page is displayed in the browser area. spell-no-suggestions the no spelling suggestions item - notable as it is the first item on the context menu. editable text context-openlink opens a link in a new window links context-openlinkintab opens a link in...
appendNotification - Archive of obsolete content
ent as well. keep in mind that this is all xul so using html elements for styling might still need additional css in order to work as you might expect. value - value used to identify the notification image - url of image to appear on the notification. if "" then an icon appropriate for the priority level is used. priority - notification priority; see priority levels. buttons - array of button
descriptions to appear on the notification. eventcallback optional - a javascript function to call to notify you of interesting things that happen with the notification box. see notification box events. priority levels (defined as properties of notificationbox) : priority_info_low priority_info_medium priority_info_high priority_warning_low priority_warning_medium priority_warning_high priori...
...ication box. see notification box events. priority levels (defined as properties of notificationbox) : priority_info_low priority_info_medium priority_info_high priority_warning_low priority_warning_medium priority_warning_high priority_critical_low priority_critical_medium priority_critical_high priority_critical_block buttons : the buttons argument is an array of button
descriptions. each
description is an object with the following properties: accesskey - the accesskey to appear on the button callback - function to be called when the button is activated. this function is passed three arguments: the <notification> the button is associated with the button
description as passed to appendnotification. the element which was the target of the button press event. ...
Providing Command-Line Options - Archive of obsolete content
f the window to open. ...
... parameter passed to -viewapp on the command line."); } // changeme: change "myapp" to your command line flag (no argument) if (cmdline.handleflag("myapp", false)) { openwindow(chrome_uri, null); cmdline.preventdefault = true; } }, // changeme: change the help info as appropriate, but // follow the guidelines in nsicommandlinehandler.idl // specifically, flag
descriptions should start at // character 24, and lines should be wrapped at // 72 characters with embedded newlines, // and finally, the string should end with a newline helpinfo : " -myapp open my application\n" + " -viewapp <uri> view and edit the uri in my application,\n" + " wrapping this
description\n" }; var nsgetfactory = ...
Additional Navigation - Archive of obsolete content
g/dc/elements/1.1/" xmlns:r="http://www.xulplanet.com/rdf/"> <rdf:seq rdf:about="http://www.xulplanet.com/rdf/myphotos"> <rdf:li rdf:resource="http://www.xulplanet.com/ndeakin/images/t/palace.jpg"/> <rdf:li rdf:resource="http://www.xulplanet.com/ndeakin/images/t/canal.jpg"/> <rdf:li rdf:resource="http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg"/> </rdf:seq> <rdf:
description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" dc:title="palace from above"> <r:country resource="http://www.daml.org/2001/09/countries/iso#it"/> </rdf:
description> <rdf:
description rdf:about="http://www.xulplanet.com/ndeakin/images/t/canal.jpg" dc:title="canal"> <r:country resource="http://www.daml.org/2001/09/countries/iso#nl"/...
...="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" dc:title="palace from above"> <r:country resource="http://www.daml.org/2001/09/countries/iso#it"/> </rdf:
description> <rdf:
description rdf:about="http://www.xulplanet.com/ndeakin/images/t/canal.jpg" dc:title="canal"> <r:country resource="http://www.daml.org/2001/09/countries/iso#nl"/> </rdf:
description> <rdf:
description rdf:about="http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg" dc:title="obelisk"> <r:country resource="http://www.daml.org/2001/09/countries/iso#it"/> </rdf:
description> <rdf:
description about="http://www.daml.org/2001/09/countries/iso#it" dc:title="italy"/> <rdf:
description about="http://www.daml.org/2001/09/countries/i...
Result Generation - Archive of obsolete content
es. in this example, all the arrows have the same label. usually, this won't be the case. templates provide a means of navigating around using only arrows with specific labels. here is one serialization of rdf/xml for this graph, though there are many others. ...
...on="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rel="http://www.xulplanet.com/rdf/"> <rdf:
description rdf:about="http://www.xulplanet.com/rdf/a"> <rel:relateditem rdf:resource="http://www.xulplanet.com/rdf/b"/> <rel:relateditem rdf:resource="http://www.xulplanet.com/rdf/c"/> <rel:relateditem rdf:resource="http://www.xulplanet.com/rdf/d"/> </rdf:
description> <rdf:
description rdf:about="http://www.xulplanet.com/rdf/c"> <rel:relateditem rdf:resource="http://www.xulplanet.com/rdf/d"/> </rdf:
description> </rdf:rdf> for a xul template query, you first need to select a starting point in the rdf graph. once you have selected a starting point, you use a number of statements which indicate where to go next when navigating the graph. eventually, yo...
Using Multiple Queries to Generate More Results - Archive of obsolete content
y wasn't also matched by the first query, it will have content created for it. recall that when the member resource for a query matches several rules, only the earliest query that matches will have content generated for it. if resources don't overlap, we can generate content for two different parts of the rdf data. ...
...different parts of the rdf data. if we add the following data about people to the neighbourhood datasource: <rdf:
description rdf:about="http://www.xulplanet.com/rdf/myneighbourhood"> <r:people> <rdf:seq> <rdf:li rdf:resource="http://www.xulplanet.com/rdf/person/1"/> <rdf:li rdf:resource="http://www.xulplanet.com/rdf/person/2"/> </rdf:seq> </r:people> </rdf:
description> <rdf:
description rdf:about="http://www.xulplanet.com/rdf/person/1" dc:title="nathan"/> <rdf:
description rdf:about="http://www.xulplanet.com/rdf/person/2" dc:title="karen"/> we can then use two queries to generate results from different parts of the datasource. the first query will match the streets as before, but the second query will generate a resul...
Adding Methods to XBL-defined Elements - Archive of obsolete content
hods. this is why we have to get the parent first. the children of an element placed in the xul file can be retrieved in the normal way and don't move even if you use the children tag. for example: xul: <box id="outer" class="container"> <button label="one"/> <button label="two"/> <button label="three"/> <button label="four"/> </box> xbl: <binding id="labeledbutton"> <content> <
description value="a stack:"/> <stack> <children/> </stack> </content> </binding> if you use the dom functions such as childnodes to get the children of the the xul box element with the id of outer, you willl find that it has has 4 children. these correspond to its four buttons, even though those buttons are drawn inside the stack. the stack has only one child, the children element itself. t...
...nding> if you use the dom functions such as childnodes to get the children of the the xul box element with the id of outer, you willl find that it has has 4 children. these correspond to its four buttons, even though those buttons are drawn inside the stack. the stack has only one child, the children element itself. the length of the anonymous array of the outer box is two, the first element the
description element and the second the stack element. constructors and destructors xbl supports two special methods created with separate tags, constructor and destructor. a constructor is called whenever the binding is attached to an element. it is used to initialize the content such as loading preferences or setting the default values of fields. the destructor is called when a binding is removed from an ...
Advanced Rules - Archive of obsolete content
. . you want to display a row in a tree for each city. to do this, use the member element as in the following: <tree id="citiestree" datasources="weather.rdf" ref="http://www.xulplanet.com/rdf/weather/cities"> <template> <rule> <conditions> <content uri="?l...
.... . you want to display a row in a tree for each city. ...
Creating Dialogs - Archive of obsolete content
the dialog element has some additional attributes that windows do not have. the buttons attribute is used to specify which buttons should appear in the dialog. the following values may be used, seperated by commas: accept - an ok button cancel - a cancel button help - a help button disclosure - a di...
... buttons="accept,cancel" buttonlabelaccept="set favourite" buttonaccesskeyaccept="s" ondialogaccept="return dosave();" buttonlabelcancel="cancel" buttonaccesskeycancel="n" ondialogcancel="return docancel();"> <script> function dosave(){ //dosomething() return true; } function docancel(){ return true; } </script> <dialogheader title="my dialog"
description="example dialog"/> <groupbox flex="1"> <caption label="select favourite fruit"/> <radio id="orange" label="oranges because they are fruity"/> <radio id="violet" selected="true" label="strawberries because of their colour"/> <radio id="yellow" label="bananas because they are pre-packaged"/> </groupbox> </dialog> the buttons elements can be accessed with the following javascript // the ...
Element Positioning - Archive of obsolete content
has a minimum width or height, the children cannot shrink smaller than that minimum size. examples of setting widths and heights <button label="1" style="width: 100px;"/> <button label="2" style="width: 100em; height: 10px;"/> <button label="3" flex="1" style="min-width: 50px;"/> <button label="4" flex="1" style="min-height: 2ex; max-width: 100px"/> <textbox flex="1" style="max-width: 10em;"/> <
description style="max-width: 50px">this is some boring but simple wrapping text.</
description> example 1 the first button will be displayed with a width of 100 pixels (px means pixels). you need to add the unit or the width will be ignored. example 2 the second button will be displayed with a height of ten pixels and a width of 100 ems (an em is the size of a character in the current font). exampl...
...ually the height of the letter x in the current font) or wider than 100 pixels. example 5 the text input is flexible but will never grow to be larger than 10 ems. you will often want to use ems when specifying sizes with text in them. this unit is useful for textboxes so that the font can change and the textboxes would always be a suitable size, even if the font is very large. example 6 the
description element is constrained to have a maximum width of 50 pixels. the text inside will wrap to the next line, after fifty pixels. our find files dialog let's add some of these styles to the find files dialog. we'll make it so that the textbox will resize to fit the entire window. <textbox id="find-text" flex="1" style="min-width: 15em;"/> here, the text input has been made flexible. this way,...
Popup Menus - Archive of obsolete content
example, the user can either press the control key and click the mouse button, or hold the mouse button down for a moment. also note that it is possible to open context menus without using the mouse, for example by pressing the menu key on a keyboard. tooltips a tooltip popup window will appear when the user hovers over an element with the mouse. this type of popup is usually used to provide a
description of a button in more detail than can be provided on the button itself. all three types of popups differ in the way that the user invokes them. the type of popup is determined by the element that invokes the popup. declaring popup content a popup is described using the menupopup element. it has no special attributes and is a type of box. when invoked, it will display a window containing whateve...
...e content of a tooltip. this requires you to have a separate block of content for each tooltip or to have a script which sets the content. however, it does allow you to use any content besides text in a tooltip. example 2 : source view <button label="save" tooltiptext="click here to save your stuff"/> <popupset> <tooltip id="moretip" orient="vertical" style="background-color: #33dd00;"> <
description value="click here to see more information"/> <
description value="really!" style="color: red;"/> </tooltip> </popupset> <button label="more" tooltip="moretip"/> these two buttons each have a tooltip. the first uses the default tooltip style. the second uses a custom tooltip that has a different background color and styled text. the tooltip is associated with the more button using the tool...
Tabboxes - Archive of obsolete content
the label across the top and the search criteria box will need to go on the first tab. we'll add some options on the second tab. the progress bar and the buttons can stay on the main dialog, outside of the tabs. ...
... on the second tab. the progress bar and the buttons can stay on the main dialog, outside of the tabs. <vbox flex="1"> <tabbox selectedindex="1"> <tabs> <tab label="search"/> <tab label="options"/> </tabs> <tabpanels> <tabpanel id="searchpanel" orient="vertical"> <
description> enter your search criteria below and select the find button to begin the search. ...
Templates - Archive of obsolete content
atches it. all of the attributes placed on the rule tag are used as match criteria. in this case, the bookmarks datasource supplies a rdf:type property to distinguish separators. this attribute is set to a special value for separators in the rdf bookmarks datasource. this is how we can distinguish them from non-separators. you can use a similar technique for any attribute that might be on an rdf
description element. the special url value given in the example above for the first rule is used for separators. that means that separators will follow rule one and generate a spacer element, which will display a 16 pixel gap. elements that are not separators will not match rule one and will fall through to rule two. rule two does not have any attributes on it. this means that it will match all data. this i...
...in order to match them. you should be able to guess what would happen if the second rule was removed. the result would be a single spacer displayed but no bookmarks because they don't match any of the rules. put simply, a rule matches if all of the attributes placed on the rule element match the corresponding attributes on the rdf resource. in the case of an rdf file, the resources would be the
description elements. there are some small exceptions however. you cannot match based on the attributes id, rdf:property or rdf:instanceof. because you can just use your own attributes with your own namespace, it probably doesn't really matter anyway. note that a template with no rules in it, as in the first example, is really equivalent functionally to a template with a single rule with no attributes. ne...
The Box Model - Archive of obsolete content
. we should really use the grid element here to fix this which we'll learn about in a later section. our find files dialog example let's add some boxes to the find files dialog. a vertical box will be added around all of the elements, and a horizontal box with be added around the textbox and the buttons. the result will be that the buttons will appear below the textbox. ...
...r find files dialog example let's add some boxes to the find files dialog. a vertical box will be added around all of the elements, and a horizontal box with be added around the textbox and the buttons. the result will be that the buttons will appear below the textbox. <vbox flex="1"> <
description> enter your search criteria below and select the find button to begin the search. </
description> <hbox> <label value="search for:" control="find-text"/> <textbox id="find-text"/> </hbox> <hbox> <spacer flex="1"/> <button id="find-button" label="find"/> <button id="cancel-button" label="cancel"/> </hbox> </vbox> the vertical box causes the main text, the box with the textbox and the box with the buttons to orient vertically. the inner boxes orient th...
XBL Attribute Inheritance - Archive of obsolete content
e xbl. this technique is used to set the default value if the attribute is not present. this button will inherit its label attribute from the outer element. however, if no label is present, it will be given a default value of ok. there may be times where two generated elements need to inherit from an attribute that has the same name. for example, to create a labeled textbox (a textbox with a text
description beside it) out of a label and a textbox element, the label will need to inherit its text from the value attribute and the textbox will also need to inherit its default value from the value attribute as well. to solve this, we will need to use a different attribute and map it to the same one. the following demonstrates this: xul: <box class="labeledtextbox" title="enter some text:" value="ok"/> ...
.../box> note that the attributes are duplicated on the inner (anonymous) content. changing the attributes on the box with the okcancel class will automatically change the values on the buttons. you may also have noticed that we just made up our own attribute names. this is valid in xul. if you need to map an attribute to the text content of the node, use "xbl:text" as the inner attribute, eg: <xul:
description xbl:inherits="xbl:text=value"/> in the next section, we look at adding properties, methods and events to a binding. « previousnext » ...
XBL Example - Archive of obsolete content
od 'setpage' is called which will be defined later. an oncommand handler will need to be added to the previous and next buttons so that the page is changed when the buttons are pressed. conveniently, we can change the page using the custom 'page' property that was just added: <xul:button xbl:inherits="label=previoustext" oncommand="parentnode.parentnode.parentnode.page--;"/> <xul:
description flex="1"/> <xul:button xbl:inherits="label=nexttext" oncommand="parentnode.parentnode.parentnode.page++;"/> because the 'page' property is only on the outer xul element, we need to to use the parentnode property to get to it. the first parentnode returns the parent of the button which is the horizontal box, the second its parent, the vertical box, and finally, its parent which is...
... the final code the final code is as follows: example 2 : source <binding id="slideshow"> <content> <xul:vbox flex="1"> <xul:deck xbl:inherits="selectedindex" selectedindex="0" flex="1"> <children/> </xul:deck> <xul:hbox> <xul:button xbl:inherits="label=previoustext" oncommand="parentnode.parentnode.parentnode.page--;"/> <xul:
description flex="1"/> <xul:button xbl:inherits="label=nexttext" oncommand="parentnode.parentnode.parentnode.page++;"/> </xul:hbox> </xul:vbox> </content> <implementation> <constructor> var totalpages=this.childnodes.length; document.getanonymousnodes(this)[0].childnodes[1].childnodes[1] .setattribute("value",(this.page+1)+" of "+total...
XUL Reference - Archive of obsolete content
« xul reference « alphabetical list of all xul elements action arrowscrollbox assign bbox binding bindings box broadcaster broadcasterset button browser checkbox caption clicktoscroll colorpicker column columns commandset command conditions content datepicker deck
description dialog dialogheader dropmarker editor grid grippy groupbox hbox iframe image key keyset label listbox listcell listcol listcols listhead listheader listitem member menu menubar menuitem menulist menupopup menuseparator notification notificationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer richlistbox richlistitem row rows rule scale script scr...
...bar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tabbox tabs tab tabpanels tabpanel groupbox caption separator spacer button checkbox colorpicker datepicker menulist progressmeter radio radiogroup scale splitter textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker
description label image listbox listitem listcell listcol listcols listhead listheader richlistbox richlistitem tree treecell treechildren treecol treecols treeitem treerow treeseparator box hbox vbox bbox deck stack grid columns column rows row scrollbox action assign binding bindings conditions content member param query queryset rule template textnode triple w...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
this table is designed to show how to expose text properly for various xul element types. sections in bold are to draw attention to pieces that are often overlooked for visual layouts. underlined text may be read by the screen reader. element enabled usage comments
description <
description value="<!-- text -->" /> <
description><!--label text--></
description> use for non-label text. although tutorials claim label and
description have the same underlying implementation,
description elements appear to not associate correctly with controls whereas labels do. label <label control="controlid" value="<!--label text-->" /> <label control="controlid"><!--label text--></label> either syntax is fine. button <button l...
...ers themselves (for sorting by column). these functions must be replicated elsewhere (like in the main menu, e.g. the manage bookmarks window in firefox 2 or the places window in firefox 3). jaws 7.10 can not read the column headers. the main tree is accessible like a regular tree control. ...
XUL controls - Archive of obsolete content
ar grid for selecting a date. <datepicker type="grid" value="2007/02/20"/> datepicker reference <datepicker type="popup" > a datepicker which displays a set of textboxes for date entry, but also has a button for displaying a popup calendar grid. <datepicker type="popup" value="2008/08/24"/> datepicker reference <
description> the
description element is used for descriptive text. <
description> select a time for the event to start </
description> more information about the
description element.
description reference <groupbox> a groupbox displays a labelled box around other user interface controls. <groupbox> <caption label="network"/> </groupbox> ...
...r with a thumb that may be slid across the bar to select between a range of values. <scale min="1" max="10"/> scale reference <splitter> allows the user to adjust the division of space between elements. <splitter collapse="before"> <grippy/> </splitter> splitter reference related elements: grippy <tab>
description goes here. <tab label="firefox"/> tab reference related elements: tabs tabbox tabpanels <textbox> a textbox which allows a single line of text to be entered. <textbox value="firefox"/> more information about the textbox element. textbox reference <textbox multiline="true"> a textbox which allows mul...
menuitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single choice in a menupopup element. it acts much like a button but it is rendered on a menu. more information is available in the xul tutorial. ...
...ays appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; }
description type: string descriptive text to appear in addition to the dialog title. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the cas...
notificationbox - Archive of obsolete content
ent as well. keep in mind that this is all xul so using html elements for styling might still need additional css in order to work as you might expect. value - value used to identify the notification image - url of image to appear on the notification. if "" then an icon appropriate for the priority level is used. priority - notification priority; see priority levels. buttons - array of button
descriptions to appear on the notification. eventcallback optional - a javascript function to call to notify you of interesting things that happen with the notification box. see notification box events. priority levels (defined as properties of notificationbox) : priority_info_low priority_info_medium priority_info_high priority_warning_low priority_warning_medium priority_warning_high priori...
...ication box. see notification box events. priority levels (defined as properties of notificationbox) : priority_info_low priority_info_medium priority_info_high priority_warning_low priority_warning_medium priority_warning_high priority_critical_low priority_critical_medium priority_critical_high priority_critical_block buttons : the buttons argument is an array of button
descriptions. each
description is an object with the following properties: accesskey - the accesskey to appear on the button callback - function to be called when the button is activated. this function is passed three arguments: the <notification> the button is associated with the button
description as passed to appendnotification. the element which was the target of the button press event. ...
panel - Archive of obsolete content
popuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, titlebar, top, type properties accessibletype, label, popupboxobject, popup, state methods hidepopup, moveto, openpopup, openpopupatscreen, sizeto examples the following example shows how a panel may be attached to a label. <panel id="thepanel"> <hbox align="start"> <image src="warning.png"/> <vbox> <
description value="you have 6 new messages."/> <hbox> <button label="read mail"/> <button label="new message"/> </hbox> </vbox> </hbox> </panel> <
description value="6 new messages" popup="thepanel"/> attributes backdrag type: boolean setting the backdrag attribute on a xul panel lets the user move the panel by clicking and dragging anywhere on its background area. ...
... popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. position possible values for position are: before_start, before_end, after_start, after_end, start_before, start_after, end_before, end_after, overlap, and after_pointer. check positioning of the popup guide for a precise
description of the effect of the different values. x, y for an anchored popup, the x and y arguments may be used to offset the popup from its anchored position by some number, measured in css pixels. an unanchored popup appears at the position specified by x and y, relative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are...
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
a.org/en/docs/getting_started_with_xulrunner appupdatesurl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner defaultdirname={pf}\my app defaultgroupname=my app allownoicons=yes outputdir=..\build\output outputbasefilename=myapp-1.0-win32 ; setupiconfile= compression=lzma solidcompression=yes [languages] name: english; messagesfile: compiler:default.isl [components] name: main;
description: my app; types: full compact custom; flags: fixed name: runtime;
description: xul runner runtime; types: full custom [tasks] name: desktopicon;
description: {cm:createdesktopicon}; group
description: {cm:additionalicons}; flags: unchecked name: quicklaunchicon;
description: {cm:createquicklaunchicon}; group
description: {cm:additionalicons}; flags: unchecked [files] source: c:\develop\xulrunnerin...
...this will create the compiler, which you need to test by actually trying to install your xulrunner application. don't forget to then test the installed application to be sure the ...
Getting started with XULRunner - Archive of obsolete content
most xul applications will include some external javascript, so the sample application does too,...
...ymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://myapp/content/main.js"/> <caption label="hello world"/> <separator/> <button label="more >>" oncommand="showmore();"/> <separator/> <
description id="more-text" hidden="true">this is a simple xulrunner application. xul is simple to use and quite powerful and can even be used on mobile devices.</
description> </window> note: make sure there is no extra whitespace at the beginning of the xml/xul file the application also has a javascript file. most xul applications will include some external javascript, so the sample application does too, just to show how to include it into the xul file. main.js: function showmore() { document.getelementbyid("more-text").hidden = false; } for more informati...
NPEvent - Archive of obsolete content
t on unix/x11 npevent is defined as an xevent data structure, which is a union of a number of different x11 event structures. type the type member is an int representing an event type, and indicating which structure is relevant. the event type may be any of the ollowing: graphicsexpose focusin focusout enternotify leavenotify motionnotify buttonpress buttonrelease keypress keyrelease
description microsoft windows
description the type npevent represents an event passed by npp_handleevent() to a windowless plug-in. for information about these events, see your microsoft windows documentation. mac os
description the npevent object represents an event passed by npp_handleevent() to a windowless plug-in. this structure is defined as eventrecord, the event type used by mac os. on mac os, plug-...
...ey to move the focus. no key events are sent to the instance until the next getfocusevent. adjustcursorevent: sent when the mouse enters or leaves the bounds of the instance. if your plug-in wants to set the cursor when the mouse is within the instance, set the cursor and return true. if you don't want a special cursor, return false and the browser will use the standard arrow cursor. xwindows
description the npevent object represents an event passed by npp_handleevent() to a windowless plug-in. the npevent structure is defined as xevent, the definition of the event type used by the xwindows platform. for information about the xevent structure and xwindows events, see the xwindows documentation. as the xevents sent to the plug-in are synthesized and there is not a native window corresponding to th...
NPN_GetURLNotify - Archive of obsolete content
instance pointer to the current plug-in instance. url pointer to the url of the request. can be of any type, such as http, ftp, news, or mailto. target name of the target window or frame, or one of several special target names. for values, see npn_geturl(). ...
...eral special target names. for values, see npn_geturl(). notifydata plug-in-private value for associating the request with the subsequent npp_urlnotify() call, which passes this value (see
description below). returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes.
description npn_geturlnotify() works just like npn_geturl(), with one exception: npn_geturlnotify() notifies the plug-in instance upon successful or unsuccessful completion of the request by calling the plug-in's npp_urlnotify() function and passing it the notifydata value. npn_geturlnotify() typically handles the url request asynchronously. it returns immediately and only later handles the request and cal...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
c subdirectories. instead, you need to place the different plugin libraries into the plugins directory. for example: plugins/ libplugin.so libplugin.dylib install manifest the install manifest describes the plugin to the user. ...
...manifest describes the plugin to the user. for a plugin the manifest only needs to be very simple: <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <em:id>mypluginid@myplugin.com</em:id> <em:name>my plugin</em:name> <em:version>1.0</em:version> <em:targetapplication> <
description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>1.5</em:minversion> <em:maxversion>4.0.*</em:maxversion> </
description> </em:targetapplication> <em:unpack>true</em:unpack> </
description> </rdf> this contains 5 required pieces of information. every add-on must have a unique id. this can be in a guid form but the simpler email form is...
Introduction to Public-Key Cryptography - Archive of obsolete content
t first obtain an object-signing certificate. types of certificates common types of certificates include the following: client ssl certificates. used to identify clients to servers via ssl (client authentication). typically, the identity of the client is assumed to be the same as the identity of a human being, such as an employee in an enterprise. see "certificate-based authentication" for a
description of the way client ssl certificates are used for client authentication. client ssl certificates can also be used as part of a single sign-on solution. examples: a bank gives a customer a client ssl certificate that allows the bank's servers to identify that customer and authorize access to the customer's accounts. a company might give a new employee a client ssl certificate that allows the com...
...ence of a certificate for the issuing ca at any point in the certificate chain causes authentication to fail. for example, figure 10 shows how verification fails if neither the root ca certificate nor any of the intermediate ca certificates are included in the verifier's local database. for general information about the way digital signatures work, see "digital signatures". for a more detailed
description of the signature verification process in the context of ssl client and server authentication, see "introduction to ssl." managing certificates certificates are used in many applications, from encrypting email to accessing websites. there are two major stages in the lifecycle of a certificate: the point when it is issued (issuance and enrollment) and the period when the certificates are no longe...
Theme changes in Firefox 3 - Archive of obsolete content
anged xul file and the theme's corresponding css file that you might need to update. filename css file details changes to the default theme the table below lists changes made in the default theme for firefox 3; you can use this information as a starting point for figuring out the changes you need to make. all file list all platforms file
description of change browser/themes/*/browser/browser.css the width of the drag and drop indicator is no longer calculated during the drag (tabbrowser.xml). instead a '-moz-margin-start' property must be added to .tab-drop-indicator-bar, with a value that is half of the width of the indicator image. also, the visibility of the indicator is now controlled by setting collapsed in tabbrowser.xml. a...
...ser.xml). instead a '-moz-margin-start' property must be added to .tab-drop-indicator-bar, with a value that is half of the width of the indicator image. also, the visibility of the indicator is now controlled by setting collapsed in tabbrowser.xml. as a result, the 'display' property should be removed from .tab-drop-indicator-bar (including for dragging="true"). mac os x file
description of change browser/themes/pinstripe/browser/tabbrowser/tabdragindicator.png removed superfluous blank pixels from the edges, so that the image is smaller. may or may not affect other mac themes that use it. browser/themes/pinstripe/browser/browser.css .tabbrowser-tab[first-tab="true"] > .tab-image-left no longer has a margin-left. instead .tabs-left now displayed and given ...
E4X for templating - Archive of obsolete content
, <toolbarbutton label={$s('mytoolbar.label')}/> conditionals function _if (cond, h, _else) { if (cond && cond != undefined) { // we need undefined condition for e4x return h(cond); } else if (_else) { return _else(cond); } return ''; // empty string allows conditions in attribute as well as element content } for example: {_if(elems.length(), function () <
description>{elems[0]}</
description>, function _else () <label>no data</label> )} note that the simple xmllist() constructor (<></>) may be useful to still be able to use an expression closure (i.e., without needing return statements and braces): {_if(elems.length(), function () <> <markup/> <markup/> </>)} note that, while it is convenient to store such e4x in separate file templates...
... } if (it > max) { break; } ret+=h(k, arr[k], it, lev); ++it; } } return ret; } the following real case example iterates over an array of the lines in an e4x child element to produce an xmllist of multiple vbox's representing each line: <vbox> {foreach(e(someel.somechild[0]).split('\n'), function (line) <
description>{line}</
description> )} </vbox> the following example shows iteration over an e4x object itself: {foreach(elems, function (k, elem, iter) <> <row>{k}: {elem}</row> <row><image src="chrome://myext/skin/images/fillerrow.jpg" /></row> </>)} or if the e4x child element had its own children and text: {foreach(elems, function (k, elem, iter) <> <row>{k}: {elem.text()} {elem.somechild}...
Debug - Archive of obsolete content
splay strings in the visual studio output window at run time. to debug internet explorer scripts, you must have a script debugger installed and the script must run in debug mode. internet explorer 8 and later versions include the javascript debugger. if the script is not being debugged, the debug methods and properties have no effect. constants async callback status codes contant
description value debug.ms_async_callback_status_assign_delegate the synchronous work item assigned a callback or continuation to be run by an asynchronous operation. 0 debug.ms_async_callback_status_join the synchronous work item satisfied part of a join asynchronous operation. 1 debug.ms_async_callback_status_chooseany the synchronous work item satisfied a choic...
... debug.ms_async_callback_status_chooseany the synchronous work item satisfied a choice asynchronous operation. 2 debug.ms_async_callback_status_cancel the synchronous work item was canceled. 3 debug.ms_async_callback_status_error the synchronous work item caused an error in an asynchronous operation. 4 async operation status codes contant
description value debug.ms_async_op_status_success the asynchronous operation was successful. 1 debug.ms_async_op_status_canceled the asynchronous operation was canceled. 2 debug.ms_async_op_status_error the asynchronous operation resulted in an error. 3 properties debug.debuggerenabled determines whether debugging is enabled for the script context. ...
New in JavaScript 1.8.5 - Archive of obsolete content
bug 492840 object.defineproperty() adds the named property described by a given descriptor to an object. ...
...thod. other standardization work various non-standard syntaxes for defining getters and setters have been removed; ecmascript 5 defined syntax has not been changed. these were all pretty esoteric and rarely used; if this affects you, see this blog post for details. new objects object
description old proxy api offers support for creating object and function proxies that enable meta-programming in javascript. changed functionality in javascript 1.8.5 iso 8601 support in date: the date object's parse() method now supports simple iso 8601 format date strings.
Old Proxy API - Archive of obsolete content
ed, then an error is thrown. if a derived trap is implemented, then that trap's code is called whenever the corresponding behavior happens on the proxy. if the derived trap is undefined, a default implementation using the fundamental traps is used. in other words: fundamental traps are required, derived traps are optional. fundamental traps emulated javascript code handler method
description object.getownpropertydescriptor(proxy, name) getownpropertydescriptor: function(name) -> propertydescriptor | undefined should return a valid property descriptor object, or undefined to indicate that no property with name exists in the emulated object. object.getpropertydescriptor(proxy, name) getpropertydescriptor: function(name) -> propertydescriptor | undefined th...
...ect has the same object identity as the proxy object. if fix() returns undefined, the call throws a typeerror exception. derived traps default implementation refers to the code that is called for that trap when the trap isn't explicitly defined. in these functions, this refers to the handler object. ...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
ven down to the required time travel. i dove right in and decided to have some fun with with the redesign, which is why i rather like the final result. to share the joy, i herein present a look into just one piece of the redesign, and how i accomplished certain effects using simple html and some css. marking up the fish in the old fish cam page, there was a table that contained the pictures and
descriptions of the fish. well, i couldn't letthat continue—fish are flexible, slippery things, and tables are very much not. so i decided to break up the content so that there is a self-contained bit of markup for each fish, and then get down to styling. here's what one of those bits looks like once all the css has been applied. in order to make the fish cam page as agile as the fish themselves, it was...
...<img src="thumb_clown_trigger.jpg" alt="clown trigger" border="0" width="150" height="115"> <h3>clown trigger</h3> <p> our clown trigger is a bold little fish, though for a few weeks he slept a lot and didn't look well in general. he's much better now. </p> </div> basically, that's all that was needed. the reason for the class value being card is that the original idea was to style each fish's
description like a trading card. although this design approach was abandoned fairly quickly, the class name stuck, kind of like a barnacle. giving the fish some style with the markup all set, it was time to style. the idea was to have the fish listed in a side-by-side arrangement, sort of like a two-column table, only without the table. this was most easily accomplished by floating the div elements themsel...
Mozilla XForms User Interface - Archive of obsolete content
accesskey - keyboard shortcut for moving focus to an xforms element. binding attributes single-node (see the spec) and node-set (see the spec) attributes are used to bind xforms elements to instance nodes. these attributes are: ref, nodeset, model and bind. xforms elements almost every xforms element can be presented as one of serveral different kinds of widgets. this section contains a short
description of each xforms element and its representation. the xforms specification offers suggestions for some of the representations, but some of the widgets we use are only available in the mozilla xforms processor. the choice of widget that we use is often determined by the data type of the instance node that the xforms element is bound to. the form author can also influence the widget by using the appea...
...gestions for some of the representations, but some of the widgets we use are only available in the mozilla xforms processor. the choice of widget that we use is often determined by the data type of the instance node that the xforms element is bound to. the form author can also influence the widget by using the appearance attribute on the element. form controls module this section contains a short
description for each form control element. input a key xforms element to show and change the instance data to which it is bound. usually bound to data that can be well-represented by a string (see the spec). it can have the following representations: text field - default representation. used for most data types, especially text data. checkbox - used for boolean instance data datepicker - default repre...
Visual typescript game engine - Game development
- dragging is script for dragging dom elements. */ private addson: addson = [ { name: "cache", enabled: true, scriptpath: "externals/cacheinit.ts", }, { name: "hackertimer", enabled: true, scriptpath: "externals/hack-timer.js", }, { name: "dragging", enabled: true, scriptpath: "externals/drag.ts", }, ]; /** * @
description this is main coordinary types of positions * can be "diametric-fullscreen" or "frame". * @property drawreference * @type string */ private drawreference: string = "frame"; /** * aspectratio default value, can be changed in run time. */ private aspectratio: number = 1.333; /** * domain is simple url address, * recommendent to use for local propose lan ip * lik...
... private rtcserverport: number = 12034; /** * connectorport is access port used to connect * session web socket. */ private connectorport: number = 1234; /** * broadcasterport port used to connect multimedia server multirtc3. * i will use it for explicit video chat multiplatform support. * default value is 9001 */ private broadcasterport: number = 9001; /** * @
description important note for this property: if you * disable (false) you cant use account system or any other * network. use 'false' if you wanna make single player game. * in other way keep it 'true'. */ private appusenetwork = false; /** * appuseaccountssystem if you don't want to use session * in your application just setup this variable to the false. */ private appuseaccount...
RDF - MDN Web Docs Glossary: Definitions of Web-related terms
rdf (resource
description framework) is a language developed by w3c for representing information on the world wide web, such as webpages. rdf provides a standard way of encoding resource information so that it can be exchanged in a fully automated way between applications. ...
... rdf (resource
description framework) is a language developed by w3c for representing information on the world wide web, such as webpages. rdf provides a standard way of encoding resource information so that it can be exchanged in a fully automated way between applications. ...
SDP - MDN Web Docs Glossary: Definitions of Web-related terms
sdp (session
description protocol) is the standard describing a peer-to-peer connection. sdp contains the codec, source address, and timing information of audio and video. here is a typical sdp message: v=0 o=alice 2890844526 2890844526 in ip4 host.anywhere.com s= c=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0 pcmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 sdp is never used alone, but by protocols like rtp and rtsp. sdp is also as component of webrtc, which uses sdp as a way of describing a session. ...
...=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0 pcmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 sdp is never used alone, but by protocols like rtp and rtsp. sdp is also as component of webrtc, which uses sdp as a way of describing a session. learn more general knowledge webrtc protocols session
description protocol on wikipedia ...
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, symbol is a primitive value. a value having the data type symbol can be referred to as a "symbol value". in a javascript runtime environment, a symbol value is created by invoking the function symbol, which dynamically produces an anonymous, unique value. a symbol may be used as an object property. symbol can have an optional
description, but for debugging purposes only. a symbol value represents a unique identifier. for example: // here are two symbols with the same
description: let sym1 = symbol("sym") let sym2 = symbol("sym") console.log(sym1 === sym2) // returns "false" // symbols are guaranteed to be unique. // even if we create many symbols with the same
description, // they are different values. note: if you are familiar with ruby's (or another language) that al...
...sym) // typeerror: cannot convert a symbol value to a string that’s a "language guard" against messing up, because strings and symbols are fundamentally different, and should not occasionally convert one into another. if you really want to show a symbol, we need to call .tostring() on it. let sym = symbol("sym") alert(sym.tostring()) // symbol(sym), now it works or you can use the symbol.
description property to get its
description: let _sym = symbol("sym"); alert(_sym.
description); // sym well-known symbols the symbol class has constants for so-called well-known symbols. these symbols let you configure how js treats an object, by using them as property keys. examples of well-known symbols are: symbol.iterator for array-like objects, or symbol.search for string objects. they are listed ...
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
requests to alter its state. ...
...ot changing the state for the server: get /pagex.html http/1.1 a call to a non-safe method, that may change the state of the server: post /pagex.html http/1.1 a call to an idempotent but non-safe method: delete /idx/delete http/1.1 learn more general knowledge definition of safe in the http specification. technical knowledge
description of common safe methods: get, head, options
description of common unsafe methods: put, delete, post ...
Test your skills: WAI-ARIA - Learn web development
ating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. wai-aria 3 for this final wai-aria task, we return to an example we previously saw in the css and javascript skilltest. as before, we have a simple app that presents a list of animal names. ...
... assessment or further help you can practice these examples in the interactive editors above. ...
Attribute selectors - Learn web development
to html), and an idea of how css works (study css first steps.) objective: to learn what attribute selectors are and how to use them. presence and value selectors these selectors enable the selection of an element based on the presence of an attribute alone (for example href), or on various different matches against the value of the attribute. selector example
description [attr] a[title] matches elements with an attr attribute (whose name is the value in square brackets). [attr=value] a[href="https://example.com"] matches elements with an attr attribute whose value is exactly value — the string inside the quotes. [attr~=value] p[class~="special"] matches elements with an attr attribute whose value is ex...
...ms. substring matching selectors these selectors allow for more advanced matching of substrings inside the value of your attribute. for example, if you had classes of box-warning and box-error and wanted to match everything that started with the string "box-", you could use [class^="box-"] to select them both (or [class|="box"] as described in section above). selector example
description [attr^=value] li[class^="box-"] matches elements with an attr attribute (whose name is the value in square brackets), whose value begins with value. [attr$=value] li[class$="-box"] matches elements with an attr attribute whose value ends with value. [attr*=value] li[class*="box"] matches elements with an attr attribute whose value contains value an...
Pseudo-classes and pseudo-elements - Learn web development
k at the content property to see what is being added to the document. reference section there are a large number of pseudo-classes and pseudo-elements, and it is useful to have a list to refer to. below are tables listing them, with links to their reference pages on mdn. use this as a reference to see the kind of things that are available for you to target. pseudo-classes selector
description :active matches when the user activates (for example clicks on) an element. :any-link matches both the :link and :visited states of a link. :blank matches an <input> element whose input value is empty. :checked matches a radio button or checkbox in the selected state. :current matches the element, or an ancestor of the element, that ...
... the root of the document. :scope matches any element that is a scope element. :valid matches an element such as an <input> element, in a valid state. :target matches an element if it is the target of the current url (i.e. if it has an id matching the current url fragment). :visited matches visited links. pseudo-elements selector
description ::after matches a stylable element appearing after the originating element's actual content. ::before matches a stylable element appearing before the originating element's actual content. ::first-letter matches the first letter of the element. ::first-line matches the first line of the containing element. ::grammar-error matches a po...
Basic native form controls - Learn web development
ecked. if they are not checked, nothing is sent, not even their name. if they are checked but have no value, the name is sent with a value of on. note: you can find the examples from this section on github as checkable-items.html (see it live also). for maximum usability/accessibility, you are advised to surround each list of related items in a <fieldset>, with a <legend> providing an overall
description of the list. each individual pair of <label>/<input> elements should be contained in its own list item (or similar). the associated <label> is generally placed immediately after the radio button or checkbox, with the instructions for the group of radio button or checkboxes generally being the content of the <legend>. see the examples linked above for structural examples. check box a check box ...
...ure=camcorder"> <input type="file" accept="audio/*;capture=microphone"> common attributes many of the elements used to define form controls have some of their own specific attributes. however, there is a set of attributes common to all form elements. you've met some of these already, but below is a list of those common attributes, for your reference: attribute name default value
description autofocus false this boolean attribute lets you specify that the element should automatically have input focus when the page loads. only one form-associated element in a document can have this attribute specified. disabled false this boolean attribute indicates that the user cannot interact with the element. if this attribute is not specified, the element inherit...
Getting started with HTML - Learn web development
n element another example of an element is <a>. this stands for anchor. an anchor can make the text it encloses into a hyperlink. anchors can take a number of attributes, but several are as follows: href: this attribute's value specifies the web address for the link. for example: href="https://www.mozilla.org/". title: the title attribute specifies extra information about the link, such as a
description of the page that is being linked to. for example, title="the mozilla homepage". this appears as a tooltip when a cursor hovers over the element. target: the target attribute specifies the browsing context used to display the link. for example, target="_blank" will display the link in a new tab. if you want to display the linked content in the current tab, just omit this attribute. edit the lin...
... that counts as a valid doctype. that is all you need to know! <html></html>: the <html> element. this element wraps all the content on the page. it is sometimes known as the root element. <head></head>: the <head> element. this element acts as a container for everything you want to include on the html page, that isn't the content the page will show to viewers. this includes keywords and a page
description that would appear in search results, css to style content, character set declarations, and more. you'll learn more about this in the next article of the series. <meta charset="utf-8">: this element specifies the character set for your document to utf-8, which includes most characters from the vast majority of human written languages. with this setting, the page can now handle any textual content...
Video and audio content - Learn web development
eo at which each text string should be displayed, and even limited styling/positioning information. these text strings are called cues, and there are several kinds of cues which are used for different purposes. the most common cues are: subtitles translations of foreign material, for people who don't understand the words spoken in the audio. captions synchronized transcriptions of dialog or
descriptions of significant sounds, to let people who can't hear the audio understand what is going on. timed
descriptions text which should be spoken by the media player in order to describe important visuals to blind or otherwise visually impaired users. a typical webvtt file will look something like this: webvtt 1 00:00:22.230 --> 00:00:24.606 this is the first subtitle. 2 00:00:30.739 --> 00:00:34...
...title. 2 00:00:30.739 --> 00:00:34.074 this is the second. ... to get this displayed along with the html media playback, you need to: save it as a .vtt file in a sensible place. link to the .vtt file with the <track> element. <track> should be placed within <audio> or <video>, but after all <source> elements. use the kind attribute to specify whether the cues are subtitles, captions, or
descriptions. further, use srclang to tell the browser what language you have written the subtitles in. here's an example: <video controls> <source src="example.mp4" type="video/mp4"> <source src="example.webm" type="video/webm"> <track kind="subtitles" src="subtitles_en.vtt" srclang="en"> </video> this will result in a video that has subtitles displayed, kind of like this: for more detail...
HTML table advanced features and accessibility - Learn web development
of tables. adding a caption to your table with <caption> you can give your table a caption by putting it inside a <caption> element and nesting that inside the <table> element. you should put it just below the opening <table> tag. <table> <caption>dinosaurs in the jurassic period</caption> ... </table> as you can infer from the brief example above, the caption is meant to contain a
description of the table contents. this is useful for all readers wishing to get a quick idea of whether the table is useful to them as they scan the page, but particularly for blind users. rather than have a screenreader read out the contents of many cells just to find out what the table is about, he or she can rely on a caption and then decide whether or not to read the table in greater detail. a caption ...
...ey scan the page, but particularly for blind users. rather than have a screenreader read out the contents of many cells just to find out what the table is about, he or she can rely on a caption and then decide whether or not to read the table in greater detail. a caption is placed directly beneath the <table> tag. note: the summary attribute can also be used on the <table> element to provide a
description — this is also read out by screenreaders. we'd recommend using the <caption> element instead, however, as summary is deprecated by the html5 spec, and can't be read by sighted users (it doesn't appear on the page.) active learning: adding a caption let's try this out, revisiting an example we first met in the previous article. open up your language teacher's school timetable from the end ...
Index - Learn web development
ument into logical sections (does it have a header? three columns of content? a navigation menu?), and embed content such as images and videos into a page. this module will introduce the first two of these and introduce fundamental concepts and syntax you need to know to understand html. 231 advanced text formatting beginner, codingscripting, guide, html, learn, text, abbreviation,
description list, quote, semantic that marks the end of our study of html text semantics. bear in mind that what you have seen during this course is not an exhaustive list of html text elements — we wanted to try to cover the essentials, and some of the more common ones you will see in the wild, or at least might find interesting. to find way more html elements, you can take a look at our html elemen...
..., the entire image links to one webpage. an image map, on the other hand, contains several active regions (called "hotspots") that each link to a different resource. 254 define terms with html beginner, guide, html, learn when you need a term defined, you probably go straight to a dictionary or glossary. dictionaries and glossaries formally associate keywords with one or more
descriptions, as in this case: 255 tips for authoring fast-loading html pages advanced, guide, html, needsupdate, performance, web, web performance these tips are based on common knowledge and experimentation. 256 use javascript within a webpage beginner, html, javascript, openpractices javascript is a programming language mostly used client-side to make webpages int...
Vue conditional rendering: editing existing todos - Learn web development
this is a useful way to help reinforce everything you've learned so far. this code sets up the core of the edit functionality. we create a form with an <input> field for editing the name of our to-do. there is a "save" button and a "cancel" button: when the "save" button is clicked, the component emits the new l...
...n you save and reload, you'll find that the problem is solved — the checkbox state is now preserved when you switch between todo item templates. understanding the tangle of events one of the most potentially confusing parts is the tangle of standard and custom events we've used to trigger all the interactivity in our app. to understand this better, it is a good idea to write out a flow chart,
description, or diagram of what events are emitted where, where they are being listened for, and what happens as a result of them firing. for example: app.vue <to-do-form> listens for: todo-added event emitted by the onsubmit() method inside the todoform component when the form is submitted. result: addtodo() method invoked to add new todo item to the todoitems array. <to-do-item> listens for: c...
Accessible Toolkit Checklist
textfields, combo boxes or other controls as part of their prompts. msaa support, including checkbox state and statechange event tab panels ctrl+[shift]+tab or ctrl+pgup/pgdn to switch tabs tabs can be focused, and then left/right arrow to switch first click on a tab switches to it, second click focuses it msaa support. note, you can use the accessible
description to expose the current tab position, such as "3 of 5" in order to provide ease of access for the user. the "of" will be parsed out by the assistive technology, so don't localize it. lists and combo boxes when a list is tabbed to, select the first item if nothing else is already selected f4, alt+down or alt+up toggle a combo box open and closed escape closes combo b...
...boxes the enter key should activate an item if double clicking would do so msaa support, including accessible selection, exposing current level and position in list, alternative text for informative or interactive images, selectable, multiselectable and extselectable states, statechange events for expanding/collapsing and toggling of checkbox children. note, you can use the accessible
description to expose the current tree view level and position, such as "l3, 6 of 9" in order to provide ease of access for the user. the "l" and "of" will be parsed out by the assistive technology, so don't localize it. mac os x difference: option+left and option+right should do deep expand/collapse mac os x difference: user should be able to select multiple rows and expand them with one keystro...
Theme concepts
"theme_frame": "empty.png", "additional_backgrounds": [ "weta_for_tiling.png"] }, and the images tiling with: "properties": { "additional_backgrounds_alignment": [ "top" ], "additional_backgrounds_tiling": [ "repeat" ] }, full details of how to setup this theme can be found in the themes example weta_tiled. full detais of the alignment and tiling options can be found in the "theme" key
description. alternatively, you can use multiple images, say combining the original weta image with this one anchored to the left of the header to create this effect where the images are specified with: "images": { "theme_frame": "empty.png", "additional_backgrounds": [ "weta.png", "weta-left.png"] }, and their alignment by: "properties": { "additional_backgrounds_alignment": [ "right top" , ...
...ges are specified with: "images": { "theme_frame": "empty.png", "additional_backgrounds": [ "weta.png", "weta-left.png"] }, and their alignment by: "properties": { "additional_backgrounds_alignment": [ "right top" , "left top" ] }, full details of how to setup this theme can be found in the themes example weta_mirror. full details of the alignment options can be found in the "theme" key
description. static animated themes it is possible to create an animated theme using an apng format image, as in the themes example animated. however, remember that rapid animations, such as the one in the example might be too distracting for a practical theme. you can also animate themes programmatically, which we discuss in dynamic themes. updating static themes if your static theme is hosted on amo, ...
What to do and what not to do in Bugzilla
if you want to get bugzilla privileges (as described below), please see this page. it lists the requirements and the email to contact. if you need faster access to get canconfirm or editbugs, especially in order to triage bugs or to participate in a bug day, then you can ask in #bmo on irc, or you may create a bug requesting permissions. include a link to your bugzilla activity page in the bug
description. before you have canconfirm, you can still do good triaging by leaving comments with useful information on the bug that will help to confirm it. the same is true for editbugs: leave comments with the information you'd like to be able to edit into the bug, and that will help you get the editbugs permissions quickly. canconfirm privilege the canconfirm privilege allows you to confirm bugs and al...
...al rules: when you resolve a bug, cc yourself so that you are informed when new facts come up. the conditions for not resolving a bug always overrule the conditions for resolving a bug. when in doubt about resolving a bug, leave it alone! resolving bugs as duplicate in general newer bugs should be marked as duplicates of older bugs, except when the newer bug contains more information (bug
description clearer, patch already attached, lots of people already cc'ed, etc.). resolving bugs as worksforme you can resolve a bug as worksforme (wfm) if it can't be reproduced on the reported hardware/os. you should not resolve a bug as wfm if: the bug reporter uses a different hardware/operating system (e.g. bug appears on linux and you can't reproduce it on windows). the bug has been reproduced b...
Reviewer Checklist
rings there should be no string changes in patches that will be uplifted (including string removals). rev entity names for string changes. when making ui changes, be aware of the fact that strings will be different lengths in different locales. documentation the commit message should describe what the patch is changing (not be a copy of the bug summary). the first line should be a short
description (since only the first line is shown in the log), and additional
description, if needed, should be present, properly wrapped, in later lines. adequately document any potentially confusing pieces of code. flag a bug with dev-doc-needed if any addon or web apis are affected. use javadocs extensively, especially on any new non-private methods. when moving files, ensure blame/annotate is preserved...
... if any addon or web apis are affected. ...
Displaying Places information using views
inavhistoryresultnode of each row in that column. the following table shows the mappings between these magic column id values and their corresponding nsinavhistoryresultnode properties: treecol id or anonid corresponding nsinavhistoryresultnode property title title url uri date time visitcount accesscount keyword *
description * dateadded dateadded lastmodified lastmodified tags tags ** icon *keyword and
description are looked up in the places database using the nsinavhistoryresultnode property itemid. **the title column (and only the title column) automatically receives the favicon referenced by the nsinavhistoryresultnode property icon. you may specify as fe...
... placeuri the uri (as a string) of the nsinavhistoryresultnode to select. convenience properties in addition to the methods above, some properties of convenience are implemented directly on the built-in tree view. warning: until bug 476952 is fixed, you may experience problems using some of these properties in conjunction with the place attribute and property. property type
description flatlist boolean if true the view does not recurse into containers. the action to take when a container is toggled can be set via the onopenflatcontainer property. at least one of flatlist and showroot must be false. onopenflatcontainer string the body of function that will be called when a container is toggled. only applies if property flatlist is true. the function...
HTTP Cache
this document only contains what cannot be found or may not be clear directly from the idl files comments. the cache api is completely thread-safe and non-blocking. there is no ipc support. it's only accessible on the default chrome process. when there is no profile the new http cache works, but everything is stored only in memory not obeying any particular limits. it is strongly encoraged to not use the old cache api any more - nsicacheservice et al. ...
...cacheentry::invokecallbacks all consumers release the reference: the entry may now be purged (removed) from memory when found expired or least used on overrun of the memory pool limit when this is a disk cache entry, its cached data chunks are released from memory and only meta data is kept intermediate memory caching of frequently used metadata (a.k.a. disk cache memory pool) this is a
description of this feature status that is currently only a patch in bug 986179. current behavior is simpler and causes a serious memory consumption regression (bug 975367). for the disk cache entries we keep some of the most recent and most used cache entries' meta data in memory for immediate zero-thread-loop opening. the default size of this meta data memory pool is only 250kb and is controlled by a new...
API-provided widgets
type a string indicating the type of widget. possible types are button for simple button widgets (the default) view for buttons that open a panel or subview, depending on where they are placed. custom for fine-grained control over the creation of the widget. ...
...on, you should not set this property, and should instead include the shortcut as part of the tooltiptext you pass in yourself. showinprivatebrowsing whether to show the widget in private browsing mode (optional, default: true) event handlers you can also define several event handlers which will be called at various stages in a widget's lifetime: event handler name
description onbuild(adoc) only useful for custom widgets (and required there); a function that will be invoked with the document in which to build a widget. should return the dom node that has been constructed. nb: the dom node you construct should have the same id as the id property described above, so that customizableui can find the node again later. onbeforecreated(adoc) attached ...
Widget Wrappers
provide information about the widget across all windows, and 'single' wrappers which provide information about a specific instance in a specific window. group wrapper methods forwindow() a method to obtain a single window wrapper for a widget, in the window awindow passed as the only argument. properties all of a wrapper's properties are read-only unless otherwise indicated. attribute
description id the widget's id type the type of widget (button, view, custom). for xul-provided widgets, this is always 'custom' provider the provider type of the widget, id est one of provider_api or provider_xul instances an array of all instances (single window wrappers) of the widget. this array is not live. areatype the type of the widget's cur...
...es' disabled states label for api-provided widgets, the label of the widget tooltiptext for api-provided widgets, the tooltip of the widget showinprivatebrowsing for api-provided widgets, whether the widget is visible in private browsing single wrapper properties all of a wrapper's properties are read-only unless otherwise indicated. attribute
description id the widget's id type the type of widget (button, view, custom). for xul-provided widgets, this is always 'custom' provider the provider type of the widget, id est one of provider_api or provider_xul node reference to the corresponding dom node anchor the anchor on which to anchor panels opened from this node. this will point to the ov...
NetUtil.jsm
methods asynccopy() the asynccopy() method performs a simple asynchronous copy of data from a source input stream to a destination output stream. both streams are automatically closed when the copy operation is completed. nsiasyncstreamcopier asynccopy( asource, asink, acallback ); parameters asource ...
...e number of bytes to read from the stream. you can call nsiinputstream.available() to get the number of bytes currently available. aoptions specifies additional options to control the reading process. this is a javascript object with fields as specified in options. options the aoptions parameter is a javascript object which can have any or all of the following fields: field name
description charset the character encoding to use when interpreting the input stream. if you don't provide this, the input won't be decoded at all and the raw bytes will be returned. replacement a character with which to replace any invalid byte sequences in the input stream. if you don't specify a replacement character, any invalid sequences will result in ns_error_illegal_input bein...
Mozilla DOM Hacking Guide
class implementation of one of the greatest internet technologies ever created. mozilla's dom is coded almost entirely in c++. seriously hacking on it requires excellent knowledge of c++ and xpcom, mozilla's own component model. in this document i will try to outline the main aspects of the implementation, beginning with the class info mechanism, which lies at the heart of the dom, then with the
description of various interfaces and classes. since i am myself still learning how it works, don't expect this to be a complete reference quite yet. if you can contribute any time or knowledge to this document, it is greatly appreciated! target audience: people interested in learning how the dom is implemented. prior knowledge of c++ and xpcom is assumed. if you don't know xpcom yet, and would like to be a...
...er class for this dom class. helper classes are detailed in section 1.3. the fourth and last argument, _flags, is a bitvector of nsixpcscriptable flags. the macros for those flags are defined nsdomclassinfo.cpp. the flags give special behavior through xpconnect. see also section 1.9. the nsdomclassinfodata objects are created in the sclassinfodata array by explicitly initializing it. here is the
description of the structure: const char *mname: c-style string that is passed as second argument to the macro. it is the name of the javascript object that will be available in the browser through the dom. union { nsdomclassinfoconstructorfnc mconstructorfptr; nsdomclassinfoexternalconstructorfnc mexternalconstructorfptr; } u; this union is a pointer to a function typedef'ed: typedef nsiclassinf...
Mozilla Quirks Mode Behavior
o 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) text-decoration in quirks mode had line thickness and position adjusted on descendant text to match the descendant. tables td, th, tr, thead, tbody, and tfoot elements have the document background (and color?) applied to them (when the document background is specified in certain ways?) (see also bug 70831). [this may have been an accurate
description when written in june 2001, but no longer appears accurate. should look into tablequirkcolorrule, re-describe, and figure out when it changed.] obsolete since gecko 37 the empty-cells property defaulted to hide in quirks mode but show (according to css2.1) in standards mode (see bug 33244) (though the correct fix would be to specify it on the html table element in quirk.css). this quirk has been ...
...0" are intentionally not handled as described in html4 (bug 9879). hspace and vspace are supported on table only in quirks mode (bug 41893). proposed to remove: bug 725646. in quirks mode, when tables have a border style of inset or outset, the border color is based on the background color of the table or of the nearest ancestor with non-transparent background. [this may have been an accurate
description when written in june 2001, but it no longer appears correct. i don't follow the code in nscssrenderingborders well enough to tell, though.] in quirks mode a fixed width specified on a table cell resets the nowrap attribute. if the nowrap attribute is present the cell width will never be smaller than the specified fixed width (bug 277232). in quirks mode, tables with no rows/rowgroups have zero ...
Patches and pushes
patch. below you'll find instructions on creating a patch and pushing it to your repository. patchify search plugins are found in browser/searchplugins. each plugin is stored as an xml file, with list.txt containing the names of each plugin. here is an example search plugin file using french yahoo. ...
...nstructions on creating a patch and pushing it to your repository. patchify search plugins are found in browser/searchplugins. each plugin is stored as an xml file, with list.txt containing the names of each plugin. here is an example search plugin file using french yahoo. ...
nss tech note1
ommon functionality of the two decoders, before outlining their differences. the main non-streaming apis for these two decoders have an identical prototype : secstatus sec_asn1decodeitem(prarenapool *pool, void *dest, const sec_asn1template *t, secitem *item); secstatus sec_quickderdecodeitem(prarenapool* arena, void* dest, const sec_asn1template* templateentry, secitem* src); here is a
description of the arguments : secitem* src† is a structure containing a pointer to the binary data to be decoded, as well as its size. const sec_asn1template* templateentry is a pointer to one or more decoder templates. the number of required templates is determined by the type of the first template.when multiple templates are required, the pointer must point to a null-terminated array of template...
...er to a callback function that will dynamically return the required subtemplate. size† . this field does not apply to all template types. it is only required for dynamically allocating memory for the structure if the template is being included from an asn.1 sequence or sequence of, or if dynamic allocation was requested from the parent template using the sec_asn1_pointer modifier here is a
description of the various tags and modifiers that apply to the <tt style="color: rgb(0,0,0);">kind field. asn.1 tags asn.1 tags are specified in the lower byte of the kind field of the template, as noted above. the following is not an attempt to explain asn.1 tags or their purposes. rather, the goal here is to explain what type of tags the decoder supports and which macros should be used when defining ta...
FC_Initialize
in addition to creating the internal data structures, it performs the fips software integrity test and power-up self-tests. the pinitargs argument must point to a ck_c_initialize_args structure whose members should have the following values: createmutex should be null. destroymutex should be null. lockmutex should be null. ...
...th no databases: "configdir='' certprefix='' keyprefix='' secmod='' flags=readonly,nocertdb,nomod db,forceopen,optimizespace " mozilla firefox initializes nss with this string (on windows): "configdir='c:\\documents and settings\\wtc\\application data\\mozilla\\firefox\\profiles\\default.7tt' certprefix='' keyprefix='' secmod='secmod.db' flags=optimizespace manufacturerid='mozilla.org' library
description='psm internal crypto services' cryptotoken
description='generic crypto services' dbtoken
description='software security device' cryptoslot
description='psm internal cryptographic services' dbslot
description='psm private keys' fipsslot
description='psm internal fips-140-1 cryptographic services' fipstoken
description='psm fips-140-1 user private key services' minps=0" see pkcs #11 module specs for com...
NSS environment variables
note: nss environment variables are subject to be changed and/or removed from nss. run-time environment variables these environment variables affect the run time behavior of nss shared libraries. there is a separate set of environment variables that affect how nss is built, documented below. variable type
description introduced in version nsrandcount integer (byte count) sets the maximum number of bytes to read from the file named in the environment variable nsrandfile (see below). makes nsrandfile usable with /dev/urandom. 3.12.3 nsrandfile string (file name) uses this file to seed the pseudo random number generator. before 3.0 nss_allow_weak_signature_alg boolean (any non-empty value to enable) enables the ...
...o decrypt tls connections. see documentation. 3.12.6 ssltrace integer tracing level note: the code must be built with trace defined to use this functionality. before 3.0 build-time environment variables these environment variables affect the build (compilation) of nss. note: this section is a work in progress and is not yet complete. variable type
description introduced in version build_opt boolean (1 to enable) do an optimized (not debug) build. default is to do a debug build. before 3.0 moz_debug_symbols boolean (1 to enable) needed on windows to build with versions of msvc (such as vc8 and vc9) that do not understand /pdb:none 3.11 moz_debug_flags string when moz_debug_symbols is set, yo...
NSS tools : modutil
name modutil - manage pkcs #11 module information within the security module database. synopsis modutil [options] [[arguments]] status this documentation is still work in progress. please contribute to the initial review in mozilla nss bug 836477[1]
description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with securi...
...ke supported cipher mechanisms, version numbers, serial numbers, and other information about the module and the token it is loaded on. ...
NSS tools : modutil
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. ...
...orted cipher mechanisms, version numbers, serial numbers, and other information about the module and the token it is loaded on. ...
NSS tools : signtool
electronic software distribution over any network involves potential security problems. to help address some of these problems, you can associate digital signatures with the files in a jar archive. digital signatures allow ssl-enabled ...
...be expressed through this file. for more information about the syntax used with this file, see "tips and techniques". -i scriptname specifies the name of an installer script for smartupdate. this script installs files from the jar archive in the local system after smartupdate has validated the digital signature. for more details, see the
description of -m that follows. the -i option provides a straightforward way to provide this information if you don't need to specify any metadata other than an installer script. -j directory specifies a special javascript directory. this option causes the specified directory to be signed and tags its entries as inline javascript. this special type ...
Creating JavaScript jstest reftests
th from js/src/tests to the location of your test. if you have functionality several tests share in a given folder, you can add the functionality to the shell.js or broswer.js file in the directory. asserteq asserteq(v1, v2[, message]) checks that v1 and v2 are the same value. if they're not, throw an exception (which will cause the test to fail). reportcompare reportcompare(expected, actual,
description) is somewhat like asserteq(actual, expected,
description) except that the first two arguments are swapped, failures are reported via stdout rather than by throwing exceptions, and the matching is fuzzy in an unspecified way. for example, reportcompare sometimes considers numbers to be the same if they are "close enough" to each other, even if the == operator would return false. expected = 3; act...
... failures are reported via stdout rather than by throwing exceptions, and the matching is fuzzy in an unspecified way. for example, reportcompare sometimes considers numbers to be the same if they are "close enough" to each other, even if the == operator would return false. expected = 3; actual = 1 + 2; reportcompare(expected, actual, '3==1+2'); comparesource comparesource(expected, actual,
description) is used to test if the decompilation of a javascript object (conversion to source code) matches an expected value. note that tests which use comparesource should be located in the decompilation sub-suite of a suite. for example, to test the decompilation of a simple function you could write: var f = (function () { return 1; }); expect = 'function () { return 1; }'; actual = f + ''; comparesour...
Hacking Tips
the build documentation of spidermonkey. it is separated in 2 parts, one section related to debugging and another section related to drafting optimizations. many of these tips only apply to debug builds of the js shell; they will not function in a release build. debugging tips getting help (from js shell) use the help function to get the list of all primitive functions of the shell with their
description. note that some functions have been moved under an 'os' object, and help(os) will give brief help on just the members of that "namespace". getting the bytecode of a function (from js shell) the shell has a small function named dis to dump the bytecode of a function with its source notes. without arguments, it will dump the bytecode of its caller. js> function f () { return 1; } js> dis(f); ...
...] # compartment http://gmail.com/iframe [in zone 0x56789123] # arena allockind=3 size=64 0x1234abcd b object > 0x1234abcd b prop1 > 0xabcd1234 w prop2 0xabcd1234 w object > 0xdeadbeef b prop3 # arena allockind=5 size=72 0xdeadbeef w object > 0xabcd1234 w prop4 the output is textual. the first section of the file contains a list of roots, one per line. each root has the form "0xabcd1234 <color> <
description>", where <color> is the color of the given gc thing (b for black, g for gray, w for white) and <
description> is a string. the list of roots ends with a line containing "==========". after the roots come a series of zones. a zone starts with several "comment lines" that start with hashes. the first comment declares the zone. it is followed by lines listing each compartment within the zone. after ...
JS::Add*Root
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rt jsruntime * the runtime in which to add the new root. vp js::heap<js::value> the address of the js::value variable to root. rp js::heap<jsstring *> the address of the jsstring * variab...
...ap<js::value> the address of the js::value variable to root. rp js::heap<jsstring *> the address of the jsstring * variable to root. rp js::heap<jsobject *> the address of the jsobject * variable to root. rp js::heap<jsscript *> the address of the jsscript * variable to root. name const char * the name of the new root, or null.
description the js::add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable. the garbage collector aggressively collects and recycles memory that it deems unreachable, so roots are often necessary to protect data from being prematurely collected. vp/rp is the address of a c/c...
JS::AutoIdArray
this article covers features introduced in spidermonkey 17 take ownership of a jsidarray and free it later. syntax autoidarray(jscontext *cx, jsidarray *ida); name type
description cx jscontext * the context in which to add the root. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ida jsidarray * a pointer to jsidarray to take the ownership. methods method
description bool operator!() const return true if this has no owned array. jsid operator[](size_t i) const return a jsid in specified index of the owned array. size_t length() const return the length of the owned array. jsidarray *steal() return the owned array and release the ...
... take the ownership. methods method
description bool operator!() const return true if this has no owned array. jsid operator[](size_t i) const return a jsid in specified index of the owned array. size_t length() const return the length of the owned array. jsidarray *steal() return the owned array and release the ownership.
description js::autoidarray takes the ownership of jsidarray, and frees it in destructor by calling js_destroyidarray. examples { js::autoidarray ids(cx, js_enumerate(cx, obj)); if (!ids) // check the returned value from js_enumerate return false; for (int32_t i = 0, len = ids.length(); i < len; i++) { somefunc(cx, ids[i]); } /* when leaving this scope, the jsidarray returned by js_enu...
JS::AutoValueArray
this is typically used for local variables being passed to function which requires js::handlevaluearray or a pointer to js::value array. ...
...this is typically used for local variables being passed to function which requires js::handlevaluearray or a pointer to js::value array. ...
JS::AutoVectorRooter
bool empty() const determines if the array is empty (length is zero). bool append(const t &v) appends an element v to the array. bool append(const t *ptr, size_t len) appends a sequence of t specified with a pointer ptr and length len to the array. ...
... returns a pointer to the first element. t *begin() returns a pointer to the first element. const t *end() const returns a pointer to the element next to the last element. t *end() returns a pointer to the element next to the last element. range all() returns the range of the array. const t &back() const returns the last element.
description js::autovectorrooter<t> holds a variable-size rooted array of type t. there are derived classes for the main types: class parent class js::autovaluevector autovectorrooter<value> js::autoidvector autovectorrooter<jsid> js::autoobjectvector added in spidermonkey 24 autovectorrooter<jsobject *> js::autofunctionvector added in spidermonkey ...
JS::Call
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. thisobj js::handleobject / js::handlevalue the "current" object on which the function operates; the object specified here is "this" when the function executes. fun / funobj js::hand...
...ue / js::handleobject pointer to the function to call. should be a native function or jsapi-compiled function. name const char * pointer to the function name to call. args js::handlevaluearray & arguments to pass to the function. rval js::mutablehandlevalue out parameter. on success, *rval receives the return value from the function call.
description js::call calls a specified function, fun, on an object, thisobj. in terms of function execution, the object is treated as this. for more detail, see js_callfunction, js_callfunctionname, and js_callfunctionvalue. see also mxr id search for js::call js_callfunction js_callfunctionname js_callfunctionvalue bug 601168 ...
JS::Compile
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the global object, or null. obsolete since jsapi 39 options js::readonlycompileoptions & compile options. srcbuf js::sourcebufferholder &...
...pt to compile. length size_t the length of chars or bytes, in characters. file file * file handle containing the function. filename const char * name of file or url containing the function. used to report filename or url in error messages. script js::mutablehandlescript out parameter. on success, script receives the result script.
description js::compile compiles a script, srcbuf, chars, bytes, or file, for execution. the script is associated with a js object. srcbuf, chars, bytes is the string containing the text of the script. length indicates the size of the text version of the script in characters. file is the filehandle containing the text of the script. filename is the name of the file (or url) containing the script. this in...
JS::CompileFunction
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. scopechain js::autoobjectvector & the scope in which to compile the function. options js::readonlycompileoptions & compile options. name const char * name to assign the newly ...
...of the function to compile. bytes const char * string containing the body of the function to compile. length size_t the length, in characters, of body. srcbuf js::sourcebufferholder & source buffer containing the script function compile. fun js::mutablehandlefunction out parameter. on success, fun receives the result function.
description js::compilefunction compiles a function from a text string chars, bytes, or srcbuf. name is the name to assign to the newly created function. nargs is the number of arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of argument names should match the number of arguments specified in nargs. chars, bytes, or srcbu...
JS::CompileOffThread
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rt jsruntime * pointer to a js runtime. options js::readonlycompileoptions & compile options. chars const char16_t * string containing the script to co...
... js::readonlycompileoptions & compile options. chars const char16_t * string containing the script to compile. length size_t the length of chars or bytes, in characters. callback js::offthreadcompilecallback a callback function invoked when the compilation. callbackdata / token void * pointer to application-defined data.
description js::compileoffthread compiles a script, chars for execution. the script is associated with a js object. chars is the string containing the text of the script. length indicates the size of the text version of the script in characters. after successfully triggering an off thread compile of a script, the callback will eventually be invoked with the specified data and a token for the compilation. ...
JS::Construct
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
... must be in a request on this jscontext. fun js::handlevalue pointer to the function to call. should be a native function or jsapi-compiled function.. args js::handlevaluearray & arguments you are passing to the function. rval js::mutablehandlevalue out parameter. on success, *rval receives the newly created object from the constructor call.
description js::construct calls a specified function as a constructor, fun. for more detail, see js::call, js_callfunction, js_callfunctionname, and js_callfunctionvalue. see also mxr id search for js::construct js::call js_callfunction js_callfunctionname js_callfunctionvalue bug 1017109 ...
JS::CreateError
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. type jsexntype the exception's type. stack js::handlestring or js::handleobject the value of error.prototype.stack. filename js::handlestring the value of error.pr...
...linenumber uint32_t the value of error.prototype.linenumber. columnnumber uint32_t the value of error.prototype.columnnumber. report jserrorreport * a pointer to jserrorreport instance. message js::handlestring the value of error.prototype.message. rval js::mutablehandlevalue out parameter. receives the created error object.
description js::createerror creates an error object with specified properties. if successful, js::createerror stores the created error object to *rval and returns true, otherwise returns false and the value of *rval is undefined. see also mxr id search for js::createerror jsexntype jserrorreport bug 984048 bug 1038238 -- change stack parameter from js::handlestring to js::handleobject ...
JS::DeflateStringToUTF8Buffer
ermonkey 38 encode the given string as utf8 into given buffer. ...
...the caller must either ensure dst has enough space to encode the entire string, or pass the length of the buffer as dstlenp. in which case, the function will encode characters from the string until the buffer is exhausted. does not write the null terminator. ...
JS::Evaluate
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the scope in which to execute the script. this parameter is documented in detail at js_executescript. obsolete since jsapi 39 scopechain js::autoobjectvector & the scope in which ...
...t char * string containing the script to compile and execute. length size_t the length of chars or bytes, in characters. filename const char * name of file or url containing the script. used to report filename or url in error messages. rval js::mutablehandlevalue out parameter. on success, if rval is not null, *rval receives the result value.
description js::evaluate compiles and executes a script in the specified scope, obj or scopechain. srcbuf, chars and bytes are the string containing the text of the script. length indicates the size of the text version of the script in characters. filename is the name of the file (or url) containing the script. this information is used in messages if an error occurs during compilation. rval is an optiona...
JS::GetSelfHostedFunction
this article covers features introduced in spidermonkey 31 create a new javascript function that is implemented in self-hosted javascript. syntax jsfunction* js::getselfhostedfunction(jscontext* cx, const char* selfhostedname, js::handle<jsid> id, unsigned nargs); name type
description cx jscontext* the context from which to get the function. requires request. ...
...text from which to get the function. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. selfhostedname const char* function name in the self-hosted javascript. id js::handle<jsid> a pointer to jsid of the name to assign to the new function. nargs unsigned number of arguments the function expects.
description js::getselfhostedfunction creates a new javascript function implemented in self-hosted javascript. on success, js::getselfhostedfunction returns a pointer to the newly created function. otherwise, it reports an out-of-memory error and returns null. see also mxr id search for js::getselfhostedfunction bug 1140573 ...
JS::HandleValueArray
values js::autovaluevector & elements of newly created array. values js::autovaluearray & elements of newly created array. args js::callargs & elements of newly created array. len size_t (frommarkedlocation only) length of elements array or...
...ray or (subarray only) length of sub array of values. elements js::value * (frommarkedlocation only) a pointer to the first element of an array of js::value. values js::handlevaluearray (subarray only) an array to get sub array. startindex size_t (subarray only) an index of the first element of subarray of values. methods method
description size_t length() const returns the length of the array. const value *begin() const returns the pointer to the first element of the array. js::handlevalue operator[](size_t i) const returns i-th element of the array.
description js::handlevaluearray is a handle to an array of rooted values. this is useful as a parameter type, or a temporal local variable ...
JS::OrdinaryToPrimitive
this article covers features introduced in spidermonkey 38 convert an ordinary object to a primitive value. syntax bool js::ordinarytoprimitive(jscontext *cx, js::handleobject obj, jstype type, js::mutablehandlevalue vp); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...on cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to convert. type jstype the type of converted value. vp js::mutablehandlevalue out parameter. on success, *vp receives the converted value.
description js::ordinarytoprimitive converts a javascript object to a specified type value, by the algorithm specified in es6 draft rev 28 (2014 oct 14) 7.1.1, second algorithm. most users should not call this -- use js::tonumber, js::toboolean, or js::tostring instead. this should only be called from custom convert hooks. it implements the default conversion behavior shared by most objects in js, so it's ...
JS::Remove*Root
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rt jsruntime * the runtime from which to remove the root. vp js::heap<js::value> address of the js::value variable to remove from the root set. this must have been passed to one of js::addvalueroot, js...
...ither js::addstringroot or js::addnamedstringroot. rp js::heap<jsobject *> address of the jsobject * variable to remove from the root set. this must have been passed to either js::addobjectroot or js::addnamedobjectroot. rp js::heap<jsscript *> address of the jsscript * variable to remove from the root set. this must have been passed to js::addnamedscriptroot.
description js::remove*root removes the variable that rp points to from the garbage collector's root set. the entry for vp/rp is removed from the root set for the jsruntime associated with the context cx. see also mxr id search for js::removevalueroot mxr id search for js::removestringroot mxr id search for js::removeobjectroot mxr id search for js::removescriptroot mxr id search for js::removevalu...
JS::Rooted
this article covers features introduced in spidermonkey 17 local variable of type t whose value is always rooted. syntax js::rooted<t> var(cx); js::rooted<t> var(cx, initial); js::rooted<t> var(rt); js::rooted<t> var(rt, initial); name type
description cx jscontext * the context in which to add the root. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rt jsruntime * the runtime in which to add the root. initial t an initial value for the rooted variable. methods here, ptr represents the private member of js::rooted<t>, typed with t. method
description t &get() returns ptr. const t &get() const operator const t&() const t o...
...tor const t&() const t operator->() const t *address() returns a pointer to ptr. const t *address() const t &operator=(t value) sets the value of ptr to value. t &operator=(const rooted &value) void set(t value) bool operator!=(const t &other) const compares ptr and other. bool operator==(const t &other) const
description js::rooted<t> declares a local variable of type t whose value is always rooted. this is typically used for local variables, or for non-rooted values being passed to a function that requires a handle, e.g. foo(js::rooted<t>(cx, x)). js::rooted<t> may be automatically coerced to a js::handle<t>. js::rooted<t> should be used whenever a local variable's value may be held live across a call w...
JS::SetLargeAllocationFailureCallback
this article covers features introduced in spidermonkey 31 specify a new callback function for large memory allocation failure. syntax void js::setlargeallocationfailurecallback(jsruntime *rt, js::largeallocationfailurecallback afc, void *data); name type
description rt jsruntime * the jsruntime for which to set the gc callback. ...
...ntime * the jsruntime for which to set the gc callback. cb js::largeallocationfailurecallback pointer to the new callback function to use. data void * data parameter which will be passed to js::largeallocationfailurecallback. added in spidermonkey 38 callback syntax typedef void (* js::largeallocationfailurecallback)(void *data); name type
description data void * data parameter passed to js::setlargeallocationfailurecallback. added in spidermonkey 38
description if a large allocation fails when calling pod_{calloc,realloc}cangc, the js engine may call the large-allocation- failure callback, if set, to allow the embedding to flush caches, possibly perform shrinking gcs, etc. to make some room. the allocation will then be ...
JS::SetOutOfMemoryCallback
this article covers features introduced in spidermonkey 31 specify a new callback function for out of memory error. syntax void js::setoutofmemorycallback(jsruntime *rt, js::outofmemorycallback cb, void *data); name type
description rt jsruntime * the jsruntime for which to set the gc callback. cb js::outofmemorycallback pointer to the new callback function to use. data void * data parameter which will be passed to js::outofmemorycallback. ...
...on rt jsruntime * the jsruntime for which to set the gc callback. cb js::outofmemorycallback pointer to the new callback function to use. data void * data parameter which will be passed to js::outofmemorycallback. added in spidermonkey 38 callback syntax typedef void (* outofmemorycallback)(jscontext *cx, void *data); name type
description data void * data parameter passed to js::setoutofmemorycallback. added in spidermonkey 38
description unlike the error reporter, which is only called if the exception for an oom bubbles up and is not caught, the js::outofmemorycallback is called immediately at the oom site to allow the embedding to capture the current state of heap allocation before anything is freed. if th...
JS::ToPrimitive
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...t the object to convert. hint jstype the hint to pass to the toprimitive and @@toprimitive method when converting the object. hint must be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint. do not pass any other type. vp js::mutablehandleobject out parameter. on success, *vp receives the converted value.
description js::toprimitive converts a javascript object, obj, to a primitive value using ecmascript 6 toprimitive. on success, js::toprimitive stores the converted value in *vp and returns true. on error or exception, it returns false, and the value left in *vp is undefined. see also mxr id search for js::toprimitive js::getfirstargumentastypehint js_defaultvalue -- old name of this function bug 10...
JSAutoByteString
this article covers features introduced in spidermonkey 17 take ownership of a string and free it later. syntax jsautobytestring str; jsautobytestring(jscontext *cx, jsstring *str); name type
description cx jscontext * the context in which to add the root. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * a pointer to jsstring to get initial content by calling js_encodestring(cx, str). methods method
description void initbytes(char *bytes) take ownership of the given byte array. char *encodelatin1(jscontext *cx, jsstring *str) call js_encodestring and take ownership of the returned string, and return the string. char *encodelatin1...
...encode* methods or initbytes method if a string is already owned, otherwise the string will never be freed. char *ptr() const return a pointer to the owned string. this could be null if no string is owned. bool operator!() const return true if no string is owned. size_t length() const return the length of the owned string. return 0 if no string is owned.
description jsautobytestring takes the ownership of string and frees it in destructor. if jsautobytestring instance is initialized with jsautobytestring bytes(cx, str); style, it calls js_encodestring(cx, str) to get the string to take ownership. if jsautobytestring instance is initialized with jsautobytestring bytes; style, it does not own any string. you can call some methods to take ownership of other ...
JSCheckAccessOp
in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. jscheckaccessop is the type for jsclass.checkaccess. (it is also the type of the callback set by js_setcheckobjectaccesscallback.) syntax typedef jsbool (* jscheckaccessop)(jscontext *cx, jsobject *obj, jsval id, jsaccessmode mode, jsval *vp); name type
description cx jscontext * the js context in which the property access attempt is occurring. obj jsobject * the object whose properties are being accessed. id jsval the name or index of the property being accessed. mode jsaccessmode the type of access being checked. vp jsval * out parameter. on success, the callback must set *vp to th...
...ontext in which the property access attempt is occurring. obj jsobject * the object whose properties are being accessed. id jsval the name or index of the property being accessed. mode jsaccessmode the type of access being checked. vp jsval * out parameter. on success, the callback must set *vp to the stored value of the property.
description check whether obj[id] may be accessed per mode, returning js_false on error/exception, js_true on success with obj[id]'s stored value in *vp. as for jspropertyop, id is either a string or an int jsval. jscheckaccessop implementations generally work by using jsdbgapi functions such as js_frameiterator and js_stackframeprincipals to obtain the principals of the code attempting the checked operati...
JSClass
this field is the bitwise or of one or more of the jsclass_* constants described in jsclass.flags. addproperty jspropertyop a hook called just after adding a new property. may modify the new property value. use null or js_propertystub (spidermonkey 31 or older) for default behavior. ...
...an object as though it were a constructor: new obj(). if objects of your class shouldn't be callable this way, use null. most custom objects are not intended to be used as constructors. xdrobject jsxdrobjectop implements object serialization. if you do not use jsxdr, set this pointer to null. obsolete since jsapi 13 trace jstraceop the gc trace hook.
description use jsclass to define a custom class of javascript objects. a jsclass has a name, flags, and several callback functions for advanced customization of object behavior. simple classes a simple custom class does not require any special jsclass callbacks. instead, all the native code is in jspropertyops (property getters and setters) and jsnatives or jsfastnatives (methods). the code for such a cl...
JSConstDoubleSpec
lue and assigns it a name. syntax template<typename t> struct jsconstscalarspec { const char *name; t val; /* uint8_t flags; // obsolete from jsapi 35 uint8_t spare[3]; // obsolete from jsapi 35 */ }; typedef jsconstscalarspec<double> jsconstdoublespec; typedef jsconstscalarspec<int32_t> jsconstintegerspec; // added in spidermonkey 38 name type
description val double or int32_t value for the double or integer. name const char * name to assign the double. flags uint8_t property attributes for the double. obsolete since jsapi 35 currently these can be 0 or more of the following values or'd: jsprop_enumerate: property is visible in for loops. jsprop_readonly: property is read-only. jspro...
...ad-only. jsprop_permanent: property cannot be deleted. jsprop_exported: property can be exported outside its object. jsprop_index: property is actually an array element. if this field is 0, js_defineconstdoubles uses the default attributes jsprop_readonly | jsprop_permanent instead. spare uint8_t [3] reserved for future use. obsolete since jsapi 35
description jsconstdoublespecs is used to define a set of double values that are assigned as properties to an object using js_defineconstdoubles. jsconstintegerspecs is used to define a set of double values that are assigned as properties to an object using js_defineconstintegers. see also mxr id search for jsconstdoublespec mxr id search for jsconstintegerspec js_defineconstdoubles. js_defineconstintegers...
JSConvertOp
jsconvertop is the type of jsclass.convert. syntax typedef bool (* jsconvertop)(jscontext *cx, js::handleobject obj, jstype type, js::mutablehandlevalue vp); name type
description cx jscontext * the context in which the convert is taking place. obj js::handleobject the object to be converted. hint jstype the hint to pass to the [[defaultvalue]] hook when converting the object. hint will be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint. ...
...d. hint jstype the hint to pass to the [[defaultvalue]] hook when converting the object. hint will be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint. other types may be passed as hints, but such behavior is deprecated. vp js::mutablehandlevalue out parameter. on success, *vp receives the converted value.
description jsconvertop callback specifies conversion behavior for objects having this class, implementing the ecmascript [[defaultvalue]] behavior for them. on success it must return a primitive value in *vp. implementations of this hook have historically been required to accept any type. however, the engine itself only requires support for jstype_string, jstype_number, and jstype_void, if js_convertvalue...
JSDeletePropertyOp
provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. ...
... cx. the callback does not need to call js_beginrequest()). obj js::handleobject the object whose properties are being deleted. id js::handleid the name or index of the property being deleted. this is either a string (unicode property identifier) or an integer (element index). succeeded bool * out parameter. receives the result of deletion.
description jsdeletepropertyop callback is a hook that applications may install to be called at some point during property access. a jsdeletepropertyop may be installed on a jsclass to hook property deletes. if a jsdeletepropertyop does nothing and returns true, then property delete is unaffected. it proceeds as normal. this callback may veto the ongoing property operation by optionally reporting an error...
JSEnumerateOp
it should define any remaining lazy properties that should be enumerable but are not yet defined in obj. ...
...it should define any remaining lazy properties that should be enumerable but are not yet defined in obj. ...
JSExtendedClass
perties implemented in c/c++. syntax struct jsextendedclass { jsclass base; jsequalityop equality; jsobjectop outerobject; jsobjectop innerobject; jsiteratorop iteratorobject;// added in spidermonkey 1.8 jsobjectop wrappedobject; // added in spidermonkey 1.8 ...and additional reserved fields. }; name type
description base jsclass the basic class information and callbacks for this class. this contains some required fields. equality jsequalityop optional. overrides the javascript == and != operators. outerobject jsobjectop optional. return the current outer object. this is used to implement split objects. innerobject jsobjectop optional. return the cur...
...iteratorobject jsiteratorop added in spidermonkey 1.8 optional. creates and returns a new iterator. wrappedobject jsobjectop added in spidermonkey 1.8 optional. if non-null, an object of this class may serve as a wrapper for another object. wrappers sometimes transparently behave like the object they wrap. for example, an object and its wrappers are all equal under ===.
description to implement a custom class that uses any of the jsextendedclass callbacks: create a jsextendedclass and populate both the base fields and the extended fields. ensure that the additional reserved fields at the end of the jsextendedclass are null. jsclass and jsextendedclass structs should usually be global, and in this case the compiler automatically initializes these fields to null. (this is ...
JSFastNative
s_initclass and js_definefunctions can create custom methods that are implemented as c/c++ functions of this type, instead of jsnative. the term "native" here refers to c/c++ code as opposed to javascript code. added in spidermonkey 1.8.1 jsfastnative has been renamed to jsnative. syntax typedef jsbool (*jsfastnative)(jscontext *cx, unsigned int argc, jsval *vp); name type
description cx jscontext * the context in which the fast native is being called. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). argc unsigned int the number of arguments supplied to the function by the caller (as opposed to, say, the number of a...
.... argc unsigned int the number of arguments supplied to the function by the caller (as opposed to, say, the number of arguments the function is specified to take in its jsfunctionspec). vp jsval * the arguments, including the this argument, the return-value slot, and the callee function object are accessible through this pointer using macros described below.
description the callback should use the following macros to access the fields of vp: macro name
description js_callee(cx, vp) returns the function object that was called, as a jsval. native methods must not call js_callee after calling js_set_rval. (the return value and the callee are stored in the same stack slot.) js_this(cx, vp) returns the this argument as a ...
JSFinalizeOp
the garbage collector calls this callback for each object it collects. ...
...the garbage collector calls this callback for each object it collects. ...
JSFunctionSpec
defines a single function for an object. syntax struct jsfunctionspec { const char *name; jsnativewrapper call; uint16_t nargs; uint16_t flags; const char *selfhostedname; }; typedef struct jsnativewrapper { jsnative op; const jsjitinfo *info; } jsnativewrapper; name type
description name const char * the function's name. call jsnativewrapper the built-in js call wrapped by this function. if the function does not wrap a native js call, set this value to null. nargs uint16_t the value used for function.length. this no longer guarantees anything about the vp array. flags uint16_t the bitwise or of any number of function flags. selfhostedname c...
...l wrapped by this function. if the function does not wrap a native js call, set this value to null. nargs uint16_t the value used for function.length. this no longer guarantees anything about the vp array. flags uint16_t the bitwise or of any number of function flags. selfhostedname const char * the function's name in self-hosted javascript code.
description jsfunctionspec defines the attributes for a single js function to associate with an object. an application typically has an array of jsfunctionspec to define all the functions for an object and calls js_definefunctions or js_initclass to create the functions and assign them to an object. jsfunctionspec can also be used to define an array element rather than a named property. array elements are ac...
JSID_IS_INT
jsid_to_int converts a specified js id, id to an integer. ...
... jsid_to_int converts a specified js id, id to an integer. ...
JSIteratorOp
bsolete since jsapi 26this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8 callback for creating iterators. ...
...ef jsobject * (*jsiteratorop)(jscontext *cx, jsobject *obj, jsbool keysonly); name type
description cx jscontext * pointer to the js context in which the iterator creation should take place. obj jsobject * pointer to the object to iterate over. keysonly jsbool if true, the iterator should yield keys only, not [key, value] pairs.
description the javascript engine calls the jsextendedclass.iteratorobject callback to create an iterator object for a given object. the callback should return an iterator object or null if an error or exception occurred on cx. see also bug 909178 ...
JSNative
callbacks. in particular, apis such as js_initclass and js_definefunctions create custom methods on javascript objects that are implemented as jsnative callbacks provided by the application, written in c/c++ code. the term "native" here refers to c/c++ code as opposed to javascript code. syntax typedef bool (* jsnative)(jscontext *cx, unsigned argc, js::value *vp); name type
description cx jscontext * the context in which the native function is being called. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). argc unsigned the number of arguments supplied to the function by the caller (as opposed to, say, the number of a...
...inrequest()). argc unsigned the number of arguments supplied to the function by the caller (as opposed to, say, the number of arguments the function is specified to take in its jsfunctionspec). vp js::value * the arguments, the this argument, the return-value slot, and the callee function object are accessible through this pointer using macros described below.
description jsnative is the type of native implementations of javascript functions. full documentation of how to define a jsnative (or a jsfastnative, the equivalent typedef which preceded it) is available in the api header "js/callargs.h" added in spidermonkey 24. this header is new, but the semantics it describes are applicable to all recent spidermonkey releases. the preferred way to implement a funct...
JSNewEnumerateOp
ethod. syntax typedef bool (* jsnewenumerateop)(jscontext *cx, js::handleobject obj, js::autoidvector &properties); // added in spidermonkeysidebar 38 typedef bool (* jsnewenumerateop)(jscontext *cx, js::handleobject obj, jsiterateop enum_op, js::mutablehandlevalue statep, js::mutablehandleid idp); // obsolete since jsapi 37 name type
description cx jscontext * the context in which the enumeration is taking place. obj js::handleobject the object to be enumerated. properties js::autoidvector & out parameter. id array to populate with all property keys. enum_op jsiterateop obsolete since jsapi 37 specifies which step in iteration is happening. see the
description below. ...
... the object to be enumerated. properties js::autoidvector & out parameter. id array to populate with all property keys. enum_op jsiterateop obsolete since jsapi 37 specifies which step in iteration is happening. see the
description below. statep js::mutablehandleid obsolete since jsapi 37 in/out parameter. the meaning depends on enum_op. see the
description below. idp js::mutablehandleid obsolete since jsapi 37 in/out parameter. the meaning depends on enum_op. see the
description below.
description from spidermonkey 38, jsnewenumerateop is the type of objectops::enumerate. this callback overrides a portion of spidermonkey's default [[enumerate]] internal method. when an ordinary object is enumerated, that object and each objec...
JSNewResolveOp
n some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. jsnewresolveop is the type of the jsclass.resolve callback when the jsclass_new_resolve bit is set in the jsclass.flags field. syntax typedef bool (* jsnewresolveop)(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandleobject objp); name type
description cx jscontext * pointer to the js context in which the property access is taking place. obj js::handleobject pointer to the object whose properties are being accessed. id js::handleid name or index of the property being accessed. flags uint32_t obsolete since jsapi 31 flags giving contextual information about the ongoing property access. ...
...ed. id js::handleid name or index of the property being accessed. flags uint32_t obsolete since jsapi 31 flags giving contextual information about the ongoing property access. objp js::mutablehandleobject out parameter. on success, the resolve hook must set *objp to the object in which the property has been defined, or null if it was not defined.
description like jsresolveop, but flags provide contextual information about the property access. on success, the callback must set the *objp out parameter to null if id was not resolved; or non-null, referring to obj or one of its prototypes, if id was resolved; and return js_true. on failure, it must return js_false. this hook instead of jsresolveop is called via the jsclass.resolve member if jsclass_new_r...
JSObjectOps.defaultValue
e to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the javascript engine calls the jsobjectops.defaultvalue and jsclass.convert callbacks to convert objects to primitive values. ...
...many expressions in the ecmascript language, such as a+b, involve implicit conversion of the operands using [[defaultvalue]]. ...
JSObjectOps.defineProperty
red spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.defineproperty callback is called whenever an object property is defined. it implements js_defineproperty. syntax jsbool (*jsdefinepropop)(jscontext *cx, jsobject *obj, jsid id, jsval value, jspropertyop getter, jspropertyop setter, unsigned int attrs); name type
description cx jscontext * pointer to the js context in which the property is being defined. obj jsobject * the object on which the property is being defined. id jsid the name or index of the property to define. value jsval the initial value for the new property. getter jspropertyop the getter for the new property. setter ...
...t on which the property is being defined. id jsid the name or index of the property to define. value jsval the initial value for the new property. getter jspropertyop the getter for the new property. setter jspropertyop the setter for the new property. attrs unsigned int the property attributes for the new property.
description define obj[id], an own property of obj named id, having the given initial value, with the specified getter, setter, and attributes. ...
JSObjectOps.dropProperty
tops is not a supported api. details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.dropproperty callback releases a jsproperty. syntax typedef void (*jspropertyrefop)(jscontext *cx, jsobject *obj, jsproperty *prop); name type
description cx jscontext * a context that was the cx argument to an earlier call to jsobjectops.lookupproperty that found a property. obj jsobject * the object of which prop is an own property. that is, the value that the jsobjectops.lookupproperty hook stored in the *objp out parameter. prop jsproperty * the property to release. that is, the value that jsobjecto...
...to an earlier call to jsobjectops.lookupproperty that found a property. obj jsobject * the object of which prop is an own property. that is, the value that the jsobjectops.lookupproperty hook stored in the *objp out parameter. prop jsproperty * the property to release. that is, the value that jsobjectops.lookupproperty hook stored in the *propp out parameter.
description the following contract governs jsobjectops callers and implementations: whenever jsobjectops.lookupproperty returns a jsproperty pointer, the property is locked. while the property is locked, the caller may access it using other jsobjectops callbacks. it may not otherwise call into the jsapi in ways that might trigger other property accesses. (in a js_threadsafe build, that would risk deadlo...
JSObjectOps.getAttributes
ext. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.getattributes and setattributes callbacks are called to access the attributes of a property. syntax typedef jsbool (*jsattributesop)(jscontext *cx, jsobject *obj, jsid id, jsproperty *prop, unsigned int *attrsp); name type
description cx jscontext * pointer to the js context in which the property access is happening. obj jsobject * the object whose property attributes are being accessed. id jsid the name or index of the property whose attributes are being accessed. prop jsproperty * the property whose attributes are being accessed. this may be null. attrsp ...
... js context in which the property access is happening. obj jsobject * the object whose property attributes are being accessed. id jsid the name or index of the property whose attributes are being accessed. prop jsproperty * the property whose attributes are being accessed. this may be null. attrsp unsigned int * in/out parameter. see the
description section below.
description get or set attributes of the property obj[id]. returns js_false on error or exception, else js_true with current attributes in *attrsp. if prop is non-null, it must come from the *propp out parameter of a prior jsobjectops.defineproperty or jsobjectops.lookupproperty call. for more information on property attributes, see js_getpropertyattributes. ...
JSObjectOps.lookupProperty
umentation. see bug 408416 for details. the jsobjectops.lookupproperty callback is called for every property access (except when a higher-level callback, such as jsobjectops.getproperty, is overloaded in a way that does not call lookupproperty). syntax typedef jsbool (*jslookuppropop)(jscontext *cx, jsobject *obj, jsid id, jsobject **objp, jsproperty **propp); name type
description cx jscontext * pointer to the js context in which the property lookup is happening. obj jsobject * the object whose properties are being searched. id jsid the name or index of the property to look up. objp jsobject ** out parameter. if the property is found, the callback stores the object on which the property was found in *objp. ...
...s are being searched. id jsid the name or index of the property to look up. objp jsobject ** out parameter. if the property is found, the callback stores the object on which the property was found in *objp. propp jsproperty ** out parameter. on success, the callback stores in *propp a pointer to the property, if it exists, or null if it doesn't.
description look for id in obj and its prototype chain, returning js_false on error or exception, js_true on success. on success, return null in *propp if id was not found. if id was found, return the first object searching from obj along its prototype chain in which id names a direct property in *objp, and return a non-null, opaque property pointer in *propp. if jslookuppropop succeeds and returns with *p...
JSObjectOps.newObjectMap
rnals documentation, not api documentation. see bug 408416 for details. the jsobjectops.newobjectmap callback is called whenever a new object is created. it creates a jsobjectmap that completely controls the new object's behavior. ...
...an application that implements jsobjectops must therefore either implement the newobjectmap by including the non-public header jsobj.h, or obtain the default newobjectmapop by calling the jsclass.getobjectops callback of a standard jsclass. ...
JSObjectOps.setProto
sidered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.setproto and setparent callbacks implement the js_setprototype and js_setparent functions. these callbacks share the same type, jssetobjectslotop. syntax typedef jsbool (*jssetobjectslotop)(jscontext *cx, jsobject *obj, uint32 slot, jsobject *pobj); name type
description cx jscontext * pointer to the js context in which the object's prototype or parent is being modified. obj jsobject * the object whose prototype or parent is being modified. slot uint32 the index of the slot being modified: jsslot_proto for the jsobjectops.setproto callback, and jsslot_parent for the jsobjectops.setparent callback. pobj jsob...
...ext in which the object's prototype or parent is being modified. obj jsobject * the object whose prototype or parent is being modified. slot uint32 the index of the slot being modified: jsslot_proto for the jsobjectops.setproto callback, and jsslot_parent for the jsobjectops.setparent callback. pobj jsobject * the new prototype or parent object.
description these hooks must check for cycles without deadlocking, and otherwise take special steps. see js_setprototype or js_setparent in js/src/jsobj.cpp for an example. ...
JSPrincipals
use js_holdprincipals and js_dropprincipals. codebase char * pointer to the codebase for the principal. obsolete since jsapi 13 getprincipalarray void * (*)(jscontext *, jsprincipals *) pointer to the function that returns an array of principal definitions. obsolete since jsapi 12 globalprivilegesenabled jsbool (*)(jscontext *, jsprincipals *) flag indicating whether principals are enabled globally. ...
... globalprivilegesenabled jsbool (*)(jscontext *, jsprincipals *) flag indicating whether principals are enabled globally. obsolete since jsapi 12 destroy void (*)(jscontext *, jsprincipals *) pointer to the function that decrements the reference count and possibly frees the principals if they are no longer in use. obsolete since jsapi 13 methods name
description void dump() this is not defined by the js engine but should be provided by the embedding. added in spidermonkey 17
description jsprincipals is the abstract base class of all principals objects, the objects that identify the source of a function or script and are used to determine its privileges. a principals object is like a java codesource. jsprincipals could be passed into ...
JSPrincipalsTranscoder
jsprincipalstranscoder is the type of a security callback that can be configured using js_setprincipalstranscoderjsapi 1.8 and earlier or js_setruntimesecuritycallbacksadded in spidermonkey 1.8.1. ...
... each script function is associated with principals, which poses a problem for xdr. the application provides the jsprincipals objects, so it must also provide a jsprincipalstranscoder if it intends to serialize or deserialize principals. ...
JSPropertyDescriptor
setter the set syntax binds an object property to a function to be called when there is an attempt to set that property. ...
... value of the specified property, which can be any valid javascript value (function, object, string...) configurable declare that the property can be modified and deleted enumerable declare that the property can be enumerated, and the enumerable genus can be traversed by the for...in loop. writable declare whether the specified attribute can be rewritten
description a descriptor is a property that describes an object's properties. there are two main types of property descriptors that exist in an object: a data descriptor and an access descriptor. you can use the object.getownpropertydescriptor() function to get the corresponding property of an object. descriptor. examples the following example demonstrates how to use the object.defineproperty() function t...
JSPropertyOp
hich are called during object property accesses. syntax typedef bool (* jspropertyop)(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandlevalue vp); typedef bool (* jsstrictpropertyop)(jscontext *cx, js::handleobject obj, js::handleid id, bool strict, js::mutablehandlevalue vp); // added in spidermonkey 1.9.3 name type
description cx jscontext * the context in which the property access is taking place. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). obj js::handleobject the object whose properties are being accessed. id js::handleid ...
...roperty being accessed. this is either a string (unicode property identifier) or an integer (element index). strict bool (jsstrictpropertyop only) if strict is true, treating the assignment as strict mode code. vp js::mutablehandlevalue in/out parameter. points to a js::value variable. the meaning of this variable is different for each of the hooks; see below.
description jspropertyop and jsstrictpropertyop callbacks are hooks that applications may install to be called at some point during property access. a jspropertyop may be installed on an individual property as a getter or setter; or it may be installed on a jsclass to hook property gets, sets, or adds. these different cases are described in more detail in the sections below. if a jspropertyop or jsstrictpr...
JSPropertySpec
tinyid int8 obsolete since jsapi 31 unique id number for the property to aid in resolving getproperty and setproperty method calls. this value should be zero if you are not using tinyids (i.e. the getter/setter function is only used by one property). flags uint8_t the bitwise or of any number of property a...
...g tinyids (i.e. the getter/setter function is only used by one property). flags uint8_t the bitwise or of any number of property attributes. getter jsnativewrapper or selfhostedwrapper getter method for the property. setter jsnativewrapper or selfhostedwrapper setter method for the property. if a property is read-only, its setter is never called.
description jspropertyspec defines the attributes for a single js property to associate with an object. pass to js_defineproperties or js_initclass to create the properties and assign them to an object. to define an array of jspropertyspec, use js_psg, js_psgs, js_self_hosted_get, js_self_hosted_getset, and js_ps_end see also mxr id search for jspropertyspec jsfunctionspec jsnativewrapper js_defineprope...
JSResolveOp
jsresolveop is the type of the jsclass.resolve. ...
... it resolves a lazy property named by id in obj by defining it directly in obj. lazy properties are those reflected from some peer native property space (e.g., the dom attributes for a given node reflected as obj) on demand. ...
JSTraceOp
for each such thing, a trace implementation must call one of the js_call*tracer variants on the thing. jstraceop implementation can assume that no other threads mutates object state. ...
...for each such thing, a trace implementation must call one of the js_call*tracer variants on the thing. jstraceop implementation can assume that no other threads mutates object state. ...
JS_Add*Root
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. vp jsval * (in js_addvalueroot and js_addnamedvalueroot) the address of the jsval variable to root spp jsstring ** (in js_addstringroot and js_addnamedstringroot) the address of the jsstring* variable t...
...e to root opp jsobject ** (in js_addobjectroot and js_addnamedobjectroot) the address of the jsobject* variable to root rp void ** (in js_addgcthingroot and js_addnamedgcthingroot) the address of the jsstring* or jsobject* (not jsval) variable to root name const char * (in js_addnamedroot and js_addnamedrootrt) the name of the new root, or null.
description the js_add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable. the garbage collector aggressively collects and recycles memory that it deems unreachable, so roots are often necessary to protect data from being prematurely collected. vp/spp/opp/rp is the address o...
JS_AliasElement
obsolete since jsapi 8this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. create an aliased index entry for an existing numeric property of a native object. syntax jsbool js_aliaselement(jscontext *cx, jsobject *obj, const char *name, jsint alias); name type
description cx jscontext * the context in which to create the alias. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object for which to create the alias. name const char * name of the element for which to create an alias. this name corresponds to a string representation of the element's current index...
...equest. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object for which to create the alias. name const char * name of the element for which to create an alias. this name corresponds to a string representation of the element's current index number. alias jsint alias number to assign to the element.
description js_aliaselement assigns an alternate index number for an element or numeric property associated with a native object. obj is the object to which the element belongs. name is the element's current index in the object, and alias is the alternate index to assign to the element. this feature is deprecated, meaning that it is currently supported only for backward compatibility with existing applicatio...
JS_AliasProperty
obsolete since jsapi 8this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. create an alias for a native property. syntax jsbool js_aliasproperty(jscontext *cx, jsobject *obj, const char *name, const char *alias); name type
description cx jscontext * pointer to a js context from which to derive runtime information. ...
...ext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object for which to create the alias. name const char * name of the property for which to create an alias. alias const char * alias name to assign to the property.
description js_aliasproperty assigns an alternate name for a property associated with a native object. obj is the object to which the property belongs. name is the property's current name in the object, and alias is the alternate name to assign to the property. notes this feature has been removed. an alias does not replace a property's name; it supplements it, providing a second way to reference a property. ...
JS_AlreadyHasOwnProperty
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object to be searched. name or id const char * or const char16_t *or js::handleid (in js_alreadyhasownproperty, alreadyhasownucproperty, and js_alreadyhasownpropertybyid) the name of the property to s...
...the length of name, in characters; or the special value (size_t) -1 to indicate that name is null-terminated. index uint32_t (in js_alreadyhasownelement only) the index of the element to search for. foundp bool * out parameter. *foundp receives true if the property is found or false if it is not found. if an error occurs, the value left in *foundp is undefined.
description these functions attempt to determine whether a property already exists on a specific jsobject without modifying the object. by design, this search may not find a property that other property lookup functions, such as js_lookupproperty, would find. for native objects—objects whose properties are stored in the default data structure provided by spidermonkey—these functions simply check that dat...
JS_BeginRequest
indicates to the js engine that the calling thread is entering a region of code that may call into the jsapi but does not block. syntax void js_beginrequest(jscontext *cx); void js_endrequest(jscontext *cx); name type
description cx jscontext * the context in which the calling thread intends to call jsapi functions.
description when your multithreaded application wants to use a jscontext, it must use js_beginrequest and js_endrequest to bracket maximal non-blocking hunks of native code that call the jsapi. this "request model" is necessary to interlock with the global garbage collector. in a js_threadsafe build, many jsapi functions must only be called from within a request. in this reference, the cx parameter of such functions is documented with th...
...equest to bracket maximal non-blocking hunks of native code that call the jsapi. this "request model" is necessary to interlock with the global garbage collector. in a js_threadsafe build, many jsapi functions must only be called from within a request. in this reference, the cx parameter of such functions is documented with the phrase “requires request”, like this: name type
description cx jscontext * the context to use. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. in a debug build, this is enforced with assertions. requests constrain garbage collection. if any thread is in a requests, garbage collection can happen only when that thread calls into the jsapi. if one thread needs garbage collection, it block...
JS_CallFunction
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the "current" object on which the function operates; the object specified here is "this" when the function executes. fun js::handlefunction pointer to the fu...
...s to the function. added in spidermonkey 31 argc unsigned number of arguments you are passing to the function. obsolete since jsapi 30 argv jsval * pointer to the array of argument values to pass to the function. obsolete since jsapi 30 rval js::mutablehandlevalue out parameter. on success, *rval receives the return value from the function call.
description js_callfunction calls a specified function, fun, on an object, obj. in terms of function execution, the object is treated as this. js_callfunctionname calls a function with specified name, name on an object obj. if js engine fails to get the function, it returns false. js_callfunctionvalue calls a specified function, fval on an object obj. js_callfunctionvalue(cx, obj, fval, args, rval) is ana...
JS_CheckAccess
bsolete since jsapi 29this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. check whether a running script may access a given object property. syntax jsbool js_checkaccess(jscontext *cx, jsobject *obj, jsid id, jsaccessmode mode, jsval *vp, unsigned int *attrsp); name type
description cx jscontext * the context in which to perform the access check. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object that has the property being accessed. id jsid the name or index of the property being accessed. mode jsaccessmode the type of access requested (read, wri...
...hat has the property being accessed. id jsid the name or index of the property being accessed. mode jsaccessmode the type of access requested (read, write, etc.) vp jsval * out parameter. on success, *vp receives the property's stored value. attrsp unsigned int * out parameter. on success, *attrsp receives the property attributes.
description js_checkaccess determines whether the property of obj given by id can be accessed by the code currently running in the context cx. the mode parameter specifies what kind of access to check for. it is one of the following values: value
description jsacc_proto check for permission to read to obj's prototype. (this is redundant with passing the string id "__proto__" as id.
JS_ClearRegExpStatics
on successful, js_clearregexpstatics returns true, otherwise returns false. ...
... on successful, js_clearregexpstatics returns true, otherwise returns false. ...
JS_CompileFunction
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object with which the function is associated. name const char * name to assign the newly compiled function. nargs unsigned int number of arguments to pass to the functi...
...r const jschar * string containing the body of the function to compile. length size_t the length, in characters, of body. filename const char * name of file or url containing the function. used to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the file or url if an error occurs.
description js_compilefunction compiles a function from a text string, bytes, and optionally associates it with a js object, obj. js_compileucfunction is the unicode version of the function. name is the name to assign to the newly created function. nargs is the number of arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of ...
JS_CompileFunctionForPrincipals
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object with which the function is to be associated. principals jsprincipals * pointer to the structure holding the security information for this function. name const char ...
... jschar * string containing the source code of the function to compile. length size_t the length, in characters, of body. filename const char * name of file or url containing the function. used to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the file or url if an error occurs.
description js_compilefunctionforprincipals compiles a security-enabled function from a text string, bytes, and associates it with a js object, obj. js_compileucfunctionforprincipals is the unicode version of the function. principals is a pointer to the jsprincipals structure that contains the security information to associate with this function. name is the name to assign to the newly created function. n...
JS_CompileScript
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the global object, or null. if the jsoption_compile_n_go option is set in cx, the resulting script must be executed in this scope, and at most once. obsolete since jsapi 39...
...scope, and at most once. obsolete since jsapi 39 ascii or chars const char * or const char16_t * string containing the script to compile. length size_t the length, in characters, of source. options js::compileoptions & compile options. script js::mutablehandlescript out parameter. on success, script receives the result script.
description js_compilescript compiles a script, source, for execution. js_compileucscript is the unicode version of the function. the script is associated with a js object. ascii and chars are the string containing the text of the script. length indicates the size of the text version of the script in characters. on success, js_compilescript and js_compileucscript stores the newly compiled script to *scrip...
JS_CompileScriptForPrincipals
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object with which the script is associated. principals jsprincipals * pointer to the structure holding the security information for this script. src const char * or const js...
...compile. length size_t the length of src, in characters. filename const char * name of file or url containing the function. used to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the file or url if an error occurs. version jsversion javascript version for the script.
description js_compilescriptforprincipals compiles a security-enabled script, src, for execution. js_compileucscriptforprincipals is the unicode version of the function. the script is associated with a js object. principals is a pointer to the jsprincipals structure that contains the security information to associate with this script. src is the string containing the text of the script. length indicates t...
JS_CompileUTF8File
obsolete since jsapi 19this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. compile a script, reading the source code from a file. syntax jsobject * js_compileutf8file(jscontext *cx, jsobject *obj, const char *filename); name type
description cx jscontext * the context in which to compile the script. ...
...filename is the name of the file containing the script to compile. on success, js_compileutf8file returns an object that represents the newly compiled script. otherwise it returns null. ...
JS_CompileUTF8FileHandle
emoved at any time. try to avoid using it. compile a script, reading the source code from a stdio file. syntax jsobject * js_compileutf8filehandle(jscontext *cx, jsobject *obj, const char *filename, file *file); jsobject * js_compileutf8filehandleforprincipals( jscontext *cx, jsobject *obj, const char *filename, file *file, jsprincipals *principals); name type
description cx jscontext * the context in which to compile the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object with which the script is associated. filename const char * filename to associate with the compiled script. this filename is used for error messages. it should be the name of the ...
...name to associate with the compiled script. this filename is used for error messages. it should be the name of the file that contains the script, if available. file file * the file handle containing the script to compile. principals jsprincipals * (only in js_compileutf8filehandleforprincipals) the security principals to associate with the new script, or null.
description js_compileutf8filehandle reads a script from a stdio file handle and compiles the script for execution by the javascript engine. js_compileutf8filehandleforprincipals is a version of the function for use with spidermonkey's security features. filename is the name of the file containing the script to compile. file is the file handle. js_compileutf8filehandle does not close the file handle. if p...
JS_ConstructObject
d class, with the specified prototype and parent, then invokes a constructor function to initialize the new object. syntax jsobject * js_constructobject(jscontext *cx, jsclass *clasp, jsobject *proto, jsobject *parent); jsobject * js_constructobjectwitharguments(jscontext *cx, jsclass *clasp, jsobject *proto, jsobject *parent, unsigned int argc, jsval *argv); name type
description cx jscontext * the context in which to create the new object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. clasp jsclass * pointer to the class to use for the new object. if this is null, an ordinary javascript object is created. proto jsobject * the object to serve as the new object's prototype, or nul...
...ctobjectwitharguments) the number of arguments to pass to the constructor. argv jsval * (only in js_constructobjectwitharguments) the array of arguments to pass to the constructor. this may be null if argc is zero. otherwise, the first argc elements of this array must be populated with valid jsval values. the caller does not need to ensure that the array elements are rooted.
description js_constructobject creates a new object of the specified class, with the specified prototype and parent, then invokes a constructor function to initialize the new object. cx is a pointer to a context associated with the runtime in which to create the new object. clasp is a pointer to the class of object to create. proto and parent may specify objects to be used as the new object's prototype and ...
JS_ConvertArgumentsVA
try to avoid using it. converts a series of js values, passed in a va_list, to their corresponding jsapi types. syntax bool js_convertargumentsva(jscontext *cx, const js::callargs &args, const char *format, va_list ap); bool js_convertargumentsva(jscontext *cx, unsigned argc, jsval *argv, const char *format, va_list ap); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. args const js::callargs & reference to the arguments to convert. added in spidermonkey 31 argc unsigned the number of arguments to convert. obsolete since jsapi 30 ...
... arguments to convert. obsolete since jsapi 30 format const char * character array containing the recognized format to which to convert. ap va_list the list of pointers into which to store the converted types. there should be one pointer for each converted value. the type va_list is a standard feature of the c programming language. it is defined in <stdarg.h>.
description js_convertargumentsva is to js_convertarguments as vprintf is to printf. see js_convertarguments for further information. if js_convertargumentsva successfully converts all arguments, it returns true. otherwise it returns false. see also mxr id search for js_convertargumentsva js_convertarguments bug 969798 - added args bug 1125784 ...
JS_ConvertValue
obsolete since jsapi 38this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. converts a javascript value to a value of a specific javascript type. syntax bool js_convertvalue(jscontext *cx, js::handlevalue v, jstype type, js::mutablehandlevalue vp); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. type jstype the type to which the value is to be converted. type must be one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jst...
...t. v js::handlevalue the value to convert. type jstype the type to which the value is to be converted. type must be one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean. otherwise js_convertvalue reports an error. vp js::mutablehandlevalue out parameter. on success, *vp receives the converted value.
description js_convertvalue converts a javascript value, v, to the specified type. on success, the converted value is stored in *vp. typically users of this function set vp to point to v, so that if conversion is successful, v now contains the converted value. js_convertvalue calls other, type-specific conversion routines based on the type argument. converting any value to jstype_void always succeeds. t...
JS_DecompileFunctionBody
generate the source code representing the body of a function, minus the function keyword, name, parameters, and braces. syntax jsstring * js_decompilefunctionbody(jscontext *cx, js::handle<jsfunction*> fun, unsigned indent); name type
description cx jscontext * the context in which to decompile the function. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. fun js::handle<jsfunction*> the function to decompile. ...
...iption cx jscontext * the context in which to decompile the function. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. fun js::handle<jsfunction*> the function to decompile. indent unsigned if it's not js_dont_pretty_print, js_decompilefunction returns pretty printed source code of the function.
description js_decompilefunctionbody generates the source code of a function's body, minus the function keyword, name, parameters, and braces, from a function's compiled form, fun. if successful, js_decompilefunctionbody returns a string containing the source code of the function body. otherwise, it returns null. the source code generated by this function is accurate but unadorned and is not suitable for rec...
JS_DecompileScript
if script is a function, it calls js_decompilefunction. otherwise, it returns the original source code of the script. ...
...if script is a function, it calls js_decompilefunction. otherwise, it returns the original source code of the script. ...
JS_DefaultValue
t. this article covers features introduced in spidermonkey 1.8.6 converts a javascript object to a primitive value, using the semantics of that object's internal [[defaultvalue]] hook. renamed to js::toprimitive from jsapi 44. syntax bool js_defaultvalue(jscontext *cx, js::handle<jsobject*> obj, jstype hint, js::mutablehandle<js::value> vp); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> the object to convert. hint jstype the hint to pass to the [[defaultvalue]] hook when converting the object. hint must be jstype_string or jstype_number to pass the...
...*> the object to convert. hint jstype the hint to pass to the [[defaultvalue]] hook when converting the object. hint must be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint. do not pass any other type. vp js::mutablehandle<js::value> out parameter. on success, *vp receives the converted value.
description js_defaultvalue converts a javascript object, obj, to a primitive value using that object's [[defaultvalue]] hook. ecmascript specifies that all objects have a [[defaultvalue]] hook. objects with classes defined by ecmascript itself all use the [[defaultvalue]] algorithm specified in §8.12.8 (but note the algorithm's special case for date objects). objects with a custom jsclass specified by the...
JS_DefineConstDoubles
create multiple constant double or integer valued properties on an object. syntax bool js_defineconstdoubles(jscontext *cx, js::handleobject obj, const jsconstdoublespec *cds); bool js_defineconstintegers(jscontext *cx, js::handleobject obj, const jsconstintegerspec *cis); // added in spidermonkey 38 name type
description cx jscontext * the context in which to define the new properties. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object for which to create new properties. cds jsconstdoublespec * pointer to an array of jsconstdoublespec records containing property names and values to create. the last array element must...
...ties. cds jsconstdoublespec * pointer to an array of jsconstdoublespec records containing property names and values to create. the last array element must contain zero-valued members. cis jsconstintegerspec * pointer to an array of jsconstintegerspec records containing property names and values to create. the last array element must contain zero-valued members.
description js_defineconstdoubles creates one or more properties for a specified object, obj, where each property consists of a double value. js_defineconstintegers creates one or more properties for a specified object, obj, where each property consists of a int32_t value. the attributes for each property is set to jsprop_readonly | jsprop_permanent. obsolete from jsapi 35 each property is automatically a...
JS_DefineElement
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject or jsobject * the object on which to create the new property. index uint32_t the index of the property to define. value js::handlevalue or js::handleobject or js:...
...handlestring or int32_t or uint32_t or double or jsval initial value to assign to the property. getter jsnative or jspropertyop getproperty method for retrieving the current property value. setter jsnative or jsstrictpropertyop setproperty method for specifying a new property value. flags unsigned property attributes. obsolete since jsapi 32
description js_defineelement defines a numeric property for a specified object, obj. index is the index of the element being defined. value is one of js::value, jsobject, jsstring, int32_t, uint32_t, or double that defines the property's initial value. getter and setter identify the getproperty and setproperty methods for the property, respectively. if you pass null values for these entries, js_defineelem...
JS_DefineFunction
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> object for which to define a function as a property (method). name const char * or const char16_t * name to assign to the function. id js::handle<jsid&g...
... id js::handle<jsid> a pointer to jsid for name to assign to the function. added in spidermonkey 17 call jsnative the native c/c++ function to be wrapped by the new function. nargs unsigned number of arguments that are passed to the function when it is called. flags unsigned the logical or of zero or more property attributes.
description js_definefunction exposes a c/c++ function to scripts by defining a new method on an existing javascript object. it creates the new function object as though by calling js_newfunction, then makes it a method of obj as though by calling js_defineproperty. js_defineucfunction is the unicode version of the function. name is the name of the property to create in obj. that is, it is the method name th...
JS_DefineObject
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to which this new object belongs as a property. ...
...belongs as a property. name const char * name of the property being defined in obj to hold the new object. clasp const jsclass * class to use for the new object. proto js::handleobject prototype object to use for the new object, or null. obsolete since jsapi 38 flags unsigned property attributes for the new property being defined.
description js_defineobject creates a new object of the class clasp and assigns it to a new property of an existing object, obj. name is the property name to assign to obj to hold the new object, and flags contains the property attributes to set for the newly created property. the new object's parent is obj. js_defineobject does not call clasp->constructor. initialization of the new object is up to the ca...
JS_DefineOwnProperty
obsolete since jsapi 33this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 please provide a
description for this function. syntax bool js_defineownproperty(jscontext *cx, js::handleobject obj, js::handleid id, js::handlevalue descriptor, bool *bp); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object on which the property should be defined own. id js::handleid the jsid of the property that should be defined. descriptor ...
..., the caller must be in a request on this jscontext. obj js::handleobject object on which the property should be defined own. id js::handleid the jsid of the property that should be defined. descriptor js::handlevalue this should be an jsval consisting of an object interpretable as property descriptor. bp bool * true if successful.
description js_defineownproperty implements the ecmascript defined function object.defineproperty. so the same restrictions apply as for that function (e.g. it is not possible to change a non-configurable property). descriptor is supposed to be a property descriptor, this means you need to create an object with properties such as value, writable, get or set. see object.defineproperty for a list of possible f...
JS_DefineProperties
define multiple properties for a single object. syntax bool js_defineproperties(jscontext *cx, js::handleobject obj, const jspropertyspec *ps); name type
description cx jscontext * the context in which to define the properties. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object on which to define new properties. ps const jspropertyspec * pointer to the first element of an array containing names, ids, flags, and getproperty and setproperty method for the properties to create. ...
... the object on which to define new properties. ps const jspropertyspec * pointer to the first element of an array containing names, ids, flags, and getproperty and setproperty method for the properties to create. the last array element must contain 0-valued members. in spidermonkey versions prior to spidermonkey 24, the last argument to js_definepropeties was not const.
description js_defineproperties creates properties on a specified object, obj. ps is a pointer to the first element of an array of jspropertyspec structures. each array element defines a single property: its name, attributes, getter, and setter. the name field of the last array element must be null. js_defineproperties creates one property for each element in the array before the element with a null name fie...
JS_DefineProperty
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object on which to create the new property. name or id const char * or const char16_t *or js::handleid the name of the new property. namelen size_t (only in js...
... jsnative the property setter callback, which the javascript engine will call each time the property is assigned; or null. attrs unsigned property attributes. desc js::handle<jspropertydescriptor> the property descriptor for the property to be defined. result js::objectopresult & (out parameter) receives the result of the operation.
description js_defineproperty defines a single property in a specified object, obj. js_defineucproperty is the unicode version of the function. js_definepropertybyid is the same but takes a js::handleid for the property name. js_defineproperty is the fundamental operation on which several more convenient, higher-level functions are based, including js_definefunction, js_definefunctions, js_defineproperties...
JS_DefinePropertyWithTinyId
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object for which to create the new property. name const char * or const jschar * name for the property to create. namelen size_t (only in js_defineucpropertywithtinyid) ...
...nt8 8-bit id to aid in sharing getter and setter callbacks among properties. value jsval initial stored value for the new property. getter jspropertyop getproperty method for retrieving the current property value. setter jspropertyop setproperty method for specifying a new property value. attrs unsigned int property attributes.
description js_definepropertywithtinyid defines an object property with a tiny id. js_defineucpropertywithtinyid is the unicode version of the function. except for the tinyid parameter, these functions behave exactly as js_defineproperty and js_defineucproperty. see those functions for more details. tinyid is a signed 8-bit integer that affects the id value passed to certain callbacks. any time the javascr...
JS_DeleteElement
removes a specified element or numeric property from an object. syntax bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index); // added in spidermonkey 45 bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index, js::objectopresult &result); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. ...
...s context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. result js::objectopresult & (out parameter) receives the result of the operation.
description js_deleteelement removes a specified element or numeric property, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement returns true. otherwise it returns false. for javascript 1.2 and earlier, if failure occurs because you ...
JS_DeleteElement2
s obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. removes a specified element or numeric property from an object. renamed to js_deleteelement in jsapi 39 syntax bool js_deleteelement2(jscontext *cx, js::handleobject obj, uint32_t index, bool *succeeded); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. succeeded bool * out parameter. on success, *suc...
... request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. succeeded bool * out parameter. on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise.
description js_deleteelement2 removes a specified element or numeric property, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement2 stores true to *succeeded and returns true. otherwise it returns false and the value of *succeeded is u...
JS_DeleteProperty
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete a property. name or id const char * or jsid or const char16_t * name of the property to delete. namelen size_t (on...
...object object from which to delete a property. name or id const char * or jsid or const char16_t * name of the property to delete. namelen size_t (only in js_deleteucproperty) the length of name in characters; or -1 to indicate that name is null-terminated. result js::objectopresult & (out parameter) receives the result of the operation.
description js_deleteproperty removes a specified property, name, from an object, obj. js_deletepropertybyid is the same but takes a jsid for the property name. these functions are identical to js_deleteproperty2 and js_deletepropertybyid2 except that they do not have an out parameter. first, a property lookup is performed. then one of the following cases applies: if obj has no property with the given n...
JS_DeleteProperty2
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete a property. name or id const char * or const char16_t or js::handleid name of the property to delete. namelen size_t ...
... id const char * or const char16_t or js::handleid name of the property to delete. namelen size_t (only in js_deleteucproperty2) the length of name in characters; or -1 to indicate that name is null-terminated. succeeded bool * out parameter. on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise.
description js_deleteproperty2 removes a specified property, name, from an object, obj, and stores true or false in *succeeded. it behaves like the javascript expression delete obj[name]. js_deleteucproperty2 is the unicode version of the function. js_deletepropertybyid2 is the same but takes a js::handleid for the property name. first, a property lookup is performed. then one of the following cases applie...
JS_DestroyContext
js_destroycontext additionally performs garbage collection to reclaim any memory that was being used by cx's global object. js_destroycontextnogc does not perform garbage collection. ...
...js_destroycontext additionally performs garbage collection to reclaim any memory that was being used by cx's global object. js_destroycontextnogc does not perform garbage collection. ...
JS_DestroyRuntime
call js_destroyruntime after completing all other js api calls. ...
...call js_destroyruntime after completing all other js api calls. ...
JS_DestroyScript
the script must not be currently executing (in any context, at any level of the stack) and must not be used again afterwards. ...
...the script must not be currently executing (in any context, at any level of the stack) and must not be used again afterwards. ...
JS_DumpHeap
ts use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8 debug only. dump the object graph of heap-allocated things. syntax bool js_dumpheap(jsruntime *rt, file *fp, void* startthing, jsgctracekind kind, void *thingtofind, size_t maxdepth, void *thingtoignore); name type
description cx jscontext * pointer to a js context. every jscontext is permanently associated with a jsruntime; each jsruntime contains a gc heap. fp file * file for the dump output. startthing void * null or a pointer to a gc thing (use js::value::togcthing() to obtain a pointer to pass here). when null, dump all things reachable from the runtime roots. when non-...
... the kind associated with a nullptr. jstrace_null = 0x06, // a kind that indicates the real kind should be looked up in the arena. jstrace_outofline = 0x07, // the following kinds do not have an exposed c++ idiom. jstrace_base_shape = 0x0f, jstrace_jitcode = 0x1f, jstrace_lazy_script = 0x2f, jstrace_type_object = 0x3f, jstrace_last = jstrace_type_object };
description see bug 378261 for detail. when tracing a thing, the gc needs to know about the layout of the object it is looking at. there are a fixed number of different layouts that the gc knows about. the "trace kind" is a static map which tells which layout a gc thing has. although this map is public, the details are completely hidden. not all of the matching c++ types are exposed, and those that are, a...
JS_EncodeCharacters
obsolete since jsapi 19this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. convert a 16-bit string to an 8-bit string. syntax jsbool js_encodecharacters(jscontext *cx, const jschar *src, size_t srclen, char *dst, size_t *dstlen); name type
description cx jscontext * a context. src const jschar * the pointer to 16-bit values of jsstring. this can be obtained with js_getstringchars. srclen size_t the length of the source string, in 16-bit values. dst const char * the pointer to an array of bytes to be filled with encoded characters; or null. the caller is responsible for allocating and freei...
...or null. the caller is responsible for allocating and freeing this buffer. dstlenp size_t * in/out parameter. on entry, if dst is non-null, *dstlenp must be the length of the destination string in 16-bit units. on success, *dstlenp receives the length of the converted string, in bytes. on failure, *dstlenp receives the number of bytes written to dst before the error occurred.
description js_encodecharacters copies the characters of a jschar array into a char array, converting the 16-bit values to 8-bit values. if spidermonkey was built with js_c_strings_are_utf8 defined or js_setcstringsareutf8 was called, the string is converted to utf-8. otherwise each character is simply truncated to 8 bits. if utf-8 is turned on, the length of the encoded string may vary. to calculate the n...
JS_EvaluateScript
ing it. compile and execute a script. syntax jsbool js_evaluatescript(jscontext *cx, jsobject *obj, const char *src, unsigned int length, const char *filename, unsigned int lineno, jsval *rval); jsbool js_evaluateucscript(jscontext *cx, jsobject *obj, const jschar *src, unsigned int length, const char *filename, unsigned int lineno, jsval *rval); name type
description cx jscontext * the context in which to run the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. this parameter is documented in detail at js_executescript. src const char * or const jschar * string containing the script to compile and execute.
...he length of src, in characters. filename const char * name of file or url containing the script. used to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the file or url if an error occurs. rval jsval * out parameter. on success, if rval is not null, *rval receives the result value.
description js_evaluatescript compiles and executes a script in the specified scope, obj. js_evaluateucscript is the unicode version of the function. src is the string containing the text of the script. length indicates the size of the text version of the script in characters. filename is the name of the file (or url) containing the script. this information is used in messages if an error occurs during co...
JS_EvaluateScriptForPrincipals
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. this parameter is documented in detail at js_executescript. principals jsprincipals * pointer to the structure holding the security information for...
...ng the script. used to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the file or url if an error occurs. rval jsval * out parameter. on success, *rval receives the value from the last-executed expression statement in the script. version jsversion javascript version for the script.
description js_evaluatescriptforprincipals compiles and executes a script in the specified scope, obj. js_evaluateucscriptforprincipals is the unicode version of the function. principals is a pointer to the jsprincipals structure that contains the security information to associate with this script. src is the string containing the text of the script. length is the length of the script, in characters. fil...
JS_ExecuteRegExp
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject a pointer to a global object. reobj js::handleobject a pointer to a regexp object. chars const char16_t * a pointer to the string contains a input string. length size_t th...
...e length of bytes or chars, in characters. indexp size_t * in/out parameter. a pointer to the lastindex for the execution, and received the updated lastindex. test bool pass true to avoid creating match result array and store boolean value to rval. rval js::mutablehandlevalue out parameter. receives the result match result array or boolean value.
description js_executeregexp and js_newregexpobjectnostatics execute the regexp object, reobj, to the specified input string, chars, from *indexp index. if test is false, js_executeregexp and js_newregexpobjectnostatics store the match result array to *rval if matches, otherwise stores null to *rval. if test is true, js_executeregexp and js_newregexpobjectnostatics store the boolean value true to *rval if m...
JS_ExecuteScript
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the scope in which to execute the script. in the simplest cases, this should just be the embedding's global object. obsolete since jsapi 39 obj must not be an array, an e4x xml object,...
... it needs to contain the other objects that should end up on the scripts's scope chain. objects in the vector should be ordered from inner to the outer scope. script js::handlescript the compiled script to execute. rval js::mutablehandlevalue out parameter. on success, rval receives the value from the last executed expression statement processed in the script.
description js_executescript executes a previously-compiled script, script. js::cloneandexecutescript handles a cross-compartment script. if the script is cross-compartment, it is cloned into the current compartment before executing. if the script executes successfully, rval receives the value from the last executed expression statement processed in the script, and js_executescript returns true. otherwise...
JS_ExecuteScriptPart
it could be removed at any time. try to avoid using it. js_executescriptpart has been removed in bug 555104. use js_executescript instead. executes a part of a compiled script. syntax typedef enum jsexecpart { jsexec_prolog, jsexec_main } jsexecpart; jsbool js_executescriptpart( jscontext *cx, jsobject *obj, jsscript *script, jsexecpart part, jsval *rval); name type
description cx jscontext * the context in which to execute the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. this parameter is documented in detail at js_executescript. script jsscript * the compiled script to execute. part jsexecpart th...
... obj jsobject * the scope in which to execute the script. this parameter is documented in detail at js_executescript. script jsscript * the compiled script to execute. part jsexecpart the part of script to execute. rval jsval * out parameter. on success, *rval receives the value from the last executed expression statement in the script.
description js_executescriptpart executes part of a previously compiled script, script. the part parameter must be either jsexec_prolog to execute the script prolog or jsexec_main to execute the main section of the script. if the script executes successfully, js_executescriptpart stores the value of the last-executed expression statement in the script in *rval and returns js_true. otherwise it returns js_fal...
JS_ExecuteScriptVersion
it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 execute a compiled script with specified version. syntax jsbool js_executescriptversion(jscontext *cx, jsobject *obj, jsobject *scriptobj, jsval *rval, jsversion version); name type
description cx jscontext * the context in which to execute the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. in the simplest cases, this should just be the embedding's global object. obj must not be an array, an e4x xml object, a with object, or a proxy. ...
...ast object in the scope chain is used as the variable object. otherwise obj is used. the this value is obj. script jsobject * the compiled script to execute. rval jsval * out parameter. on success, *rval receives the value from the last executed expression statement processed in the script. version jsversion version for the script.
description js_executescript executes a previously-compiled script, script. if the script executes successfully, *rval receives the value from the last executed expression statement processed in the script, and js_executescript returns true. otherwise it returns false, and the value left in *rval is unspecified. to execute a script that has not been compiled, use js::evaluate instead. see also js::com...
JS_FS
stedname,nargs,flags) ... // added in spidermonkey 31 #define js_self_hosted_sym_fn(symbol, selfhostedname, nargs, flags) ... // added in spidermonkey 38 #define js_sym_fnspec(symbol, call, info, nargs, flags, selfhostedname) ... // added in spidermonkey 38 #define js_fnspec(name,call,info,nargs,flags,selfhostedname) ... // added in spidermonkey 31 #define js_fs_end ... name type
description name const char * the javascript name for the function. (or index, if jsprop_index is present in flags) symbol a member name of js::symbolcode the javascript symbol for the function. call jsnative pointer to the c/c++ implementation of the function. info const jsjitinfo * pointer to the jit info. nargs uint16_t the number ...
.... call jsnative pointer to the c/c++ implementation of the function. info const jsjitinfo * pointer to the jit info. nargs uint16_t the number of arguments the function expects. flags uint16 the bitwise or of any number of function flags. selfhostedname const char * the function's name in self-hosted javascript code.
description use these macros to define an array of jsfunctionspecs to pass to js_definefunctions or js_initclass. js_fn (whose name pays homage to the old jsnative/jsfastnative split) simply adds the flag jsfun_stub_gsops. js_fninfo allows the simple adding of jsjitinfos. js_self_hosted_fn declares a self-hosted function. finally js_fnspec has slots for all the fields. the _sym variants allow defining a func...
JS_ForwardGetPropertyTo
ied property and retrieve its value. syntax bool js_forwardgetpropertyto(jscontext *cx, js::handleobject obj, js::handleid id, js::handleobject onbehalfof, js::mutablehandlevalue vp); bool js_forwardgetelementto(jscontext *cx, js::handleobject obj, uint32_t index, js::handleobject onbehalfof, js::mutablehandlevalue vp); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. id or index js::handleid or uint32_t name or index of the property to look up. onbehalfof js::handleobject object to receive getter invocation. vp ...
... js::handleobject object to search on for the property. id or index js::handleid or uint32_t name or index of the property to look up. onbehalfof js::handleobject object to receive getter invocation. vp js::mutablehandlevalue out parameter. on success, *vp receives the current value of the property, or undefined if no such property is found.
description js_forwardgetpropertyto is the base implementation of js_getproperty, js_getucproperty, js_getpropertybyid etc, where onbehalfof is same to obj. onbehalfof is receiver in [[get]] internal method of proxy, defined in es2015 draft spec (rev 29, 9.5.8). on success, these functions set *vp to the current value of the property, or undefined if obj has no such property, and return true. on an error ...
JS_FreezeObject
this means that other code cannot delete, add or change any properties on the object. ...
...this means that other code cannot delete, add or change any properties on the object. ...
JS_GET_CLASS
it could be removed at any time. try to avoid using it. retrieves the class associated with an object. this macro was removed in spidermonkey 1.8.8 when the signature of js_getclass() was changed to take only an object pointer. syntax #ifdef js_threadsafe #define js_get_class(cx,obj) js_getclass(cx, obj) #else #define js_get_class(cx,obj) js_getclass(obj) #endif parameter type
description cx jscontext * any context associated with the runtime in which obj exists. obj jsobject * object to get the class from. note: in spidermonkey versions prior to spidermonkey 1.8.8, js_getclass took both a jscontext* and a jsobject* as arguments in thread-safe builds, and in non-thread-safe builds it took only a jsobject*. the js_get_class(cx, obj) macro ...
...e: in spidermonkey versions prior to spidermonkey 1.8.8, js_getclass took both a jscontext* and a jsobject* as arguments in thread-safe builds, and in non-thread-safe builds it took only a jsobject*. the js_get_class(cx, obj) macro abstracted away this detail. newer versions have removed the context argument, so that the same signature is used regardless whether or not the build is thread-safe.
description js_get_class returns a pointer to the jsclass associated with a specified js object, obj. the application must treat the jsclass as read-only. to check the type of an object, use js_hasinstance instead. for a stricter, exact-match-only check, use js_instanceof or js_getinstanceprivate. the js_get_class abstracted away signature differences in the js_getclass method in threadsafe and non-threadsaf...
JS_GetConstructor
if the result is a function object, js_getconstructor returns a pointer to that object. otherwise, it reports an error and returns null. ...
...if the result is a function object, js_getconstructor returns a pointer to that object. otherwise, it reports an error and returns null. ...
JS_GetElement
find a specified numeric property of an object and return its current value. syntax bool js_getelement(jscontext *cx, js::handleobject obj, uint32_t index, js::mutablehandlevalue vp); name type
description cx jscontext * the context in which to perform the property lookup. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the element. index uint32_t index of the element to look up. ...
...lookup. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the element. index uint32_t index of the element to look up. vp js::mutablehandlevalue out parameter. on success, *vp receives the current value of the element, if it exists, and undefined otherwise.
description js_getelement examines a specified js object, obj, and its prototype chain, for an element or numeric property numbered index. if the element exists, js_getelement sets *vp to the element's current value. if not, it sets *vp to undefined and returns true (to indicate no error occurred). if the search fails with an error or exception, js_getelement returns false, and the value left in *vp is undef...
JS_GetExternalStringClosure
ete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 6 returns the string closure stored in a jsstring created by calling js_newexternalstringwithclosure. syntax void * js_getexternalstringclosure(jscontext *cx, jsstring *str); name type
description cx jscontext * the context from which to retrieve the closure for a string. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * the string for which to return the closure. the result is null if the external string was created without one (that is, by calling js_newexternalstring rather than js_newexternalstrin...
...text * the context from which to retrieve the closure for a string. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * the string for which to return the closure. the result is null if the external string was created without one (that is, by calling js_newexternalstring rather than js_newexternalstringwithclosure).
description to determine if a string was created as an external string, you can call js_isexternalstring. see also bug 724810 ...
JS_GetFlatStringChars
api 33this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 get the chars of a flat string. use js_flattenstring to flatten the string. ...
...e it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 get the chars of a flat string. use js_flattenstring to flatten the string. ...
JS_GetFunctionId
the returned string lives as long as fun, so you don't need to root a saved reference to it if fun is well-connected or rooted, and provided you bound the use of the saved reference by fun's lifetime. ...
...the returned string lives as long as fun, so you don't need to root a saved reference to it if fun is well-connected or rooted, and provided you bound the use of the saved reference by fun's lifetime. ...
JS_GetFunctionName
the return value is either the name of a function, or the string "anonymous", which indicates that the function was not assigned a name when created. ...
...the return value is either the name of a function, or the string "anonymous", which indicates that the function was not assigned a name when created. ...
JS_GetFunctionObject
fun must be either a function implemented by a jsnative (or jsfastnative) or the result of a call to js_compilefunction or similar functions. ...
... fun must be either a function implemented by a jsnative (or jsfastnative) or the result of a call to js_compilefunction or similar functions. ...
JS_GetGlobalForObject
for function object inputs, the result is "the global object" as referred to in the ecmascript specification. ...
...for function object inputs, the result is "the global object" as referred to in the ecmascript specification. ...
JS_GetInstancePrivate
if that object is an instance of a specified class. syntax void * js_getinstanceprivate(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, js::callargs *args); // added in jsapi 32 void * js_getinstanceprivate(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, jsval *argv); // obsolete since jsapi 32 name type
description cx jscontext * a context. obj js::handle<jsobject*> the object for which to retrieve private data. clasp jsclass * class against which to test the object. args js::callargs * optional argument, used for error reporting. added in spidermonkey 32 argv jsval * optional argument vector, used for error reporting. o...
...g. added in spidermonkey 32 argv jsval * optional argument vector, used for error reporting. obsolete since jsapi 32 this must be one of the following: an argv pointer created by the javascript engine and passed to a jsnative callback; js_argv(cx, vp) where vp is a pointer created by the engine and passed to a jsfastnative callback; or null.
description js_getinstanceprivate determines if a javascript object, obj, is an instance of a given jsclass, clasp, and if it is, returns a pointer to the object's private data. otherwise it returns null. note that if obj is an instance of clasp, but there is no private data currently associated with the object, or the object cannot have private data, js_getinstanceprivate also returns null. if you pass a no...
JS_GetLatin1InternedStringChars
cle covers features introduced in spidermonkey 38 get the chars of an interned string. ...
... if successful, js_getlatin1stringcharsandlength and js_gettwobytestringcharsandlength return a pointer to the string, otherwise return null. ...
JS_GetLatin1StringCharsAndLength
the length of a string. ...
... if successful, js_getlatin1stringcharsandlength and js_gettwobytestringcharsandlength return a pointer to the string, and store the length to *length, otherwise return null. ...
JS_GetProperty
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. name or id const char * or const char16_t * or js::handleid name of the property to look up. namelen size_t (in js_getucproperty only) the length of name, in c...
...or id const char * or const char16_t * or js::handleid name of the property to look up. namelen size_t (in js_getucproperty only) the length of name, in characters; or -1 to indicate that name is null-terminated. vp js::mutablehandlevalue out parameter. on success, *vp receives the current value of the property, or undefined if no such property is found.
description js_getproperty examines a specified js object obj and its prototype chain for a property with the specified name. it behaves like the javascript expression obj[name]. js_getucproperty is the unicode version of the function. js_getpropertybyid is the same but takes a js::handleid for the property name. in the simplest case, js_getproperty stores the value of the property in *vp and returns true.
JS_GetPropertyAttributes
e removed at any time. try to avoid using it. get the attributes of a specified property. syntax jsbool js_getpropertyattributes(jscontext *cx, jsobject *obj, const char *name, unsigned int *attrsp, jsbool *foundp); jsbool js_getucpropertyattributes(jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, unsigned int *attrsp, jsbool *foundp); name type
description cx jscontext * the context in which to look up property attributes. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object that has the property to be queried. name const char * or const jschar * name of the property from which to retrieve attributes. namelen size_t (only ...
...1 to indicate that name is null-terminated. attrsp unsigned int * out parameter. if the specified property is found on obj, *attrsp receives its attributes. foundp jsbool * out parameter. if no error occurs, *foundp receives js_true if the specified property is found and js_false if it is not found. if an error occurs, the value left in *foundp is unspecified.
description js_getpropertyattributes retrieves the property attributes of the property with the given name on a given object, obj. js_getucpropertyattributes is the unicode version of the function. if an error occurs, the return value is js_false, and the values left in *attrsp and *foundp are unspecified. if obj does not have the specified property, or if it inherits it from some other object (on its pro...
JS_GetPropertyAttrsGetterAndSetter
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object from which to retrieve property attributes. name or id const char * or const jschar * or jsid the name of the property to examine. namelen size_t (only in...
... foundp jsbool * out parameter. flag indicating whether or not the specified property was located. getterp jspropertyop * out parameter. on success, *getterp receives a pointer to the getter function for the specified property. setterp jspropertyop * out parameter. on success, *setterp receives a pointer to the setter function for the specified property.
description see js_getpropertyattributes for details about these functions. the only difference is that on success, these functions also get the getter and setter functions for the property. the js_getter (or js_setter) attribute indicates that the property's getter (or setter) is a javascript function, not a c/c++ function. when this attribute is present, the value stored in getterp (or setterp) does not ...
JS_GetPropertyDefault
finds a specified property and retrieves its value or provided default value. syntax bool js_getpropertydefault(jscontext *cx, jsobject *obj, const char *name, jsval def, js::mutablehandle<js::value> vp); bool js_getpropertybyiddefault(jscontext *cx, jsobject *obj, jsid id, jsval def, js::mutablehandle<js::value> vp); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. name or id const char * or js::handleid name of the property to look up. def js::handlevalue default value if the property is not found. vp js::mut...
... obj js::handleobject object to search on for the property. name or id const char * or js::handleid name of the property to look up. def js::handlevalue default value if the property is not found. vp js::mutablehandlevalue out parameter. on success, *vp receives the current value of the property, or undefined if no such property is found.
description js_getpropertydefault examines a specified js object obj and its prototype chain for a property with the specified name. on success, these functions set *vp to the current value of the property, or def if obj has no such property, and return true. on an error or exception, these functions return false, and the value left in *vp is undefined. see also bug 905774 ...
JS_GetReservedSlot
access an object's reserved slots. ...
...lete since spidermonkey 42 jsval js_getreservedslot(jsobject *obj, uint32_t index); void js_setreservedslot(jsobject *obj, uint32_t index, jsval v); name type
description obj jsobject * an object that has reserved slots. index uint32_t index of the reserved slot to access. v js::value (in js_setreservedslot) the value to store.
description if a jsclass has jsclass_has_reserved_slots(n) in its flags, with n > 0, or has a non-null jsclass.reserveslots callback, then objects of that class have n reserved slots in which the application may store data. these fields are not directly exposed to scripts. reserved slots may contain any js::value, and the garbage collector will hold the value alive as long as the object itself is alive. r...
JS_GetRuntimePrivate
it is especially useful for storing data which callbacks may then easily access. ...
...it is especially useful for storing data which callbacks may then easily access. ...
JS_GetSecurityCallbacks
callbacks const jssecuritycallbacks * a pointer to the new callbacks for the runtime. callback structure struct jssecuritycallbacks { jscspevalchecker contentsecuritypolicyallows; // added in spidermonkey 1.8.5 jssubsumesop subsumes; // added in spidermonkey 31 jsc...
...ontentsecuritypolicyallows; // added in spidermonkey 1.8.5 jssubsumesop subsumes; // added in spidermonkey 31 jscheckaccessop checkobjectaccess; // obsolete since jsapi 29 jsprincipalstranscoder principalstranscoder; // obsolete since jsapi 13 jsobjectprincipalsfinder findobjectprincipals; // obsolete since jsapi 13 }; name type
description contentsecuritypolicyallows jscspevalchecker a pointer to the function which checks if a csp instance wants to disable eval() and friends. use null is not needed. subsumes jssubsumesop a pointe to the function which returns whether the first principal subsumes the second. use null is not needed.
description js_setsecuritycallbacks sets the runtime's security ca...
JS_GetStringCharAt
this article covers features introduced in spidermonkey 38 return a specified character from a string. syntax bool js_getstringcharat(jscontext *cx, jsstring *str, size_t index, char16_t *res); char16_t js_getflatstringcharat(jsflatstring *str, size_t index); name type
description cx jscontext * the context in which to create the new string. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...he new string. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * or jsflatstring * the string to get character. index size_t an integer between 0 and 1-less-than the length of the string. res char16_t * (js_getstringcharat only) out parameter. on successful, receives the character code.
description js_getstringcharat and js_getflatstringcharat get the specified character from the string str. on successful, js_getstringcharat returns true and stores the character code into *res, otherwise returns false. js_getflatstringcharat always succeeds, and returns the character code. index should not be greater than or equal to the length of str. see also mxr id search for js_getstringcharat ...
JS_GetStringCharsAndLength
33this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 get the characters and the length of a string. ...
...ar * js_getstringcharsandlength(jscontext *cx, jsstring *str, size_t *length); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * a string to get characters. length size_t * out parameter. receives the length of the string. ...
JS_GetTwoByteExternalStringChars
js_gettwobyteexternalstringchars always succeeds, and returns a pointer to the string. ...
... js_gettwobyteexternalstringchars always succeeds, and returns a pointer to the string. ...
JS_GetVersion
the result is one of the jsversion constants. when a context is created, its version is initially jsversion_default. scripts are compiled using the latest version of the javascript language. ...
...the result is one of the jsversion constants. when a context is created, its version is initially jsversion_default. scripts are compiled using the latest version of the javascript language. ...
JS_HasArrayLength
obsolete since jsapi 8this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determines if an object has an array length property. ...
...if the property exists, js_hasarraylength stores the current value of the property in *lengthp. on success, js_hasarraylength returns js_true, and *lengthp receives the current value of the length property. on failure, js_hasarraylength returns js_false, and the value left in *lengthp is undefined. ...
JS_HasOwnProperty
this article covers features introduced in spidermonkey 45 determine whether a javascript object has a specified own property. syntax bool js_hasownproperty(jscontext* cx, handleobject obj, const char* name, bool* foundp) bool js_hasownpropertybyid(jscontext* cx, handleobject obj, handleid id, bool* foundp) name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. name or id const char * or js::handleid name of the property to look up. foundp bool * non-null pointer to a variable of type bool. on success, js_hasownproperty stores t...
...in a request on this jscontext. obj js::handleobject object to search on for the property. name or id const char * or js::handleid name of the property to look up. foundp bool * non-null pointer to a variable of type bool. on success, js_hasownproperty stores true in this variable if obj has an own property with the given name, and false if not.
description js_hasownproperty searches an object, obj, for an own property with the specified name. it behaves like the javascript expression object.hasownproperty(obj, name). js_hasownpropertybyid is the same but takes a js::handleid for the property name. if the property exists, this function sets *foundp to true and returns true. if the object obj has no such property, the function sets *foundp to fals...
JS_HasProperty
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. name or id const char * or const char16_t or js::handleid name of the property to look up. namelen size_t (only in js_hasucproperty) the length of name in char...
...st char16_t or js::handleid name of the property to look up. namelen size_t (only in js_hasucproperty) the length of name in characters, or -1 to indicate that name is null-terminated. foundp bool * non-null pointer to a variable of type bool. on success, js_hasproperty stores true in this variable if obj has a property with the given name, and false if not.
description js_hasproperty searches an object, obj, and its prototype chain, for a property with the specified name. it behaves like the javascript expression name in obj. js_hasucproperty is the corresponding unicode api. js_haspropertybyid is the same but takes a js::handleid for the property name. if the property exists, this function sets *foundp to true and returns true. if the object obj has no such pr...
JS_InitClass
its prototype, constructor, properties, and functions. syntax jsobject * js_initclass(jscontext *cx, js::handleobject obj, js::handleobject parent_proto, const jsclass *clasp, jsnative constructor, unsigned nargs, const jspropertyspec *ps, const jsfunctionspec *fs, const jspropertyspec *static_ps, const jsfunctionspec *static_fs); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject pointer to the "globals" object to use for initializing the class. this must not be null. once js_initclass creates the new class's constructor, it stores the constructor a...
...nearest javascript equivalent of public static member variables in c++ or public static fields in java.) static_fs jsfunctionspec * either null or a pointer to the first element of an array of jsfunctionspecs, terminated by js_fs_end. these functions, if any, are added to the new class's constructor. (this is the javascript equivalent of public static methods in c++ or java.)
description js_initclass initializes a jsclass and (optionally) makes it visible to javascript code. this is one way to create jsobjects whose properties and methods are implemented in native c/c++. if you need a native function but you don't need to support instances or inheritance, js_initclass might be overkill. js_definefunction is simpler. a jsapi class consists of a jsclass structure, a constructor, a ...
JS_InstanceOf
determine if an object is an instance of a specified jsclass. syntax bool js_instanceof(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, js::callargs *args); // added in spidermonkey 38 bool js_instanceof(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, jsval *argv); // obsolete since jsapi 32 name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> object to test. clasp jsclass * class against which to test the object. args js::callargs * optional pointer to arguments. if non-null, report an...
...llargs * optional pointer to arguments. if non-null, report an error if obj is not of type clasp. added in spidermonkey 38 argv jsval * optional argument vector. if non-null, report an error if obj is not of type clasp. argv must be the argv argument passed from the engine to a jsnative callback, js_argv(cx, rv) in a jsfastnative callback, or null. obsolete since jsapi 32
description js_instanceof can be used to check whether an object obj is of a particular jsclass. to use it this way, pass null for argv. js_instanceof returns true if obj is of the given class and false otherwise. that is, it returns js_getclass(obj) == clasp. js_instanceof can also be used in native functions to check the class of an argument when a particular class is required. to use it this way, pass t...
JS_InternString
c and automatically shared with other code that needs a jsstring with the same value. syntax jsstring * js_internstring(jscontext *cx, const char *s); jsstring * js_internstringn(jscontext *cx, const char *s, size_t length); jsstring * js_internucstring(jscontext *cx, const char16_t *s); jsstring * js_internucstringn(jscontext *cx, const char16_t *s, size_t length); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. s const char * or const char16_t * pointer to a character array containing the data for the string. in js_internstring and js_internucstring, the string must be null-terminated. length size_t (only in js_internstringn and js_internuc...
...ires request. in a js_threadsafe build, the caller must be in a request on this jscontext. s const char * or const char16_t * pointer to a character array containing the data for the string. in js_internstring and js_internucstring, the string must be null-terminated. length size_t (only in js_internstringn and js_internucstringn) the length of s in characters.
description js_internstring and js_internstringn return an interned javascript string with a specified value, s. js_internucstring and js_internucstringn are the unicode versions of the function. each jsruntime keeps a table of all existing interned strings. if an interned string already exists with the desired value, these functions return the existing string. otherwise a new string is created and added to ...
JS_IsConstructing_PossiblyWithGivenThisObject
ince it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 determine if a special this object was supplied to the constructor. ...
...sconstructing_possiblywithgiventhisobject(jscontext *cx, const jsval *vp, jsobject **maybethis); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. vp const jsval * maybethis jsobject **
description in the case of a constructor called from js_constructobject and js_initclass where the class has the jsclass_construct_prototype flag set, spidermonkey passes the constructor a non-standard this object. in such cases, the following example would provide the additional information of whether a special this was supplied. jsbool foo_native(jscontext *cx, unsigned int argc, jsval *vp) { jsobject ...
JS_IsIdentifier
requires request. ...
...uires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str js::handlestring the string to test. chars const char16_t * the pointer of the string to test. length size_t the length of chars. isidentifier bool * out parameter. on success, *isidentifier receives whether str is an identifier or not.
description js_isidentifier tests if the given string is a valid ecmascript identifier. on successful, js_isidentifier stores the test result to *isidentifier and returns true, otherwise returns false and the value of *isidentifier is undefined. js_isidentifier which takes chars and length is infallible, so just returns whether the chars are an identifier. see also mxr id search for js_isidentifier js...
JS_IterateCompartments
this article covers features introduced in spidermonkey 17 iterate over compartments and call the specified callback function on every compartment. syntax void js_iteratecompartments(jsruntime *rt, void *data, jsiteratecompartmentcallback compartmentcallback); name type
description cx jsruntime * the runtime of the compartments to iterate over. ...
...runtime of the compartments to iterate over. data void * this will be passed as the data parameter of the jsiteratecompartmentcallback. compartmentcallback jsiteratecompartmentcallback callback function (see below). callback function typedef void (*jsiteratecompartmentcallback)(jsruntime *rt, void *data, jscompartment *compartment); name type
description cx jsruntime * the runtime of the compartments. data void * data parameter passed to js_iteratecompartments. compartmentcallback jscompartment * the pointer to the compartment.
description js_iteratecompartments calls compartmentcallback on every compartment. beware that there is no guarantee that the compartment will survive after the callback...
JS_LinkConstructorAndPrototype
this article covers features introduced in spidermonkey 17 set up ctor.prototype = proto and proto.constructor = ctor with the right property flags. syntax bool js_linkconstructorandprototype(jscontext *cx, js::handle<jsobject*> ctor, js::handle<jsobject*> proto); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. ...
... on successful, js_linkconstructorandprototype returns true. ...
JS_LockGCThing
emoved at any time. try to avoid using it. protect a specified js item from garbage collection. ...
...thing is a pointer to a jsdouble, jsstring, or jsobject. ...
JS_LookupElement
obsolete since jsapi 37this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determine if a specified numeric property exists. syntax bool js_lookupelement(jscontext *cx, js::handleobject obj, uint32_t index, js::mutablehandlevalue vp); name type
description cx jscontext * the context in which to look up the property. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search. index uint32_t the numeric id of the property to look up. vp js::mutablehandlevalue out parameter. on success, *vp receives the stored value of obj[i...
...property. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search. index uint32_t the numeric id of the property to look up. vp js::mutablehandlevalue out parameter. on success, *vp receives the stored value of obj[index], or undefined if the element does not exist.
description js_lookupelement examines a specified javascript object, obj, for a numeric property numbered index. note: in the javascript language, numeric properties (also called "elements") are just ordinary properties whose names are numeric strings. for example, obj[6] is always exactly the same as obj["6"]. the ecmascript standard also specifies this behavior: see ecma 262-3 §11.2.1, step 6. so any ca...
JS_LookupProperty
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. name or id const char * or const char16_t *or js::handleid name of the property to look up. namelen size_t ...
... a combination of bits requesting special search behavior. see flags below. objp js::mutablehandleobject out parameter. on success, *objp receives the object on which the property was found. this will be either obj or an element on obj's prototype chain. vp js::mutablehandleobject out parameter. on success, *vp receives the stored value of the property, if any.
description the functions js_lookupproperty, js_lookupucproperty, js_lookuppropertybyid, js_lookuppropertywithflags, and js_lookuppropertywithflagsbyid search a specified object, obj, for a property with the given name. these functions all have similar behavior: the search starts with obj and proceeds along the prototype chain. if the property is found, *vp receives the property's stored value, or true if...
JS_MakeStringImmutable
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. make a jsstring thread-safe. syntax jsbool js_makestringimmutable(jscontext *cx, jsstring *str); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...be removed at any time. try to avoid using it. make a jsstring thread-safe. syntax jsbool js_makestringimmutable(jscontext *cx, jsstring *str); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. s jsstring * the string to operate on. s must not be null.
description a string's characters can never be changed, but spidermonkey uses two string optimization techniques behind the scenes: a growable string (see js_newgrowablestring ) has a buffer that the javascript engine can reallocate so that concatenating it with another string is much faster. a dependent string (see js_newdependentstring) is a substring of another (growable, dependent, or immutable) stri...
JS_MaybeGC
if so, it performs some garbage collection. calling js_maybegc when the application is idle can help prevent garbage collection from happening at less convenient times. ...
...if so, it performs some garbage collection. calling js_maybegc when the application is idle can help prevent garbage collection from happening at less convenient times. ...
JS_New
this article covers features introduced in spidermonkey 1.8 create an object as though by using the new keyword and a javascript function. syntax jsobject * js_new(jscontext *cx, js::handleobject ctor, const js::handlevaluearray& args); // added in jsapi 32 jsobject * js_new(jscontext *cx, jsobject *ctor, unsigned argc, jsval *argv); // obsolete since jsapi 32 name type
description cx jscontext * the context in which to create the new object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ctor js::handleobject the constructor function object. args js::handlevaluearray & an array of argument values to pass to the constructor. added in spidermonkey 38 argc unsigned ...
... args js::handlevaluearray & an array of argument values to pass to the constructor. added in spidermonkey 38 argc unsigned the number of arguments to pass to the constructor. obsolete since jsapi 32 argv jsval * pointer to the element 0 of an array of argument values to pass to the constructor. if argc is 0, this may be null. obsolete since jsapi 32
description js_new creates a new object as though by using the new operator, as described in ecma 262-3 §11.2.2. js_new(cx, ctor, args) is equivalent to the javascript expression new ctor(...args), and js_new(cx, ctor, argc, argv) is equivalent to the javascript expression new ctor(argv[0], argv[1], ... argv[argc-1]). if ctor is not an object that can be used as a constructor, a typeerror is raised. on s...
JS_NewArrayObject
create a new array object. syntax jsobject * js_newarrayobject(jscontext *cx, const js::handlevaluearray& contents); // added in spidermonkey 31 jsobject * js_newarrayobject(jscontext *cx, size_t length); // added in spidermonkey 31 jsobject * js_newarrayobject(jscontext *cx, int length, jsval *vector); // obsolete since jsapi 30 name type
description cx jscontext * the context in which to create the new array. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. contents js::handlevaluearray& reference to the initial values for the array's elements. added in spidermonkey 31 length size_t or int the length of the new array. this must not be negative. vector jsval * pointer...
...e caller must be in a request on this jscontext. contents js::handlevaluearray& reference to the initial values for the array's elements. added in spidermonkey 31 length size_t or int the length of the new array. this must not be negative. vector jsval * pointer to the initial values for the array's elements, or null. obsolete since jsapi 30
description js_newarrayobject with contents parameter creates a new array object with the specified contents elements. js_newarrayobject defines an enumerable array element with the value contents[i] on the new array. js_newarrayobject with length parameter creates a new array object with the specified length; the result is like the javascript expression new array(length). the new array has the specified l...
JS_NewCompartmentAndGlobalObject
using it. this article covers features introduced in spidermonkey 1.8.1 js_newcompartmentandglobalobject has been removed in bug 755186. use js_newglobalobject instead. create a new global object in a new compartment. syntax jsobject * js_newcompartmentandglobalobject(jscontext *cx, jsclass *clasp, jsprincipals *principals); name type
description cx jscontext * the context in which to create the new global object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. clasp jsclass * the class to use for the new global object. clasp->flags must have the jsclass_global_flags bits set. the caller must ensure that the jsclass remains alive throughout the lifet...
... clasp->flags must have the jsclass_global_flags bits set. the caller must ensure that the jsclass remains alive throughout the lifetime of the new object, including the garbage collection cycle that finally frees it. the usual way to do this is to make jsclasses global or static. principals jsprincipals * the security information to associate with this compartment.
description js_newcompartmentandglobalobject creates a new compartment, and then creates a new global object as the first object in that compartment. on success, js_newcompartmentandglobalobject returns a pointer to the new global object. otherwise it returns null. see also js_newglobalobject bug 755186 bug 563099 ...
JS_NewContext
on success, it returns a pointer to the new context. ...
...t jsruntime * parent runtime for the new context. javascript objects, functions, strings, and numbers may be shared among the contexts in a jsruntime, but they cannot be shared across jsruntimes. stackchunksize size_t the size, in bytes, of each "stack chunk". this is a memory management tuning parameter which most users should not adjust. 8192 is a good default value.
description js_newcontext creates a new jscontext in the runtime rt. on success, it returns a pointer to the new context. otherwise it returns null. for more details about contexts, see jscontext. for sample code that creates and initializes a jscontext, see jsapi user guide. the stackchunksize parameter does not control the javascript stack size. (the jsapi does not provide a way to adjust the stack depth...
JS_NewDateObject
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. year int the year to set the new object to. ...
... jscontext. year int the year to set the new object to. mon int the month to set the new object to. mday int the day of the month to set the new object to. hour int the hour to set the new object to. min int the minute to set the new object's time to. sec int the second to set the new object's time to.
description creates and returns a new jsobject representing a javascript date object, which is pre-configured using the specified values. see also mxr id search for js_newdateobject js_newdateobjectmsec js_objectisdate bug 625870 ...
JS_NewDoubleValue
obsolete since jsapi 17this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. use js_numbervalue instead. create a floating-point jsval syntax jsbool js_newdoublevalue(jscontext *cx, jsdouble d, jsval *rval); name type
description cx jscontext * the context in which to create the new number. ...
... the context in which to create the new number. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. d jsdouble the numeric value to convert. this must not be a value that could fit in an integer jsval (see int_fits_in_jsval). rval jsval * out parameter. on success, *rval receives a javascript number with the value d.
description js_newdoublevalue creates a floating-point jsval. warning: the argument d must not be a value that could fit in an integer jsval. if it is, js_newdoublevalue creates a bad jsval that might behave as desired in some cases but not others. the result is subject to garbage collection until you protect against it using a local root, an object property, or the js_addroot function. this can be avo...
JS_NewExternalString
ing whose characters are stored in external memory. syntax jsstring * js_newexternalstring(jscontext *cx, const char16_t *chars, size_t length, const jsstringfinalizer *fin); jsstring * js_newexternalstringwithclosure(jscontext *cx, jschar *chars, size_t length, int type, void *closure); // obsolete since jsapi 13 name type
description cx jscontext * the context in which to create the new string. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. chars const char16_t * or const jschar * pointer to the first element of an array of char16_ts. this array is used as the character buffer of the jsstring to be created. the array must be populated with the desi...
...all to js_addexternalstringfinalizer. obsolete since jsapi 13 closure void * (js_newexternalstringwithclosure only) arbitrary, application-defined data to include in the string object after it's created. if you use this as a pointer, you should clean it up in the external string finalizer that was previously set up using js_addexternalstringfinalizer. obsolete since jsapi 13
description js_newexternalstring and js_newexternalstringwithclosure create a new jsstring whose characters are stored in external memory, i.e., memory allocated by the application, not the javascript engine. since the program allocated the memory, it will need to free it; this happens in an external string finalizer indicated by the type parameter. js_newexternalstringwithclosure works similarly, except i...
JS_NewFunction
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. call jsnative native c/c++ implementation of this function. nargs unsigned number of arguments the function expects. flags unsigned pass jsfun_constructor to make a native that can...
...:handle<jsobject*> pointer to the parent object for this function. if this is null, a default parent object is used. obsolete since jsapi 39 name const char * name to assign to the new function. if this is null, the new function has no name. id js::handle<jsid> a pointer to jsid of the name to assign to the new function. added in spidermonkey 17
description js_newfunction creates a new javascript function implemented in c/c++. (to create a new function implemented in javascript, use js_compilefunction instead.) call is a c/c++ function pointer that the new function wraps. nargs is the number of arguments the function expects. if flags is jsfun_constructor, a created function can be called as a constructor. parent may be used to specify the new fun...
JS_NewGlobalObject
this article covers features introduced in spidermonkey 17 create a new javascript object for use as a global object. syntax jsobject * js_newglobalobject(jscontext *cx, const jsclass *clasp, jsprincipals *principals, js::onnewglobalhookoption hookoption, const js::compartmentoptions &options = js::compartmentoptions()); name type
description cx jscontext * the context in which to create the new global object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. clasp jsclass * the class to use for the new global object. clasp->flags must have the jsclass_global_flags bits set. the caller must ensure that the jsclass remains alive throughout the life...
...is to make jsclasses global or static. principals jsprincipals * the security information to associate with this compartment. hookoption js::onnewglobalhookoption see debugger api hook added in spidermonkey 31 options const js::compartmentoptions & the option for new compartment (passed to jscompartment constructor). added in spidermonkey 31
description js_newglobalobject creates a new global object based on the specified class. the new object has no parent. it initially has no prototype either, since it is typically the first object created; call js_initstandardclasses to create all the standard objects, including object.prototype, and set the global object's prototype. the constructor clasp->construct is not called. on success, js_newgl...
JS_NewObject
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. clasp const jsclass * pointer to the class to use for the new object. if this is null, an ordinary javascript object is created. the jsclass may be used to override low-level object behavior, including such ...
... a default prototype object. js_newobjectwithgivenproto: if this is null, the new object has no prototype; its __proto__ property is undefined. parent js::handle<jsobject*> pointer to the parent of the new object. the new object's __parent__ property will be a reference to this object. if parent is null, a default parent object is used. obsolete since jsapi 39
description js_newobject creates a new object based on a specified class. cx is a pointer to a context associated with the runtime in which to establish the new object. clasp is a pointer to an existing class to use for internal methods, such as finalize. the javascript engine selects a prototype object for you. on success, js_newobject returns a pointer to the new object. otherwise it returns null. added...
JS_NewObjectForConstructor
on would. syntax jsobject * js_newobjectforconstructor(jscontext *cx, const jsclass *clasp, const js::callargs& args); // added in jsapi 32 jsobject * js_newobjectforconstructor(jscontext *cx, jsclass *clasp, const jsval *vp); // added in jsapi 14, obsolete since jsapi 32 jsobject * js_newobjectforconstructor(jscontext *cx, const jsval *vp); // obsolete since jsapi 14 name type
description cx jscontext * the context in which to create the new object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. clasp const jsclass * the class of the object to create. added in spidermonkey 17 vp jsval * pointer to a constructor. this must be an object that has a prototype property. args js::ca...
...st. in a js_threadsafe build, the caller must be in a request on this jscontext. clasp const jsclass * the class of the object to create. added in spidermonkey 17 vp jsval * pointer to a constructor. this must be an object that has a prototype property. args js::callargs & call argument to get a constructor as callee. added in spidermonkey 38
description js_newobjectforconstructor creates a new object exactly as the given constructor would if invoked with new. this function does not run the code of the constructor function--it just creates the object. if the constructor argument is not an object jsval, this function will assert (in debug builds). if the constructor does not have a prototype property, this function will return null and set an exce...
JS_NewRegExpObject
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject a pointer to a global object. bytes or chars const char * or const char16_t * a pointer to the string that contains a regular expression. length size_t ...
...be in a request on this jscontext. obj js::handleobject a pointer to a global object. bytes or chars const char * or const char16_t * a pointer to the string that contains a regular expression. length size_t the length of bytes or chars, in characters. flags unsigned regular expression flags. see below. flags name
description regexp constructor flag jsreg_fold fold uppercase to lowercase. i jsreg_glob global execution, creates array of matches. g jsreg_multiline treat ^ and $ as begin and end of line. m jsreg_sticky only match starting at lastindex. y
description js_newregexpobject and js_newucregexpobject create a new regexp instance. the flags fr...
JS_NewRuntime
initializes the javascript runtime. ...
...call js_newruntime before making any other api calls except js_init. js_newruntime allocates memory for the jsruntime and initializes certain internal runtime structures. maxbytes specifies the number of allocated bytes after which garbage collection is run. ...
JS_NewUCString
note: js_newstring() was removed in spidermonkey 1.8.5. use js_newstringcopyn and js_newucstringcopyn instead. syntax jsstring * js_newucstring(jscontext *cx, char16_t *chars, size_t length); jsstring * js_newstring(jscontext *cx, char *buf, size_t length); // obsolete since jsapi 1.8.5 name type
description cx jscontext * the context in which to create the new string. requires request. ...
...t in which to create the new string. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. buf char * or char16_t * pointer to a character array, allocated with js_malloc, containing the characters for the js string to create. the javascript engine adopts the buffer. length size_t number of characters in the text string.
description js_newstring creates and returns a new string, using the memory starting at buf and ending at buf + length as the character storage. js_newucstring is the unicode version of the function. the character array, buf, must be allocated on the heap using js_malloc. on success, the javascript engine adopts responsibility for memory management of this region. the application must not read, write, or fre...
JS_NextProperty
obsolete since jsapi 36this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. get the next property id from an iterator object produced by js_newpropertyiterator. syntax bool js_nextproperty(jscontext *cx, js::handleobject iterobj, js::mutablehandleid idp); name type
description cx jscontext * the js context in which to enumerate properties. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. iterobj js::handleobject the opaque iterator object returned by a previous call to js_newpropertyiterator. idp js::mutablehandleid out parameter. on success, *idp receives the name or index of the next pro...
...st. in a js_threadsafe build, the caller must be in a request on this jscontext. iterobj js::handleobject the opaque iterator object returned by a previous call to js_newpropertyiterator. idp js::mutablehandleid out parameter. on success, *idp receives the name or index of the next property name; or jsid_void if there are no more enumerable properties to visit.
description on success, js_nextproperty returns true, with *idp containing the id of the next enumerable own property to visit using iterobj, or jsid_void if there is no such property left to visit. on error, it returns false, and the value left in *idp is undefined. see also bug 1081660 ...
JS_ObjectIsFunction
js_objectisfunction returns true if obj is a function and false otherwise. ...
... js_objectisfunction returns true if obj is a function and false otherwise. ...
JS_PSGS
bing properties, for use with js_defineproperties and js_initclass. syntax #define js_psg(name, getter, flags) ... #define js_psgs(name, getter, setter, flags) ... #define js_self_hosted_get(name, gettername, flags) ... // added in spidermonkey 31 #define js_self_hosted_getset(name, gettername, settername, flags) ... // added in spidermonkey 31 #define js_ps_end ... name type
description name const char * the javascript name for the property. (or index, if jsprop_index is present in flags) getter jsnative pointer to the c/c++ implementation of the getter function. setter jsnative pointer to the c/c++ implementation of the setter function. flags uint16 the bitwise or of any number of property attributes. getterna...
... setter jsnative pointer to the c/c++ implementation of the setter function. flags uint16 the bitwise or of any number of property attributes. gettername const char * the function's name in self-hosted javascript code for getter function. settername const char * the function's name in self-hosted javascript code for setter function.
description these macros encapsulate the definition of jsnative-backed jspropertyspecs, by defining the jsnativewrappers for them. see also mxr id search for js_psg mxr id search for js_psgs mxr id search for js_self_hosted_get mxr id search for js_self_hosted_getset jspropertyspec js_defineproperties js_initclass bug 684526 - added. bug 938728 - added js_self_hosted_get and js_self_hosted_getse...
JS_ParseJSON
this article covers features introduced in spidermonkey 1.8.6 parse a string using the json syntax described in ecmascript 5 and return the corresponding value. syntax jsbool js_parsejson(jscontext *cx, const jschar *chars, uint32 len, jsval *vp); jsbool js_parsejsonwithreviver(jscontext *cx, const jschar *chars, uint32 len, jsval reviver, jsval *vp); name type
description cx jscontext * pointer to a js context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ch jsobject * the object to be searched. chars const jschar * the characters of the string. len uint32 the length of the string. index jsint (in js_parsejsonwithreviver only) a reviver function to apply to the created value after parsing; see json.parse. vp jsval * out ...
... searched. chars const jschar * the characters of the string. len uint32 the length of the string. index jsint (in js_parsejsonwithreviver only) a reviver function to apply to the created value after parsing; see json.parse. vp jsval * out parameter. *vp receives the value after parsing (and optionally, processing by the reviver). if an error occurs, the value left in *vp is undefined.
description use these functions to parse a sequence of characters as json. the parsing rules applied by these methods are exactly those specified by ecmascript 5. various json extensions like trailing commas, unquoted property names, more generous number parsing, and so on are not supported. mxr id search for js_parsejson mxr id search for js_parsejsonwithreviver ...
JS_PopArguments
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. frees the stack entry allocated by js_pusharguments. syntax void js_poparguments(jscontext *cx, void *mark); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. ...
...poparguments(jscontext *cx, void *mark); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. mark void * pointer to a void * which holds the stack frame pointer previously supplied by js_pusharguments.
description js_poparguments frees the stack frame pointer previously allocated by js_pusharguments and unroots the jsvals which have been associated with it (those returned by js_pusharguments as well). see also js_pusharguments js_convertvalue js_addargumentformatter js_convertarguments bug 542091 ...
JS_PreventExtensions
requires request. ...
...e build, the caller must be in a request on this jscontext. obj js::handleobject object to be made non-extensible. result js::objectopresult & (out parameter) receives the result of the operation. added in spidermonkey 45 succeeded bool * outparam indicating, on jsapi success, whether the object is now non-extensible. obsolete since jsapi 39
description all javascript objects recognize the concept of extensibility: whether new properties may be added to the object. in some situations, it may be convenient to prohibit new properties. in javascript this may be accomplished using the object.preventextensions method. the similar jsapi method is js_preventextensions. the failure-mode information below is new as of spidermonkey 36. before then,...
JS_PushArguments
work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. convert any number of arguments to jsvals and store the resulting jsvals in an array. syntax jsval * js_pusharguments(jscontext *cx, void **markp, const char *format, ...); jsval * js_pushargumentsva(jscontext *cx, void **markp, const char *format, va_list ap); name type
description cx jscontext * the context in which to perform any necessary conversions. cx also affects the interpretation of format, if js_addargumentformatter has been called. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. markp void ** out parameter. on success, *markp receives the internally allocated stack mark which sho...
...ents) a variable number of arguments to be converted to jsvals. there must be one argument for each argument described in format. ap va_list (in js_pushargumentsva) the list of arguments to be converted to jsvals. there must be one argument for each argument described in format. the type va_list is a standard feature of the c programming language. it is defined in <stdarg.h>.
description js_pusharguments provides a convenient way to translate a series of native c/c++ values to jsvals with a single function call. cx is the context for the call. markp points to a void * to hold the internally allocated stack frame pointer to pass back to js_poparguments. format is a sequential character array, where each element of the array indicates the js type into which to convert the next c/c+...
JS_PutEscapedString
this article covers features introduced in spidermonkey 1.8.5 write a string into buffer with escaping. syntax size_t js_putescapedstring(jscontext *cx, char *buffer, size_t size, jsstring *str, char quote); size_t js_putescapedflatstring(char *buffer, size_t size, jsflatstring *str, char quote); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. buffer char * a pointer to char buffer to write into. size size_t the size of buffer in bytes. str jsstring * or jsflatstring * a string to write into the file. quote char one of 0, single quote, and double quote. ...
...context * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. buffer char * a pointer to char buffer to write into. size size_t the size of buffer in bytes. str jsstring * or jsflatstring * a string to write into the file. quote char one of 0, single quote, and double quote.
description js_putescapedstring and js_putescapedstring write str into buffer escaping any non-printable or non-ascii character using \escapes for js string literals. guarantees that a nul is at the end of the buffer unless size is 0. returns the length of the written output, not including the nul. thus, a return value of size or more means that the output was truncated. if buffer is null, just returns the ...
JS_Remove*Root
that it is no longer a member of the garbage collector's root set. this enables any pointed-at gc thing to be garbage collected as needed. syntax jsbool js_removevalueroot(jscontext *cx, jsval *vp); jsbool js_removestringroot(jscontext *cx, jsstring **spp); jsbool js_removeobjectroot(jscontext *cx, jsobject **opp); jsbool js_removegcthingroot(jscontext *cx, void **rp); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. vp jsval * address of the jsval variable to remove from the root set. this must have been passed to either js_addvalueroot or js_addnamedvalueroot. spp jsstring * address of the jsstring* variable to remove from the root set. this ...
...either js_addstringroot or js_addnamedstringroot. opp jsobject * address of the jsobject* variable to remove from the root set. this must have been passed to either js_addobjectroot or js_addnamedobjectroot. rp void ** address of the pointer variable to remove from the root set. this must have been passed to either js_addgcthingroot or js_addnamedgcthingroot.
description js_removeroot removes the variable that rp points to from the garbage collector's root set. the entry for rp is removed from the root set for the jsruntime associated with the context cx. js_removeroot always returns js_true. see also mxr id search for js_removevalueroot mxr id search for js_removestringroot mxr id search for js_removeobjectroot mxr id search for js_removegcthingroot bug 91...
JS_ReportError
create a formatted error or warning message to pass to a user-defined error reporting function. this function can also raise a javascript exception which a currently executing script can catch. ...
...first it builds an error message from the given sprintf-style format string and any additional arguments passed after it. the resulting error message is passed to the context's jserrorreporter callback, if any. ...
JS_ReportOutOfMemory
when the javascript engine tries to allocate memory and allocation fails, it reports an error as though by calling this function. ...
...when the javascript engine tries to allocate memory and allocation fails, it reports an error as though by calling this function. ...
JS_ResolveStandardClass
resolve a standard class in an object. syntax bool js_resolvestandardclass(jscontext *cx, js::handleobject obj, js::handleid id, bool *resolved); name type
description cx jscontext * pointer to the executable script context for which to initialize js function and object classes. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject an object to resolve id to a standard class. ...
... a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject an object to resolve id to a standard class. id js::handleid an id of a standard class name, which must contain either a string or an int. resolved bool * out parameter. if the id is resolved, true is stored into *resolved if success. false otherwise.
description js_resolvestandardclass resolves id, which must contain either a string or an int, to a standard class name in obj if possible, defining the class's constructor and/or prototype and storing true in *resolved. if id does not name a standard class or a top-level property induced by initializing a standard class, store false in *resolved and just return true. return false on error, as usual for boo...
JS_SET_TRACING_DETAILS
this article covers features introduced in spidermonkey 1.8 set debugging information about the next thing to be traced by a jstracer. syntax js_set_tracing_details(trc, printer, arg, index) name type
description trc jstracer * the tracer whose debugging hooks are to be set. printer jstracenameprinter a callback function, described below; or null. arg void * see the
description. index size_t see the
description. callback syntax typedef void (*jstracenameprinter)(jstracer *trc, char *buf, size_t bufsize); name type
description trc jstracer * the tracer. ...
...nction, described below; or null. arg void * see the
description. index size_t see the
description. callback syntax typedef void (*jstracenameprinter)(jstracer *trc, char *buf, size_t bufsize); name type
description trc jstracer * the tracer. buf char * out parameter. the callback stores a string describing the reference traced in buf. bufsize size_t the size of buf, in chars.
description set debugging information about a reference to a traceable thing to prepare for the following call to js_calltracer. when printer is null, arg must be const char * or char * c string naming the reference and index must be either (size_t)-1 indicating that the name alone describes the reference or it must be an index into some array vector that stores the reference. when printer is not null, the a...
JS_ScheduleGC
at every allocation nextscheduled is decremented. when it reaches zero, we do either a full or a compartmental gc. ...
... at every allocation nextscheduled is decremented. when it reaches zero, we do either a full or a compartmental gc. ...
JS_SetArrayLength
length indicates the number of elements. ...
...length indicates the number of elements. js_setarraylength(cx, obj, n) is exactly the same as setting the length property of obj to n using js_setproperty. this is true even if obj is not an array object. ...
JS_SetBranchCallback
use is discouraged since it could be removed at any time. try to avoid using it. specifies a callback function that is automatically called when a script branches backward during execution, when a function returns, and at the end of the script. replaced with js_setoperationcallback. syntax jsbranchcallback js_setbranchcallback(jscontext *cx, jsbranchcallback cb); name type
description cx jscontext * the context to hook. cb jsbranchcallback pointer to the callback function. callback syntax jsbool (*jsbranchcallback)(jscontext *cx, jsscript *script); name type
description cx jscontext * pointer to a jscontext which the callback may use to call into jsapi functions. for example, the callback my call js_maybegc(...
...tion() and returns js_false, then the javascript engine propagates the exception to the script that was executing at the time. if the callback returns js_false without raising an exception, then the javascript engine immediately stops running the script with an uncatchable error. the engine does not execute finally blocks in this case; this is the same behavior as any native method or callback.
description js_setbranchcallback specifies a callback function that is automatically called when a script branches backward during execution, when a function returns, and at the end of the script. one typical use for a callback is in a client application to enable a user to abort a script that runs for a long time. another use is to call js_maybegc periodically. the callback is called very frequently, so a...
JS_SetCallReturnValue2
although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. causes a native to return a reference value (as allowed by ecma 262-3 §11.2.3). ...
... the native must store the object part of the reference value in *rval, and the argument v gives the id of the property part of the reference value. ...
JS_SetCompartmentNameCallback
this article covers features introduced in spidermonkey 17 set callback function to name each compartment. syntax void js_setcompartmentnamecallback(jsruntime *rt, jscompartmentnamecallback callback); name type
description cx jsruntime * the runtime to set the callback function. callback jscompartmentnamecallback callback function which will be called to name each compartment (see below). callback function typedef void (* jscompartmentnamecallback)(jsruntime *rt, jscompartment *compartment, char *buf, size_t bufsize); name type
description cx jsruntime * the runtime of the compartments. compartmentcallback jscompartment * the pointer to the compartme...
...if the runtime has no jscompartmentnamecallback, a compartment will be named "<unknown>"</unknown>. ...
JS_SetContextCallback
specifies a callback function that is automatically called whenever a jscontext is created or destroyed. syntax void js_setcontextcallback(jsruntime *rt, jscontextcallback cxcallback, void *data); name type
description rt jsruntime * pointer to a js runtime. cxcallback jscontextcallback pointer to the callback function, described below. data void * any data passed as 3rd argument to the callback function. added in spidermonkey 31 callback syntax typedef bool (* jscontextcallback)(jscontext *cx, unsigned contextop, void *data); name type
description cx jscontext * pointer to a jscontext which the callback may use to call into jsapi functions. this is the context which was just created, or is about to b...
...e, the instance will be destroyed and js_newcontext returns null. in this case the callback is not called again. jscontext_destroy one of js_destroycontext, js_destroycontextnogc, or js_destroycontextmaybegc was called. the callback may perform its own cleanup and must always return true. in a debug build, if the callback returns false, the js engine will halt with an assertion.
description js_setcontextcallback specifies a callback function that is automatically called when jscontexts are created or destroyed. only one callback function may be specified per js runtime. this function returns the previous context callback, if any, else null. see also mxr id search for js_setcontextcallback js_newcontext js_destroycontext js_destroycontextnogc js_destroycontextmaybegc js_getcon...
JS_SetDestroyCompartmentCallback
this article covers features introduced in spidermonkey 17 set the callback function for each compartment being destroyed. syntax void js_setdestroycompartmentcallback(jsruntime *rt, jsdestroycompartmentcallback callback); name type
description cx jsruntime * the runtime to set the callback function. callback jsdestroycompartmentcallback callback function which will be called for each compartment being destroyed (see below). callback function typedef void (* jsdestroycompartmentcallback)(jsfreeop *fop, jscompartment *compartment); name type
description cx jsruntime * the runtime of the compartments. compartmentcallback jscompartment * the pointer to the compartment which is to be...
...h will be called for each compartment being destroyed (see below). callback function typedef void (* jsdestroycompartmentcallback)(jsfreeop *fop, jscompartment *compartment); name type
description cx jsruntime * the runtime of the compartments. compartmentcallback jscompartment * the pointer to the compartment which is to be destroyed.
description js_setdestroycompartmentcallback sets callback function which will be called when sweeping each compartment of the runtime, before deleting the compartment. see also mxr id search for js_setdestroycompartmentcallback mxr id search for jsdestroycompartmentcallback bug 737365 ...
JS_SetElement
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to modify, commonly an array object. index uint32_t index number of the element to set. v js::handlevalue or js::handleobject or js::handlestring or int32_...
...s::handlevalue or js::handleobject or js::handlestring or int32_t or uint32_t or double the value to assign to the element. added in spidermonkey 31 vp js::mutablehandlevalue in/out parameter. *vp is the value to assign to the element. js_setelement ordinarily leaves *vp unchanged, but a jsclass.addproperty hook or non-default setter may modify it. obsolete since jsapi 29
description js_setelement assigns a value to a numeric property of an object. it behaves like the javascript expression obj[index] = v. on success, js_setelement returns true. on error or exception, js_setelement returns false. obsolete since jsapi 29 on success, js_setelement returns true and the value left in *vp is left unchanged unless an addproperty hook or setter modified it. on error or exception,...
JS_SetErrorReporter
nce jsapi 52this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. get or specify the error reporting mechanism for an application. ...
... name type
description cx jsruntime * pointer to a js runtime whose errors should be reported via your function. er jserrorreporter the user-defined error reporting function to use in your application, described below. callback syntax typedef void (* jserrorreporter)(jscontext *cx, const char *message, jserrorreport *report); name type
description cx jscontext * the context in which the error happened. message const char * an error message. report jserrorreport * an error report record containing additional details about the error.
description js_seterrorreporter enables you to define and use your own error reporting mechanism in your applications. the reporter you define is automaticall...
JS_SetGCCallback
specify a new callback function for the garbage collector. syntax void js_setgccallback(jsruntime *rt, jsgccallback cb, void *data); jsgccallback js_setgccallback(jscontext *cx, jsgccallback cb); // obsolete since jsapi 13 jsgccallback js_setgccallbackrt(jsruntime *rt, jsgccallback cb); // obsolete since jsapi 13 name type
description cx jscontext * (for the old js_setgccallback) any jscontext. the gc callback of the associated jsruntime is set. rt jsruntime * the jsruntime for which to set the gc callback. cb jsgccallback pointer to the new callback function to use. callback syntax typedef enum jsgcstatus { jsgc_begin, jsgc_end, jsgc_mark_end, // obsolete since jsapi 13 jsgc_finalize_end // obsolete...
...which to set the gc callback. cb jsgccallback pointer to the new callback function to use. callback syntax typedef enum jsgcstatus { jsgc_begin, jsgc_end, jsgc_mark_end, // obsolete since jsapi 13 jsgc_finalize_end // obsolete since jsapi 13 } jsgcstatus; typedef void (* jsgccallback)(jsruntime *rt, jsgcstatus status, void *data); name type
description cx jscontext * the context in which garbage collection is happening. status jsgcstatus one of the jsgcstatus constants, described below, indicating the stage of gc.
description js_setgccallback sets a callback function which the garbage collector calls at several points during garbage collection. rt is the runtime in which you specify the callback. cb is a poin...
JS_SetInterruptCallback
this article covers features introduced in spidermonkey 31 set a callback function that is automatically called periodically while javascript code runs. syntax jsinterruptcallback js_setinterruptcallback(jsruntime *rt, jsinterruptcallback callback); jsinterruptcallback js_getinterruptcallback(jsruntime *rt); void js_requestinterruptcallback(jsruntime *rt); name type
description rt jsruntime * the runtime. callback jsinterruptcallback the callback function to install. callback syntax bool (* jsinterruptcallback)(jscontext *cx); name type
description cx jscontext * pointer to a jscontext in which this callback was installed. the callback may use this context to call jsapi functions, but it should f...
...ext to call jsapi functions, but it should first use js_setinterruptcallback to set the context's interrupt callback to null. otherwise the engine may call the interrupt callback again, reentering it. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()).
description these functions allow setting an interrupt callback that will be called from the js thread some time after any thread triggered the callback using js_requestinterruptcallback. to schedule the gc and for other activities the engine internally triggers interrupt callbacks. the embedding should thus not rely on callbacks being triggered through the external api only. important note: additional c...
JS_SetNativeStackQuota
this article covers features introduced in spidermonkey 17 enable or disable checks to avoid overflowing the c stack. syntax void js_setnativestackquota(jsruntime *cx, size_t systemcodestacksize, size_t trustedscriptstacksize = 0, size_t untrustedscriptstacksize = 0); name type
description rt jsruntime * the runtime. systemcodestacksize size_t the desired stack quota setting, in bytes. trustedscriptstacksize size_t the desired stack quota setting, in bytes for trusted script. if omitted, it uses the value of systemcodestacksize. added in spidermonkey 31 untrustedscriptstacksize size_t the desired stack quota setting, in bytes for untrusted script. if omitted,...
...ng, in bytes. trustedscriptstacksize size_t the desired stack quota setting, in bytes for trusted script. if omitted, it uses the value of systemcodestacksize. added in spidermonkey 31 untrustedscriptstacksize size_t the desired stack quota setting, in bytes for untrusted script. if omitted, it uses the value of trustedscriptstacksize. added in spidermonkey 31
description js_setnativestackquota sets the size of the native stack that should not be exceeded. to disable stack size checking, pass 0. spidermonkey allows for a distinction between system code (such as gcs, which may incidentally be triggered by script but are not strictly performed on behalf of such script), trusted script (as determined by js_settrustedprincipals), and untrusted script. each kind of c...
JS_SetOptions
obsolete since jsapi 27this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. enables and disables options on a jscontext, replacing all previously set options. syntax uint32 js_setoptions(jscontext *cx, uint32 options); name type
description cx jscontext * a context on which to set options. options uint32 the new set of options. this is the logical or of zero or more flags described below.
description js_setoptions sets the option flags of a given js context cx. this function returns a uint32 value containing the previous values of the flags. to turn individual options on or off, use js_setoptions with js_getoptions: // turn on warni...
... mxr id search for jsoption_extra_warnings jsoption_werror convert warnings to errors. mxr id search for jsoption_werror jsoption_varobjfix make js_evaluatescript() use the last object on its obj param's scope chain (that is, the global object) as the ecma...
JS_SetPendingException
if an exception is already being thrown, it is replaced with the new one given. v is the new value to throw as an exception. ...
...if an exception is already being thrown, it is replaced with the new one given. v is the new value to throw as an exception. ...
JS_SetPrivate
it is especially useful for storing c/c++ data that should not be directly visible to scripts. for example, a socket class might use the private data field to store the socket handle. ...
...it is especially useful for storing c/c++ data that should not be directly visible to scripts. for example, a socket class might use the private data field to store the socket handle. ...
JS_SetProperty
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handlevalue object to which the property to set belongs. name or id const char * or const char16_t *or js::handleid name of the property to set. namelen size_...
...of the property to set. namelen size_t (only in js_setucproperty) the length of name in characters; or -1 to indicate that name is null-terminated. v js::handlevalue in/out parameter. *vp is the value to assign to the property. ordinarily this function leaves v unchanged, but it is possible for a jsclass.addproperty hook or a non-default setter to assign to v.
description js_setproperty assigns the value v to the property name of the object obj. it behaves like the javascript expression obj[name] = v. js_setucproperty is the unicode version of the function. js_setpropertybyid is the same but takes a js::handleid for the property name. if obj is a proxy, the js_setproperty [[set]] internal method defined in es2015 (rev 29 9.5.9) is performed. if obj is a native ...
JS_SetPropertyAttributes
d be removed at any time. try to avoid using it. set the attributes for a specified property. syntax jsbool js_setpropertyattributes(jscontext *cx, jsobject *obj, const char *name, unsigned int attrs, jsbool *foundp); jsbool js_setucpropertyattributes(jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, unsigned int attrs, jsbool *foundp); name type
description cx jscontext * the context in which to set the property attributes. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object for which to set property attributes. name const char * or const jschar * name of the property for which to set attributes. namelen size_t (in js_setucpro...
...perty attributes. name const char * or const jschar * name of the property for which to set attributes. namelen size_t (in js_setucpropertyattributes only) the length of name, in characters. attrs unsigned int attribute values to set. foundp jsbool * out parameter. flag indicating whether or not the specified property was located.
description js_setpropertyattributes sets the attributes for a specified property, name of an object obj. js_setucpropertyattributes is the unicode version of the function. attrs is an unsigned integer containing the attribute value to set. it is the bitwise or of zero or more of the following values: flag purpose jsprop_enumerate property is visible in for and in loops. j...
JS_SetScriptStackQuota
these structures also consume heap space, so js_setthreadstacklimit does not bound their size. the default quota is 32mb which is quite generous. ...
...these structures also consume heap space, so js_setthreadstacklimit does not bound their size. the default quota is 32mb which is quite generous. ...
JS_SetThreadStackLimit
obsolete since jsapi 13this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. enable or disable checks to avoid overflowing the c stack. this is deprecated, use js_setnativestackquota instead. ...
...to disable stack size checking, pass 0 for limitaddr. ...
JS_StrictlyEqual
ced in spidermonkey 1.8.1 determine whether two javascript values are equal in the sense of the === operator. ...
...if the comparison attempt was successful, the method returns true and stores the result in *equal; otherwise it returns false. ...
JS_StringHasLatin1Chars
string characters are stored as either latin1char (8-bit) or char16_t (16-bit). ...
... string characters are stored as either latin1char (8-bit) or char16_t (16-bit). ...
JS_SuspendRequest
or prior to version 45. since then, a jsruntime is tied to the thread that created it; it may not be accessed by any other thread. suspends the calling thread's current request, if any, to allow the thread to block or perform time-consuming calculations. ...
...suming calculations. syntax jsrefcount js_suspendrequest(jscontext *cx); void js_resumerequest(jscontext *cx, jsrefcount savedepth); name type
description cx jscontext * the context whose current request is to be suspended or resumed. savedepth jsrefcount (only in js_resumerequest) the valued returned by the matching js_suspendrequest call.
description in js_threadsafe builds, when a multi-threaded application is in a request but needs to block or perform lengthy computation that can race safely with the garbage collector, it should call js_suspendrequest before the time-consuming operation and js_resumerequest after. for more information about thread safety and requests, see js_threadsafe. js_suspendrequest suspends any currently active requ...
JS_THREADSAFE
beginrequest() and js_endrequest(). js_beginrequest(cx); /* ... do jsapi stuff ... */ js_endrequest(cx); a request is always associated with a specific jscontext and runs from start to finish on a single thread. most jsapi functions require the caller to be in a request. ...
...provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). in particular, jsnative callbacks provide a request. ...
JS_ThrowStopIteration
in for…in and for each…in loops, the javascript engine can create an iterator object and call its .next method repeatedly, as described in new in javascript 1.7: iterators. ...
... in for…in and for each…in loops, the javascript engine can create an iterator object and call its .next method repeatedly, as described in new in javascript 1.7: iterators. ...
JS_TypeOfValue
the return value is always one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean. ...
...the return value is always one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean. ...
JS_ValueToECMAInt32
s use is discouraged since it could be removed at any time. try to avoid using it. convert a javascript value to an integer type as specified by the ecmascript standard. ...
... js_valuetoecmaint32 implements the toint32 operator specified in ecma 262-3 9.5. js_valuetoecmauint32 implements the touint32 operator specified in ecma 262-3 9.6. ...
JS_ValueToId
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the js value to convert. s js::handlestring the js string to convert. index uint32_t an unsigned integer index of array to convert. chars js::twobytechars the string to convert. ...
...evalue the js value to convert. s js::handlestring the js string to convert. index uint32_t an unsigned integer index of array to convert. chars js::twobytechars the string to convert. key jsprotokey the prototype key to convert. idp js::mutablehandleid out parameter. on success, *idp receives the converted jsid.
description js_valuetoid converts a specified js::value, v, to a jsid. if v is an integer, *idp receives an integer jsid. otherwise, if e4x support is enabled and v is an object, *idp receives an object jsid. otherwise, *idp receives an interned string jsid based on the value of v. if v is not a string, it is converted to a string as if by calling js_valuetostring. js_stringtoid and js_charstoid convert a ...
JS_ValueToSource
on success, js_valuetosource returns a pointer to a string. ...
... on success, js_valuetosource returns a pointer to a string. ...
JS_malloc
allocate and free memory that is not managed by the garbage collector. syntax void * js_malloc(jscontext *cx, size_t nbytes); void * js_realloc(jscontext *cx, void *p, size_t oldbytes, size_t newbytes); char * js_strdup(jscontext *cx, const char *s); void js_free(jscontext *cx, void *p); name type
description cx jscontext * pointer to a js context. if allocation fails, an error is reported in this context. ...
...if allocation fails, an error is reported in this context. p void * (js_realloc and js_free only) pointer to a previously allocated region of memory to resize or deallocate. nbytes size_t (js_malloc and js_realloc only) amount of space, in bytes, to allocate. s const char * (js_strdup only) pointer to a null-terminated string. s must not be null.
description js_malloc allocates a region of memory nbytes in size. on success, js_malloc returns a pointer to the beginning of the region. as with the standard c function malloc, memory allocated by js_malloc is uninitialized. js_realloc tries to change the allocation size of the region of memory at p to nbytes. failing that, js_realloc allocates a new region of size nbytes and copies as much of the existing...
JS_updateMallocCounter
malloc counter measures memory pressure for gc scheduling. it runs from maxmallocbytes down to zero. ...
... malloc counter measures memory pressure for gc scheduling. it runs from maxmallocbytes down to zero. ...
Gecko events
_state_change an object's state has changed. is supported: yes states: state_focused, state_busy, xxx: event_location_change an object has changed location, shape, or size. is supported: no event_name_change an object's name property has changed. is supported: yes targets: table_cell - the cell of <xul:tree/>, any accessible for html element when @title or @alt attribute is changed. event_
description_change an object's
description property has changed. is supported: no event_value_change an object's value property has changed. is supported: yes event_help_change an object's help has changed. is supported: no event_defaction_change an object's default action has changed. is supported: no event_action_change an object's action has changed. is supported: no event_accelerator_change an...
... example most of the attributes available via the iaccessiblecomponent interface. event_text_column_changed the caret moved from one column to the next. event_section_changed the caret moved from one section to the next. event_table_caption_changed a table caption changed. event_table_model_changed a table's data changed. event_table_summary_changed a table's summary changed. event_table_row_
description_changed a table's row
description changed. event_table_row_header_changed a table's row header changed. event_table_row_insert event_table_row_delete event_table_row_reorder event_table_column_
description_changed a table's column
description changed. event_table_column_header_changed a table's column header changed. event_table_column_insert event_table_column_delete event_tabl...
XForms Accessibility
ozilla xforms works in xhtml (1.x) or xul documents only then we use tabindex instead. note, we support -moz-user-focus style neither for xhtml or xul. at api accessible properties this section describes common rules how accessibility properties are formed for forms control elements. name it is formed from value of child xforms label element if the element doesn't have labelledby attribute.
description it is formed from value of child xforms hint element if the element doesn't have describedby attribute. state it is formed as well from model item properties (mips) of instance node that xforms element is bound to as from valid/invalid or in-range/out-of-range states of instance node. instance node states are mapped to accessibility state constants declared in nsiaccessiblestates interface lik...
...s control (see the spec, the docs). every form control other than the output element must contain a label element. the value of label element is used as name of accessible object. help specifies contextual help for the containing form control (see the spec, the docs). the help element has role_alert role. hint similar to a tooltip (see the spec, the docs). the value of hint element is used as
description of accessible object. alert this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the specified range of selectable values (see the spec, the docs). the alert element has role_alert role for both usual and inline alert elements. message used in combination with event listeners to display a message to the use...
extIApplication
ation.idl. implemented via xpcom service for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages. method overview boolean quit() boolean restart() void getextensions(extiextensionscallback acallback) attributes the following interfaces are available to all applications: attribute type
description id readonly attribute astring the id of the application. name readonly attribute astring the name of the application. version readonly attribute astring the version number of the application. console readonly attribute exticonsole the console object for the application. extensions readonly attribute extiextensions the exte...
...bject for the application. defaults to an empty root branch. storage readonly attribute extisessionstorage the storage object for the application. events readonly attribute extievents the events object for the application. supports: "load", "ready", "quit", "unload" the following interfaces are only available to firefox: attribute type
description bookmarks readonly attribute fuelibookmarkroots the root bookmarks object for the application. windows readonly attribute nsivariant an array of browser windows within the application. activewindow readonly attribute fueliwindow the currently active browser window. methods quit() attempts to shutdown the application. it is possible for the sh...
Preface
of the basic com ideas will be introduced. this book provides a tutorial about building an xpcom component that controls browsing behavior. although, xpcom can be used in many environments which are unrelated to web browsing, xpcom's main client is gecko, an open source, standards compliant, embeddable web browser, where it's easiest and most practical to illustrate xpcom's functionality. a full
description of the component in this tutorial can be found in the what we'll be working on section of the tutorial. despite what old documentation says, xpcom should not be used to make npapi plugins scriptable. starting with gecko 1.7.5 (firefox 1.0) a special npapi extension for scriptability is supported, see scripting plugins. organization of the tutorial the following list provides an overview of t...
...ng programmatic access to gecko components are provided in the appendix to this book, setting up the gecko sdk. conventions the formatting conventions listed below are used to designate specific types of information in the book and make things easier to scan. the goal is to use as few formats as possible, but to distinguish the various different types of information clearly. format
description bold component names appear in bold in the text monospace code listings, interface names and members of interfaces (e.g., createinstance()) appear in monospaced font. lines of code are placed in separate boxes. additionally, filenames and directories appear in monospaced font. italic variables appear in italic. important terms and new concepts are also italiciz...
Setting up the Gecko SDK
dynamic libraries, and in some cases tools that may be useful in development. the idl directory contains the public idl files exported by the module. the includes directory contains c++ header files used by your component. xpcom exports a number of binaries that should be mentioned at this point. the table below refers to the windows file names for the executables. ...
... building a microsoft visual cpp project once you set up the gecko sdk, you can create a microsoft visual c++ project to handle component development with the sdk. ...
Components.interfaces
components.interfaces is a read-only object whose properties are interfaces indexed by their names. introduction components.interfaces is a read-only object whose properties implement the nsijsiid interface. each object represents one of the xpcom interfaces -- that some component or another might or might not implement. it reflects only those interfaces which have been designated in their .idl
description as scriptable, that is the interfaces which xpconnect is capable of reflecting into javascript. properties of the components.interfaces object are used where xpcom methods expect a parameter of type nsid. this includes nsisupports.queryinterface(), the optional parameter accepted by nsijscid.getservice(), nsijscid.createinstance() when called from javascript, and nsiclassinfo.getinterfaces(). t...
...s object can be enumerated using a for...in loop. usage accessing an interface object properties of the components.interfaces object are indexed by interface name. you can retrieve an interface object using: var iface = components.interfaces.nsisupportsarray; this will return you the interface object for the nsisupportsarray interface. accessing constants defined in an interface interface
descriptions (cf. xpidl) may not only contain method declarations, but also constants. for example, assume we have the following interface declaration: interface nsifoo : nsisupports { const pruint32 myflag = 5; }; the constant myflag can then be accessed using var myflag = components.interfaces.nsifoo.myflag; ...
Components.utils
components.utils is a collection of various useful xpconnect features. its interface is defined at js/xpconnect/idl/xpccomponents.idl. the object currently has the following members: editors! please keep this list in sync with the components object page methods method
description cloneinto() create a structured clone of an object in a different javascript context. createarrayin() removed in gecko 31 returns an array created in specified compartment. createobjectin() creates a new object, created in the scope of the specified object's compartment. dispatch() dispatches a runnable to the current/main thread. if the parameter is passed, the runnable will be dispatch in the compartment of the parameter, wh...
...etgczeal() sets the level of garbage collection level for full garbage collection. see js_setgczeal for details; this method calls through to that with the specified value as the zeal value. unwaivexrays() undoes waivexrays(): reapplies the xray filtering protection. waivexrays() removes the filtering provided by an xray. properties property type
description sandbox nsixpccomponents_utils_sandbox creates sandbox objects for use with evalinsandbox(). ion boolean read only. strict boolean strict mode is enabled. this reflects the value of the javascript environment's option by the same name. read only. strict_mode boolean read only. werror boolean warnings should be treated ...
IAccessibleText
eft corner of the bounding box of the referenced character. width width of the bounding box of the referenced character. height height of the bounding box of the referenced character. return value e_invalidarg if bad [in] passed, [out] values are 0s. s_ok. ncharacters() returns total number of characters. [propget] hresult ncharacters( [out] long ncharacters ); parameters ncharacters missing
description return value s_ok. newtext() returns any inserted text(). provided for use by the ::ia2_event_text_inserted and ::ia2_event_text_updated event handlers. this data is only guaranteed to be valid while the thread notifying the event continues. once the handler has returned, the validity of the data depends on how the server manages the life cycle of its objects. also, note that the server may have...
...e of the entire application is adequate. [propget] hresult newtext( [out] ia2textsegment newtext ); parameters newtext the text() that was just inserted. return value s_false if there is nothing to return, [out] value is null. s_ok. nselections() returns the number of active non-contiguous selections. [propget] hresult nselections( [out] long nselections ); parameters nselections missing
description return value s_ok. offsetatpoint() returns the text() position for the specified screen position. given a point return the zero-based index of the character under that point. the same functionality could be achieved by using the bounding boxes for each character as returned by characterextents(). the method offsetatpoint, however, can be implemented more efficiently. [propget] hresult offsetatpo...
imgIRequest
read only. decoderobserver imgidecoderobserver read only. image imgicontainer the image container. read only. imageprincipal nsiprincipal the principal gotten from the channel the image was loaded from. read only. imagestatus unsigned long status flags of the status_* variety. read only. mimetype string read only. uri ns...
...cipal the principal gotten from the channel the image was loaded from. read only. imagestatus unsigned long status flags of the status_* variety. read only. mimetype string read only. uri nsiuri the uri the image load was started with. note that this might not be the actual uri for the image (for example if http redirects happened during the load). read only. constants constant value
description status_none 0x0 nothing to report. status_size_available 0x1 we received enough image data from the network or filesystem that we know the width and height of the image, and have thus called setsize() on the container. status_load_partial 0x2 used internally by imgrequest to flag that a request is being cancelled as a result of a failure of a proxy holder and not an internal failure. at l...
mozIStorageError
the storage api, offering attributes to obtain the error code as well as a human-readable error message corresponding to the error that occurred. storage/public/mozistorageerror.idlscriptable please add a summary to this article. ...
... corrupt 11 the database on disk is malformed. full 13 an insertion failed because the database is full. ...
mozIStorageStatement
read only. parametercount unsigned long number of parameters. read only. params mozistoragestatementparams the current list of named parameters, which may be set. only available to javascript code. read only. row mozistoragestatementrow the current row, with access to all data member...
...w the current row, with access to all data members by name. available only to javascript code. read only. state long the current state defined by mozistoragestatement.moz_storage_statement_invalid, mozistoragestatement.moz_storage_statement_ready, or mozistoragestatement.moz_storage_statement_executing. read only. statement status constants constant value
description moz_storage_statement_invalid 0 the sql statement is invalid. moz_storage_statement_ready 1 the sql statement is ready to be executed. moz_storage_statement_executing 2 the sql statement is executing at the moment. methods initialize() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: th...
mozIStorageValueArray
value_type_integer 1 integer data type. value_type_float 2 float data type. value_type_text 3 text data type. value_type_blob 4 blob data type. met...
... value_type_integer 1 integer data type. ...
nsIAccessibleHyperText
entation is to implement this interface on the small text object such as a paragraph of text. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessiblehyperlink getlink(in long linkindex); long getlinkindex(in long charindex); long getselectedlinkindex(); obsolete since gecko 1.9 attributes attribute type
description linkcount long the number of links contained within this hypertext object. read only. note: renamed from links in gecko 1.9 methods getlink() retrieves the nsiaccessiblehyperlink object at the given link index. nsiaccessiblehyperlink getlink( in long linkindex ); parameters linkindex 0-based index of the link that is to be retrieved. this can be retrieved via ge...
...the 0-based character index. return value the index of the link if it's presented on the given character index, otherwise -1. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. getselectedlinkindex() obsolete since gecko 1.9 (firefox 3) long getselectedlinkindex(); parameters none. return value missing
description exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. see also nsiaccessiblehyperlink ...
nsIAccessibleRole
role_titlebar 1 represents a title or caption bar for a window. it is used by msaa only, supported automatically by ms windows. ...
...ul:tabpanel, role="tabpanel". role_indicator 39 represents an indicator, such as a pointer graphic, that points to the current item. role_graphic 40 represents a picture. is is used for xul:image, html:img. role_statictext 41 represents read-only text, such as labels for other controls or instructions in a dialog box. static text cannot be modified or selected. is is used for xul:label, xul:
description, html:label, role="label", or xforms:output. role_text_leaf 42 represents selectable text that allows edits or is designated read-only. role_pushbutton 43 represents a push button control. it is used for xul:button, html:button, role="button", xforms:trigger, xforms:submit. role_checkbutton 44 represents a check box control. it is used for xul:checkbox, html:input@type="checkbox", role="che...
nsIAppShellService
sixulwindow awindow); void run(); obsolete since gecko 1.8 void toplevelwindowismodal(in nsixulwindow awindow, in boolean amodal); obsolete since gecko 1.9.1 void unregistertoplevelwindow(in nsixulwindow awindow); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal. attributes attribute type
description applicationprovidedhiddenwindow boolean return true if the application hidden window was provided by the application. if it was not, the default hidden window was used. this will usually be false on all non-mac platforms. read only. hiddendomwindow nsidomwindow return the (singleton) application hidden window, automatically created and maintained by this appshellser...
...created and maintained by this appshellservice. read only. hiddenwindow nsixulwindow return the (singleton) application hidden window, automatically created and maintained by this appshellservice. read only. nativeappsupport nsinativeappsupport getter for "native application support." read only. obsolete since gecko 1.8 constants constant value
description size_to_content -1 create a window, which will be initially invisible. econsiderquit 1 attempt to quit if all windows are closed. obsolete since gecko 1.8 eattemptquit 2 try to close all windows, then quit if successful. obsolete since gecko 1.8 eforcequit 3 force all windows to close, then quit. obsolete since gecko 1.8 methods ...
nsIApplicationCacheNamespace
eamonkey 2.0) application caches can store a set of namespace entries that affect loads from the application cache. if a load from the cache fails to match on an exact cache entry, the namespace entries are searched for a substring match. method overview void init(in unsigned long itemtype, in acstring namespacespec, in acstring data); attributes attribute type
description data acstring data associated with the namespace, such as a fallback. how this attribute is used varies depending on the namespace type. if the data is a uri, this attribute should be the uri's asciispec. read only. itemtype unsigned long a bit field indicating one or more namespace types. must be one or more of the constants defined under constants on this page. rea...
...ribute should be the uri's asciispec. read only. itemtype unsigned long a bit field indicating one or more namespace types. must be one or more of the constants defined under constants on this page. read only. namespacespec acstring the prefix of this namespace. this should be the asciispec of the uri prefix. read only. constants constant value
description namespace_bypass 1 items matching this namespace can be fetched from the network when loading from this cache. the data attribute is not used. namespace_fallback 2 items matching this namespace can be fetched from the network when loading from this cache; however, if the load fails, the cache entry specified by the data attribute should be loaded intstead. n...
nsIAuthInformation
er of nsiauthprompt2.promptusernameandpassword() or nsiauthprompt2.promptpasswordasync() provides an object implementing this interface; the prompt implementation can then read the values here to prefill the dialog. after the user entered the authentication information, it should set the attributes of this object to indicate to the caller what was entered by the user. attributes attribute type
description authenticationscheme autf8string the authentication scheme used for this request, if applicable. if the protocol for this authentication does not support schemes, this will be the empty string. otherwise, this will be a string such as "basic" or "digest". this string will always be in lowercase. read only. domain astring the initial value should be used to prefill the dialog or be shown in so...
...otocol does not support realms. otherwise, this is a human-readable string like "secret files". read only. username astring the initial value should be used to prefill the dialog or be shown in some other way to the user. on return, this parameter should contain the username entered by the user. this field can only be changed if the #only_password flag is not set. constants constant value
description auth_host 1 this dialog belongs to a network host. auth_proxy 2 this dialog belongs to a proxy. need_domain 4 this dialog needs domain information. the user interface should show a domain field, prefilled with the domain attributes value. only_password 8 this dialog only asks for password information. authentication prompts should not show a username field. attempts to change the usernam...
nsICacheEntryDescriptor
read only. cacheelement nsisupports get or set the cache data element. this will fail if the cache entry is stream based. the cache entry holds a strong reference to this object. the object will be released ...
...read only. cacheelement nsisupports get or set the cache data element. this will fail if the cache entry is stream based. ...
nsICacheService
read only. methods createsession() this method creates a cache session. a cache session represents a client's access into the cache. the cache session is not "owned" by the cache service. hence, it is possible to create duplicate cache sessions. entries created by a cache session are invi...
...ome items but will throw if it fails to evict everything. void evictentries( in nscachestoragepolicy storagepolicy ); parameters storagepolicy the cache storage policy. init() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) initialize the cache service. void init(); parameters none. exceptions thrown missing exception missing
description shutdown() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) shutdown() the cache service. void shutdown(); parameters none. visitentries() this method visits entries stored in the cache. used to implement the about:cache uri. void visitentries( in nsicachevisitor visitor ); parameters visitor the entry to be visited. see also ...
nsICachingChannel
a in the cache (for printing and save-as). support for uniquely identifying cached data in cases when the url is insufficient. for example a http form submission. a channel may optionally implement this interface to allow clients to affect its behavior with respect to how it uses the cache service. method overview boolean isfromcache(); obsolete since gecko 2.0 attributes attribute type
description cacheasfile boolean specifies whether or not the data should be cached to a file. this may fail if the disk cache is not present. the value of this attribute is usually only settable during the processing of a channel's onstartrequest. the default value of this attribute depends on the particular implementation of nsicachingchannel. cachefile nsifile get the "file" where the cached data can b...
...ded. for example, expiration time. offlinecacheclientid acstring the session into which to cache offline data. if not specified, data will be placed in "http-offline". offlinecachetoken nsisupports the same as cachetoken but accessing the offline app cache token if there is any. exceptions thrown ns_error_not_available when there is not offline cache token. constants constant value
description load_no_network_io 1 << 26 this load flag inhibits fetching from the net. an error of ns_error_document_not_cached will be sent to the listener's onstoprequest if network io is necessary to complete the request. this flag can be used to find out whether fetching this url would cause validation of the cache entry via the network. combining this flag with load_bypass_local_cache will cause all l...
nsIChannel
to be retrieved for the corresponding http transaction. this interface must be used only from the xpcom main thread. implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshttpchannel.cpp. method overview void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsiinputstream open(); attributes attribute type
description contentcharset acstring the character set of the channel's content if available and if applicable. this attribute only applies to textual data. setting contentcharset before the channel has been opened provides a hint to the channel on what the charset should be. the behavior is similar to contenttype. the value of the contentcharset attribute is a mixed case string. ...
...ally presented through the interfaces nsitransportsecurityinfo and nsisslstatusprovider read only. uri nsiuri the uri corresponding to the channel. its value is immutable. read only. constants channel specific load flags: bits 23-31 are reserved for future use by this interface or one of its derivatives (for an example see nsicachingchannel). constant value
description load_document_uri 16 set (for example by the docshell) to indicate whether or not the channel corresponds to a document uri. load_retargeted_document_uri 17 if the end consumer for this load has been retargeted after discovering its content, this flag will be set: load_replace 18 this flag is set to indicate that this channel is replacing another ...
nsIClassInfo
e provides information about a specific implementation class. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsisupports gethelperforlanguage(in pruint32 language); void getinterfaces(out pruint32 count, [array, size_is(count), retval] out nsiidptr array); attributes attribute type
description class
description string a human readable string naming the class, or null. read only. classid nscidptr a classid through which an instance of this class can be created, or null. if the flags attribute has the singleton bit set, then the value of this attribute specifies a classid through which this class can be accessed as a service using nsiservicemanager.getservice...
...rties of this class. possible values for this attribute include a bit-wise combination of the constants read only. implementationlanguage obsolete since gecko 40 pruint32 the language type in which this class is implemented. see nsiprogramminglanguage.constants for a list of possible values. read only. constants bitflags for 'flags' attribute. constant value
description singleton 1 << 0 the class is a singleton that must be accessed via nsiservicemanager. threadsafe 1 << 1 the class may be accessed by any thread. main_thread_only 1 << 2 the class may only be accessed by the main application thread. dom_object 1 << 3 the class is a dom object. plugin_object 1 << 4 the class is a plugin obj...
nsICommandLine
the application name is not part of the command line. read only. preventdefault boolean there may be a command-line handler which performs a default action if there was no explicit action on the command line (open a default browser window, for example). this flag allows the default action to be prevented. state unsigned long the type of ...
...rgeted by this command line. in most cases, this will be null (xremote will sometimes set this attribute). read only. workingdirectory nsifile the working directory for this command line. use this property instead of the working directory for the current process, since a redirected command line may have had a different working directory. read only. constants state constants constant value
description state_initial_launch 0 the first launch of the application instance. state_remote_auto 1 a remote command line automatically redirected to this instance. state_remote_explicit 2 a remote command line explicitly redirected to this instance using xremote/windde/appleevents. methods findflag() finds a command-line flag, returning its position on the command line. long findflag( in astring...
nsICommandLineHandler
read only. meth...
...read only. methods handle() processes a command line. if this handler finds arguments that it understands, it should perform the appropriate actions (such as opening a window), and remove the arguments from the command-line array. ...
nsIContentFrameMessageManager
ls on these messaging apis see the documentation for the nsicontentframemessagemanager's parent classes nsisyncmessagesender and nsimessagesender. methods void dump(in domstring astr); domstring atob(in domstring aasciistring); domstring btoa(in domstring abase64data); dump() prints the specified string to standard output. ...
... void dump(in domstring astr); domstring atob(in domstring aasciistring); domstring btoa(in domstring abase64data); dump() prints the specified string to standard output. parameters name type
description astr string the message to log. atob() convert ascii base64 data to binary data. parameters name type
description aasciistring string ascii string to decode. returns string: the decoded binary data. btoa() convert binary data to ascii base64 data . parameters name type
description abase64data string binary data to encode as base64. returns string: the base64-encoded ascii string. attributes content nsidomwindow: the current top level...
nsICookie
expires = 0 represents a session cookie. expires = 1 represents an expiration time earlier than jan 1, 1970. read only. host autf8string the host (possibly fully qualified) of the cookie. read only. ...
...f the cookie was transmitted over ssl, false otherwise. read only. name acstring the name of the cookie. read only. path autf8string the path pertaining to the cookie. read only. policy nscookiepolicy holds the sites compact policy value. read only. status nscookiestatus holds the p3p status of cookie. read only. value acstring the cookie value. read only. constants constant value
description status_unknown 0 the cookie collected in a previous session, and its information no longer exists. available status_accepted 1 the cookie was accepted. status_downgraded 2 the cookie was accepted but downgraded to a session cookie. status_flagged 3 the cookie was not accepted. status_rejected 4 the cookie was rejected. policy_unknown 0 the cookie collected in a previous session, and i...
nsICookieManager
his interface is intended to be used as a service. it is implemented by the @mozilla.org/cookiemanager;1 component, but should generally be accessed via services.cookies method overview void remove(in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes); void removeall(); attributes attribute type
description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie list. the objects enumerated over are of type nsicookie. read only. methods remove() this method is called to remove an individual cookie from the cookie list, specified by host, name, and path. if the cookie cannot be found, no exception is thrown. typically, the arguments to this method ...
...if the cookie cannot be found, no exception is thrown. typically, the arguments to this method will be obtained directly from the desired nsicookie object. void remove( in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes ); parameters ahost the host or domain for which the cookie was set. see nsicookiemanager2.add() for a
description of acceptable host strings. if the target cookie is a domain cookie, a leading dot must be present. aname the name specified in the cookie. apath the path for which the cookie was set. ablocked indicates if cookies from this host should be permanently blocked. aoriginattributes the originattributes of this cookie. removeall() this method is called to remove all cookies from the cookie ...
nsIDOMChromeWindow
it will be null for domwindows not corresponding to browsers. messagemanager nsichromeframemessagemanager read only. title domstring obsolete since gecko 1.9.1 windowstate unsigned short returns current window state, the value is...
...ow instance which provides access to yet another layer of utility functions by chrome script. it will be null for domwindows not corresponding to browsers. messagemanager nsichromeframemessagemanager read only. title domstring obsolete since gecko 1.9.1 windowstate unsigned short returns current window state, the value is one of state_* constants. read only. constants constant value
description state_maximized 1 the window is maximized. state_minimized 2 the window is minimized. state_normal 3 the window is normal. state_fullscreen 4 the window is in full screen mode. methods beginwindowmove() on some operating systems, we must allow the window manager to handle window dragging. this method tells the window manager to start dragging the window. this method will fail unless c...
nsIDOMEvent
if the event can bubble the value is true, else the value is false. read only. cancelable boolean used to indicate whether or not an event can have its default action prevented. if the default action can be prevented the value is true, else the value is false. read only. currenttar...
... not provide this information the value of timestamp may be not available for all events. when not available, a value of 0 will be returned. examples of epoch time are the time of the system start or 0:0:0 utc 1st january 1970. read only. type domstring the name of the event (case-insensitive). the name must be an xml name. read only. constants constant value
description none 0 the event is not being dispatched. capturing_phase 1 the current event phase is the capturing phase. at_target 2 the event is currently being evaluated at the target eventtarget. bubbling_phase 3 the current event phase is the bubbling phase. mousedown 0x00000001 mouseup 0x00000002 mouseov...
nsIDOMMouseScrollEvent
vertical_axis 2 the vertical (y) axis. methods initmousescrollevent() ini...
... vertical_axis 2 the vertical (y) axis. methods initmousescrollevent() initializes the progress event object. ...
nsIDOMNode
childnodes nsidomnodelist read only. firstchild nsidomnode read only. lastchild nsidomnode read only. localname domstring read only. namespaceuri domstring read only. nextsibling nsidomnode read only. nodename domstring read only. nodetype unsigned short read only. nodevalue domstring ownerdocument nsidomdocument read only. parent...
... lastchild nsidomnode read only. localname domstring read only. namespaceuri domstring read only. nextsibling nsidomnode read only. nodename domstring read only. nodetype unsigned short read only. nodevalue domstring ownerdocument nsidomdocument read only. parentnode nsidomnode read only. prefix domstring previoussibling nsidomnode read only. ...
nsIDOMOfflineResourceList
read only. mozlength unsigned long the number of entries in the dynamically managed offline resource list. read only. onchecking nsidomeventlistener an event listener to be called when fetching the application cache manifest and checking for updat...
... event is not currently used since versioned application caches aren't supported yet. oncached nsidomeventlistener an event listener to be called when caching is complete. status unsigned short one of the application cache state constants indicating the status of the application cache. constants application cache state constants constant value
description uncached 0 the object isn't associated with an application cache. idle 1 the application cache is not in the process of being updated. checking 2 the application cache manifest is being fetched and checked for updates. downloading 3 resources are being downloaded to be added to the cache. updateready 4 there is a new versi...
nsIDOMSimpleGestureEvent
for update events, this indicates the movement since the previous update; for the mozrotategesture and mozmagnifygesture events, this indicates the total movement that occurred while the event was being processed. the value is specified in degrees for rotation events (where positive values indicate clockwi...
...on the value being either positive or negative. on windows, the units indicate the difference between the previous and current width between the two touch points, in pixels. direction unsigned long the direction in which the gesture moved. see direction constants and rotation constants on this page. read only. constants direction constants constant value
description direction_up 1 upward swipe. direction_down 2 downward swipe. direction_left 4 leftward swipe. direction_right 8 rightward swipe. rotation constants constant value
description rotation_counterclockwise 1 counter-clockwise rotation. rotation_clockwise 2 clockwise rotation. method...
nsIDOMWindowUtils
read only. exceptions thrown ns_error_not_available there is no current inner window displaydpi float the dpi of the display. read only. doccharsetisforced boolean whether the charset of the window's current document has been forced...
... pixels per css pixel. read only. audiomuted boolean with this it's possible to mute all the mediaelements in this window. we have audiomuted and audiovolume to preserve the volume across mute/umute. audiovolume float range: greater or equal to 0. the real volume level is affected by the volume of all ancestor windows. constants constant value
description modifier_alt 0x0001 getmodifierstate("alt") of the send event will return true if this is specified for amodifiers of send*event() except sendnative*event(). modifier_control 0x0002 getmodifierstate("control") of the send event will return true if this is specified for amodifiers of send*event() except sendnative*event(). modifier_shift 0x0004 getmod...
nsIDOMXPathResult
read only. invaliditeratorstate boolean true if the iterator state has become invalid. for example, modifying a node invalidates the iterator. read only. numbervalue double if resulttype is number_type, the numeric value of the xpath value. read only. resulttype unsigned short the type of resu...
...rdered_node_type or first_ordered_node_type, a single dom node. read only. snapshotlength unsigned long if resulttype is unordered_node_snapshot_type or ordered_node_snapshot_type, the length of the snapshort array. read only. stringvalue domstring if resulttype is string_type, the boolean value. read only. constants type constants constant value
description any_type 0 used when evaluating an xpath expression; the evaluator will return the most appropriate type. number_type 1 type is a single number. string_type 2 type is a single string. boolean_type 3 type is a single boolean value. unordered_node_iterator_type 4 type is a reference to all the nodes matching the expression u...
nsIDeviceMotionData
em/nsidevicemotion.idlscriptable this interface provides information about device motion. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nsidevicemotiondata prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3). attributes attribute type
description type unsigned long the type of motion data reported by this object; see motion type constants for possible values. read only. x double the amount of tilt along the x axis. read only. y double the amount of tilt along the y axis. read only. z double the amount of tilt along the z axis. read only. the values of x, y, and z can range from -1 to 1, where 0 means the device is balanced on...
...e values. read only. x double the amount of tilt along the x axis. read only. y double the amount of tilt along the y axis. read only. z double the amount of tilt along the z axis. read only. the values of x, y, and z can range from -1 to 1, where 0 means the device is balanced on that axis. see accelerometer values explained for details. constants motion type constants constant value
description type_acceleration 0 the motion data describes device acceleration. type_orientation 1 the motion data describes a device orientation chang. see also mozorientation nsidomorientationevent nsidevicemotionlistener nsidevicemotion ...
nsIDirIndex
netwerk/streamconv/public/nsidirindex.idlscriptable a class holding information about a directory index. because this has no reference back to their original source, changing these attributes won't affect the directory. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type
description contenttype string the content type; may be null if it is unknown. unspecified for directories.
description wstring a
description for the filename, which should be displayed by a viewer. lastmodified prtime last-modified time in seconds-since-epoch. if the last modified time is unknown, this value is -1. location string the fully qualified filename, expressed as a uri. this is encoded with the encoding specified in the nsidirindexparser, and is also escaped. size lon...
...nce-epoch. if the last modified time is unknown, this value is -1. location string the fully qualified filename, expressed as a uri. this is encoded with the encoding specified in the nsidirindexparser, and is also escaped. size long long file size; if the size is unknown, this value is -1. type unsigned long the type of the entry; one of the type_* constants. constants constant value
description type_unknown 0 the type is unknown. type_directory 1 the directory entry represents a directory. type_file 2 the directory entry represents a file. type_symlink 3 the directory entry represents a symlink. see also nsidirindexlistener nsidirindexparser ...
nsIEditor
document document read only. the ...
... document document read only. the dom document this editor is associated with. documentcharacterset acstring sets the current 'save' document character set. ...
nsIExternalProtocolService
m-specific applications for handling particular protocols. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) you can ask the external protocol service if it has an external handler for a given protocol scheme. and you can ask it to load the url using the default handler. ...
...ith the os. boolean externalprotocolhandlerexists( in string aprotocolscheme ); parameters aprotocolscheme the scheme from a url: http, ftp, mailto, and so on. note: aprotocolscheme should not include a trailing colon, which is part of the uri syntax, not part of the scheme itself. that is, pass "mailto" not "mailto:". return value true if we have a handler and false otherwise. getapplication
description() gets a human-readable
description for the application responsible for handling a specific protocol. astring getapplication
description( in autf8string ascheme ); parameters ascheme the scheme to look up. for example, "mms". return value this code makes little sense and needs to be cleaned up. -nickolay <pre> // first construct an nsiuri object using the ioservice var ioservice = components.
nsIFeedEntry
toolkit/components/feeds/public/nsifeedentry.idlscriptable this interface describes a single entry in an rss or atom news feed, providing attributes allowing access to the entry's data. 1.0 66 introduced gecko 1.8 inherits from: nsifeedcontainer last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type
description content nsifeedtextconstruct the full text of the entry's content. this comes from the atom:content and/or content:encoded fields. enclosures nsiarray an array of all the enclosures included in the entry. these are used by podcasts, photocasts, and so forth. mediacontent nsiarray an array of all the enclosures or other media that might be displayed inline...
...ished astring a string indicating the date on which the entry was published, in rfc822 format. this date is parsable by both javascript (via date.parse()) and mail code. note, that the related updated attribute is available from the nsifeedcontainer interface. summary nsifeedtextconstruct a summary of the feed entry's content. this is generated automatically using the entry's
description, subtitle, summary, content, and appropriate extensions. see also nsifeedcontainer interwiki lin ...
nsIFile
each element in the enumeration is an nsifile. read only. exceptions thrown ns_error_file_not_directory indicates that this nsifile does not reference a directory. diskspaceavailable print64 the number of bytes available to non-superuser on the dis...
...me name (for example mac). this is solved by holding "private", native data in the nsifile implementation. this native data is lost when you convert to a string. do not pass to use with nspr or stdlib! read only. exceptions thrown ns_error_file_invalid_path indicates that this nsifile does not reference a symbolic link. constants constant value
description normal_file_type 0 a normal file. directory_type 1 a directory/folder. delete_on_close 0x80000000 optional parameter used by opennsprfiledesc methods append() this function is used for constructing a descendant of the current nsifile. note: this method does not return a new nsifile; it modifies the object it was called on. if the old nsifile...
nsIFileView
by: @mozilla.org/filepicker/fileview;1. to create an instance, use: var fileview = components.classes["@mozilla.org/filepicker/fileview;1"] .createinstance(components.interfaces.nsifileview); method overview void setdirectory(in nsifile directory); void setfilter(in astring filterstring); void sort(in short sorttype, in boolean reversesort); attributes attribute type
description reversesort boolean if true results will be sorted in ascending order. read only. selectedfiles nsiarray an nsiarray of selected files, which contains nsiarray instances. read only. showhiddenfiles boolean if true hidden files will be shown. showonlydirectories boolean if true only directory entries will be returned. sorttype short the current sort type in effect. read only. constant...
...an if true results will be sorted in ascending order. read only. selectedfiles nsiarray an nsiarray of selected files, which contains nsiarray instances. read only. showhiddenfiles boolean if true hidden files will be shown. showonlydirectories boolean if true only directory entries will be returned. sorttype short the current sort type in effect. read only. constants constant value
description sortname 0 sort by file name. sortsize 1 sort by file size. sortdate 2 sort by the date of the last modification. methods setdirectory() set the directory to be browsed. void setdirectory( in nsifile directory ); parameters directory the directory to be browsed. setfilter() set the filter to be applied to the file list, for example "*.jpg" would only return jpg files. void setfilter...
nsIFocusManager
setting the activewindow raises it, and focuses the current child window's current element, if any. setting this to null or to a non-top-level window throws an ns_error_invalid_arg exception. focusedelement nsidomelement the element that is cu...
...ng the focusedwindow changes the focused window and raises the toplevel window it is in. if the current focus within the new focusedwindow is a frame element, then the focusedwindow will actually be set to the child window and the current element within that set as the focused element. this process repeats downwards until a non-frame element is found. constants constant value
description flag_raise 1 flag_noscroll 2 do not scroll the element to focus into view. flag_noswitchframe 4 if attempting to change focus in a window that is not focused, do not switch focus to that window. instead, just update the focus within that window and leave the application focus as is. this flag will have no effect if a child window is focused and an at...
nsIFrameScriptLoader
ow message manager. as the user opens new tabs in this window, copies of the script will be loaded into these new tabs, as well. frame scripts are essentially per-tab, so they don't get reloaded when the user navigates. if you want a frame script to do something whenever a new document is loaded, you can listen for the document-element-inserted notification. parameters name type
description aurl string url for the script to load. aurl must be the absolute url. data: urls are also supported. for example data:,dump("foo\n"); aallowdelayedload boolean if true, this flag means that the frame script will be loaded into any new frames opened after the loadframescript() call, until removedelayedframescript() is called for that script. aruninglobal...
... removedelayedframescript() removes aurl from the list of scripts which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new frames. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type
description aurl string url for the script to remove. getdelayedframescripts() returns all delayed scripts that will be loaded once a (remote) frame becomes available. the return value is a list of pairs [<url>, <wasloadedinglobalscope>]. returns list of the delayed scripts. each script is returned as a pair: [<url>, <wasloadedinglobalscope>]. ...
nsIHTMLEditor
returninparagraphcreatesnewparagraph boolean a boolean indicating if a return key pressed in a paragraph creates another paragraph or just inserts a <br> at the caret. constants constant value descri...
...iption iscssenabled boolean a boolean which is true is the htmleditor has been instantiated with css knowledge and if the css pref is currently checked. returninparagraphcreatesnewparagraph boolean a boolean indicating if a return key pressed in a paragraph creates another paragraph or just inserts a <br> at the caret. constants constant value
description eleft 0 ecenter 1 eright 2 ejustify 3 methods adddefaultproperty() registers a default style property with the editor. void adddefaultproperty( in nsiatom aproperty, in astring aattribute, in astring avalue ); parameters aproperty the property to set by default. aattribute the attribute of the property, if...
nsIHttpActivityObserver
servers. ...
...ata, in acstring aextrastringdata); attributes attribute type
description isactive boolean true when the interface is active and should observe http activity, otherwise false. if this is false, the observeactivity() method should not be called. read only. note: this attribute is present only for compatibility and should not be used. constants activity type constants constant value
description activity_type_socket_transport 0x0001 socket transport activity has occurred. activity_type_http_transaction 0x0002 http transport activity has occurred. activity subtype constants constant value
description activity_subtype_request_header 0x5001 the http request is about to be queued for sending. observers can look at request headers in aextrastringdata activity_subtype_request_bo...
nsIHttpChannel
ing aheader, in acstring avalue, in boolean amerge); void setresponseheader(in acstring header, in acstring value, in boolean merge); void visitoriginalresponseheaders(in nsihttpheadervisitor avisitor); void visitrequestheaders(in nsihttpheadervisitor avisitor); void visitresponseheaders(in nsihttpheadervisitor avisitor); constants constant
description referrer_policy_no_referrer_when_downgrade default; indicates not to pass on the referrer when downgrading from https to http referrer_policy_no_referrer indicates no referrer will be sent referrer_policy_origin only send the origin of the referring uri referrer_policy_origin_when_xorigin same as the default; only send the origin of the referring ur...
...this should be set to false, for example, if the application knows that the corresponding document is likely to be very large. this attribute is true by default, though other factors may preve...
nsIInstallLocation
this is different from restricted because it's not whether or not the location *might* be restricted, it's whether or not it actually *is* restricted right now. read only. itemlocations nsidirectoryenumerator an enumeration of nsifiles for: locations that contain items potential d...
...cation is restricted with the current user privileges. read only. constants constants representing priority of some default install locations. you should not use the exact values here, you should offset from these values each time you create a new install location. offsetting can be brittle but you should know what install locations are being defined for your own application. constant value
description priority_app_profile 0 priority_app_system_user 10 priority_xre_system_user 100 priority_app_system_global 1000 priority_xre_system_global 10000 methods getidforlocation() retrieves the guid for an item at the specified location. note: this function makes no promises about whether or not this path is actually maintained by this install location. astring getidforlocation( ...
nsIJumpListBuilder
hortcuts, links, and separators. see nsijumplistitem for information on adding additional jump list types. method overview void abortlistbuild(); boolean addlisttobuild(in short acattype, in nsiarray items optional, in astring catname optional); boolean commitlistbuild(); boolean deleteactivelist(); boolean initlistbuild(in nsimutablearray removeditems); attributes attribute type
description available short indicates whether jump list taskbar features are supported by the current host. read only. islistcommitted boolean jumplist management. indicates if a commit has already occurred in this session. read only. exceptions thrown ns_error_not_available on all calls if taskbar functionality is not supported by the operating system. maxlistitems short the maximum number of jump...
...rrent host. read only. islistcommitted boolean jumplist management. indicates if a commit has already occurred in this session. read only. exceptions thrown ns_error_not_available on all calls if taskbar functionality is not supported by the operating system. maxlistitems short the maximum number of jump list items the current desktop can support. read only. constants constant value
description jumplist_category_tasks 0 tasks are common actions performed by users within the application. a task can be represented by an application shortcut and associated command line parameters or a uri. task lists should generally be static lists that do not change often, if at all - similar to an application menu. tasks are given the highest priority of all lists when space is limited. jumplist_ca...
nsILocalFile
read only. followlinks prbool determines whether or not the nsilocalfile will automatically resolve symbolic links. by default, this value is false on all non-unix systems. as of mozilla 1.7, this attribute is ignored on unix systems. ...
...h may be insufficient to uniquely identify the file on the local file system. the persistent descriptor is intended to be used whenever a nsilocalfile needs to be serialized to disk and later recovered. this string is not intended for display to users. note: the value of the followlinks attribute is not encoded in the persistent descriptor. constants constant value
description delete_on_close 0x80000000 optional parameter used by opennsprfiledesc(). methods native code only! appendrelativenativepath appends a relative, native character encoding, path to the current path of the nsilocalfile object. void appendrelativenativepath( in acstring relativefilepath ); parameters relativefilepath a native relative path. for security reasons...
nsILocalFileMac
bundleidentifier autf8string returns the identifier of the bundle. read only. filecreator ostype native code only! filesizewithresfork print64 returns the combined size of both the data fork and the resource fork (if present) rather than just the s...
...r autf8string returns the identifier of the bundle. read only. filecreator ostype native code only! filesizewithresfork print64 returns the combined size of both the data fork and the resource fork (if present) rather than just the size of the data fork as returned by getfilesize() read only. filetype ostype file type and creator attributes. native code only! constants constant value
description current_process_creator 0x8000000 use with setfiletype() to specify the signature of current process. obsolete since gecko 2.0 methods native code only!getcfurl note: observes the state of the followlinks attribute. if the file object is an alias and followlinks is true, returns the target of the alias. if followlinks is false, returns the unresolved alias file. note: supported only for xp_m...
nsIMemoryMultiReporterCallback
lscriptable implement this interface to handle callbacks from nsimemorymultireporter instances. ...
...in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string
description, in nsisupports closure); methods callback() called to provide information from a multi-reporter. implement this method to handle the report information. void callback( in acstring process, in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string
description, in nsisupports closure ); parameters process the value of the process attribute for the memory reporter. path the value of the path attribute. kind the value of the kind attribute. units the value of the units attribute. amount the value of the amount attribute.
description the value of the
description attribute. closure an nsisupports ...
nsIMessageBroadcaster
s not initialized. for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the message receiver cannot be found. for example, we will throw ns_error_failure if we try to send a message to a cross-process frame whose process has crashed. parameters name type
description messagename string the name of the message. optional. this becomes the name property of the received message. obj object. the message payload. a structured clone of this becomes the data property of the received message. objects object. an object each of whose properties is an object. this becomes the objects prop...
...clone of this becomes the data property of the received message. objects object. an object each of whose properties is an object. this becomes the objects property of the received message, with each original object replaced with a cross process object wrapper for it. getchildat() return a single subordinate message manager. parameters name type
description aindex number the index of the subordinate message manager to retrieve. returns nsimessagelistenermanager: the message manager at the given index. attributes childcount number: the number of subordinate message managers. read only. ...
nsIMessenger
acstring getmsguriatnavigatepos(in long apos); acstring getfolderuriatnavigatepos(in long apos); void getnavigatehistory(out unsigned long acurpos, out unsigned long acount, [array, size_is(acount)] out string ahistory); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow. attributes attribute type
description transactionmanager nsitransactionmanager readonly: the transaction manager for this nsimessenger instance. sendingunsentmsgs boolean indicates if sending messages is in progress. lastdisplayedmessageuri acstring readonly: the url of the last displayed message. navigatepos long the current index in the navigation history. constants...
... nsitransactionmanager readonly: the transaction manager for this nsimessenger instance. sendingunsentmsgs boolean indicates if sending messages is in progress. lastdisplayedmessageuri acstring readonly: the url of the last displayed message. navigatepos long the current index in the navigation history. constants name value
description eunknown 0 unknown transaction type. edeletemsg 1 delete transaction type. emovemsg 2 move transaction type. ecopymsg 3 copy transaction type. methods setdisplaycharset() sets the character set for the displayed message. void setdisplaycharset(in acstring acharset); parameters acharset the character set to use. setwind...
nsIMsgFolder
lastmessageloa...
...annot have subfolders, and the inbox on some imap servers cannot have subfolders. canrename boolean readonly: can you change the name of this folder. for example, newsgroups and some special folders can't be renamed. cancompact boolean readonly: rootfolder nsimsgfolder readonly: the phantom server folder. constants constant value
description nsmsgbiffstate_newmail 0 user has new mail waiting. nsmsgbiffstate_nomail 1 no new mail is waiting. nsmsgbiffstate_unknown 2 we dunno whether there is new mail. nsmsgdispositionstate_none -1 nsmsgdispositionstate_replied 0 nsmsgdispositionstate_forwarded 1 allmessagecountnotifications 0 tur...
nsIMsgSearchSession
void resumesearch(); [noscript] nsmsgsearchtype setsearchparam(in nsmsgsearchtype type, in voidptr param); [noscript] void addresultelement(in nsmsgresultelement element); boolean matchhdr(in nsimsgdbhdr amsghdr, in nsimsgdatabase adatabase); void addsearchhit(in nsimsgdbhdr header, in nsimsgfolder folder); attributes attribute type
description searchterms nsisupportsarray readonly: numsearchterms unsigned long readonly: runningadapter nsimsgsearchadapter readonly: searchparam voidptr not scriptable and readonly: searchtype nsmsgsearchtype readonly: numresults long readonly: window nsimsgwindow constants name...
... op operator e.g. ...
nsINavBookmarksService
read only. note: renamed from bookmarksroot in gecko 1.9 placesroot long long the item id of the top-level folder that contains bookmarks, tags and all other places data. this contains administrative data as well as user data, and is therefore not recommended for use in queries. read only. ...
...f the top-level folder that contains the tag "folders". read only. note: renamed from tagroot in gecko 1.9 toolbarfolder long long the item id of the personal toolbar folder. read only. note: renamed from toolbarroot in gecko 1.9 unfiledbookmarksfolder long long the item id of the unfiled bookmarks folder. read only. constants constant value
description default_index -1 this is the default index; this value should be used for apis that allow passing in an index where the index is not known or is not required to be specified, such as when appending an item to a folder. type_bookmark 1 this is an index for type "bookmark". type_folder 2 this is an index for type "folder". type_separator 3 ...
nsINavHistoryResultNode
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this is the base class for all places history result nodes, containing the uri, title, and other general information. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type
description accesscount unsigned long total number of times the uri has been accessed. for hosts, this is the total number of the children under it, rather than the total number of times the host has been accessed (getting that information would require an additional query, so for performance reasons that information isn't given by default). read only. bookmarkindex long when this item is in a bookmark folder (its parent ...
... treats nodes with this property set to -1 as invisible! view-implementations may use this value to track the node index in the view, for example the tree view uses this value to indicate the row in the tree that this node is at. other views may choose not to use this, but should inititalize this value to anything but -1 for visible nodes. obsolete since gecko 1.9.2 constants constant value
description result_type_uri 0 nsinavhistoryresultnode. result_type_visit 1 nsinavhistoryvisitresultnode. result_type_full_visit 2 nsinavhistoryfullvisitresultnode. result_type_dynamic_container 4 nsinavhistorycontainerresultnode. result_type_query 5 nsinavhistoryqueryresultnode. result_type_folder 6 nsinavhistoryqueryresultnode. result_type_separator 7 nsinavhistoryresultnode. result_type_fol...
nsINavHistoryResultTreeViewer
e viewer, you need to keep your own reference to it, then reinitialize it when the tree changes. if you use this object and attach it to a result without attaching it to a tree, then forget about it, it will leak. method overview nsinavhistoryresultnode nodefortreeindex(in unsigned long aindex); unsigned long treeindexfornode(in nsinavhistoryresultnode anode); attributes attribute type
description collapseduplicates boolean controls whether duplicate adjacent elements are collapsed into a single item in the tree. this prevents you from seeing multiple entries for things when you have selected to get visits. when you sort by date, the multiple entries will then appear because they will be separated (unless you clicked reload a bunch of times in a row). if you know you'll only ever want o...
... since gecko 1.9 flatitemcount pruint32 this tells you how many items are in the flattened list of results, that is how many rows are in this tree right now. the tree adaptor will also qi to nsitreeview, and this will be the same as nsitreeview.rowcount. this is only valid when a tree is attached, the result will be 0 otherwise. read only. obsolete since gecko 1.9 constants constant value
description index_invisible 0xffffffff returned by treeindexfornode() when the requested node isn't visible (such as when its parent is collapsed). also returned if there is no tree attached. methods nodefortreeindex() returns the node for a given row index. this is only valid when a tree is attached. nsinavhistoryresultnode nodefortreeindex( in unsigned long aindex ); parameters aindex the row inde...
nsINavHistoryService
this can be used in ui to determine whether the "clear history" button should be enabled or not. this is much better than using browserhistory.count since that can be very slow if there is a lot of history (it must enumerate each item). this is pretty fast. historydisabled boolean true if history is disabled. cu...
... enabled or not. this is much better than using browserhistory.count since that can be very slow if there is a lot of history (it must enumerate each item). this is pretty fast. historydisabled boolean true if history is disabled. currently, history is disabled if the browser.history_expire_days pref is "0". constants transition type constants constant value
description transition_link 1 this transition type means the user followed a link and got a new toplevel window. transition_typed 2 this transition type is set when the user typed the url to get to the page. transition_bookmark 3 this transition type is set when the user followed a bookmark to get to the page. transition_embed 4 this transition type...
nsINetworkLinkService
the link is only up when network connections can be established. for example, the link is down during dhcp configuration (unless there is another usable interface already configured). if the link status is not currently known, we generally assume that it is up. read on...
... unsigned long the type of network connection, one of the link_type_* constants. read only. note: as of gecko 8.0, all operating systems currently return link_type_unknown. android support was backed out due to perceived security concerns, see bug 691054. as of gecko 28.0 android support is available again, see bug 939680. constants constant value
description link_type_unknown 0 we were unable to determine the network connection type. link_type_ethernet 1 a standard wired ethernet connection. link_type_usb 2 a connection via a usb port. link_type_wifi 3 a connection via a wifi access point (ieee802.11). link_type_wimax 4 a connection via wimax (ieee802.16). link_type_2...
nsIParentalControlsService
read only. loggingenabled boolean true if the current user account has parental controls logging enabled. if this is true, applications should log relevant events using log() method. read only. parentalcontrolsenable...
...nloads. read only. loggingenabled boolean true if the current user account has parental controls logging enabled. if this is true, applications should log relevant events using log() method. read only. parentalcontrolsenabled boolean true if the current user account has parental controls restrictions enabled. read only. constants constant value
description epclog_urivisit 1 this log entry type represents an access to web content. epclog_filedownload 2 this log entry type represents a file download. methods log() logs an application specific parental controls event. void log( in short aentrytype, in boolean aflag, in nsiuri asource, in nsifile atarget optional ); parameters aentrytype the type of...
Component; nsIPrefBranch
pref_int 64 long data type. pref_bool 128 long data type. methods addobserver() adds a preference ch...
... pref_int 64 long data type. pref_bool 128 long data type. ...
nsIProcessScriptLoader
aallowdelayedload should always be true. it's possible that the child process for this chromemessagesender is not yet available at the time of the loadprocessscript() call, and if you pass false in this situation, your process script won't be loaded. for example: let ppmm = services.ppmm.getchildat(1); ppmm.loadprocessscript('data:,dump("foo\n");', true); parameters name type
description aurl string url for the script to load. aurl must be the absolute url. data: urls are also supported. for example data:,dump("foo\n"); aallowdelayedload boolean if this flag is false, the process script will only be loaded into child processes that are already running at the time of the call. if this flag is true, the process script will be loaded into ...
...elayedprocessscript() removes aurl from the list of scripts which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new child processes. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type
description aurl string url for the script to remove. getdelayedprocessscripts() returns all delayed scripts that will be loaded once a child process becomes available. the return value is a list of pairs [<url>, false]. returns list of the delayed scripts. each script is returned as a pair: [<url>, false]. ...
nsIProfile
shutdown_cleanse 0x00000002 when shutting down the profile, di...
... shutdown_cleanse 0x00000002 when shutting down the profile, discard changes. ...
nsIProtocolHandler
to implement this interface. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean allowport(in long port, in string scheme); nsichannel newchannel(in nsiuri auri); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type
description defaultport long the default port is the port the protocol uses by default. if the protocol doesn't need a port (for example, the "about" protocol), this attribute is -1. read only. protocolflags unsigned long protocol-specific flags. read only. note: starting with firefox 3, one of uri_loadable_by_anyone, uri_dangerous_to_load, uri_is_ui_resource, or uri_is_loca...
... uri_dangerous_to_load, uri_is_ui_resource, or uri_is_local_file must be set on every protocol handler. current versions of firefox assume that the uri has uri_loadable_by_anyone set, but this will not work starting with the mozilla 2 platform. scheme acstring the scheme for this protocol ("file", "http", and so forth). read only. constants constant value
description uri_std 0 a standard full uri with authority component and understanding relative uris; this includes http and ftp, for example. uri_norelative 1<<0 the protocol doesn't support relative uris (for example, about and javascript). uri_noauth 1<<1 the protocol doesn't have an authority component (for example, file). uri_inherits_security_context ...
nsIProxyInfo
this interface identifies a proxy server. netwerk/base/public/nsiproxyinfo.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports attributes attribute type
description failoverproxy nsiproxyinfo this attribute specifies the proxy to failover to when this proxy fails. failovertimeout unsigned long this attribute specifies the failover timeout in seconds for this proxy. if a nsiproxyinfo is reported as failed via nsiprotocolproxyservice.getfailoverforproxy(), then the failed proxy will not be used again for this many seconds. read only. flags unsigned long this attribute specifi...
...e()) a future version of this interface may define additional types. read only. note: prior to gecko 1.8 type was available by the type method. constants the following "proxy flags" may be bit-wise combined to construct the flags attribute defined on this interface. all unspecified bits are reserved for future use. constant value
description transparent_proxy_resolves_host 1 << 0 this flag is set if the proxy is to perform name resolution itself. if this is the case, the hostname is used in some fashion, and we shouldn't do any form of dns lookup ourselves. see also nsiprotocolproxyservice nsiprotocolproxyfilter ...
nsIScriptError
read only. columnnumber pruint32 the column number where the error occurred. this is used to draw the arrow pointing to the problem character. read only. errormessage astring the error message in a string format without any context/line number inform...
... astring the url of the file in which the error occurred. this will be a hyperlink in the javascript console, so you should use a real url. you may pass null if it's not applicable. read only. timestamp long long elapsed time, in milliseconds, from a platform-specific zero time to the time the message was created. read only. flag constants constant value
description errorflag 0x0 error messages. a pseudo-flag for the default, error case. warningflag 0x1 warning messages. exceptionflag 0x2 an exception was thrown for this case - exception-aware hosts can ignore this. strictflag 0x4 one of the flags declared in nsiscripterror. infoflag 0x8 just a log message methods init() init...
nsISelection
implemented by: ?????????????????????????????????????. ...
...read only. anchoroffset long the offset within the (text) node where the selection begins. read only. focusnode nsidomnode returns the node in which the selection ends. read only. focusoffset long the offset within the (text) node where the selection ends. read only. ...
nsISelectionPrivate
endplaceholdertransaction will give rise to reflow/refreshing view/scroll, and call times of nstextframe::getpointfromoffset whose return value is to be cached. see bug 35296 and bug 199412 native code only! interlineposition boolean ...
...l give rise to reflow/refreshing view/scroll, and call times of nstextframe::getpointfromoffset whose return value is to be cached. see bug 35296 and bug 199412 native code only! interlineposition boolean type short returns the type of the selection (see nsiselectioncontroller for available constants). read only. ...
nsISessionStartup
m: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: @mozilla.org/browser/sessionstartup;1. to use this service, use: var sessionstartup = components.classes["@mozilla.org/browser/sessionstartup;1"] .getservice(components.interfaces.nsisessionstartup); method overview boolean dorestore(); attributes attribute type
description sessiontype unsigned long the type of session being restored; this will be one of the session type constants. read only. state jsval the session state, as a javascript object. read only. note: prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), this was a string. it was changed in order to improve performance, which was suffering due to the need to parse and stringify the da...
...ored; this will be one of the session type constants. read only. state jsval the session state, as a javascript object. read only. note: prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), this was a string. it was changed in order to improve performance, which was suffering due to the need to parse and stringify the data. constants session type constants constant value
description no_session 0 there's no data available from the previous session. recover_session 1 the last session crashed. it will either be restored or about:sessionrestore will be displayed. resume_session 2 the previous session should be restored at startup. defer_session 3 the previous session is viable but shouldn't be restored without explicit action (with the exception of app tabs, which are...
nsISmsService
ers for one sms). hassupport() checks if the current platform has sms support. ...
...f the current platform has sms support. boolean hassupport(); return value boolean. ...
nsIStandardURL
d by: @mozilla.org/network/standard-url;1. ...
...t, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type
description mutable boolean control whether or not this url can be modified. protocol handlers can set this flag before handing out an url to ensure that it is not inadvertently modified. obsolete since gecko 1.9 constants these constants describe how to normalize an url. ...
nsISupportsPrimitive
type_cstring 2 corresponding to nsisupportscstring. type_string 3 corresponding to nsisupportsstring. ...
... type_cstring 2 corresponding to nsisupportscstring. type_string 3 corresponding to nsisupportsstring. ...
nsISupportsPriority
ctly define what happens when the priority of an object is changed. an implementation of this interface is free to define the side-effects of changing the priority of an object. in some cases, changing the priority of an object may be disallowed (resulting in an exception being thrown) or may simply be ignored. method overview void adjustpriority(in long delta); attributes attribute type
description priority long the object's priority. it can be modified to change the priority of the object. typical priority values are defined in the idl file as priority_highest ... priority_lowest. the implementation is free to truncate a given priority value to whatever limits are appropriate. typically this attribute is initialized to priority_normal, but implementations may choose to assign a different...
...be modified to change the priority of the object. typical priority values are defined in the idl file as priority_highest ... priority_lowest. the implementation is free to truncate a given priority value to whatever limits are appropriate. typically this attribute is initialized to priority_normal, but implementations may choose to assign a different initial value. constants constant value
description priority_highest -20 the highest priority. priority_high -10 higher than normal priority. priority_normal 0 the default priority. priority_low 10 lower than normal priority. priority_lowest 20 the lowest priority. methods adjustpriority() this method adjusts the priority attribute by a given amount (delta). void adjustpriority( in long delta ); parameters delta the amount by whic...
nsISyncMessageSender
s not initialized. for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the message receiver cannot be found. for example, we will throw ns_error_failure if we try to send a message to a cross-process frame whose process has crashed. parameters name type
description messagename string the name of the message. optional. this becomes the name property of the received message. obj object. the message payload. a structured clone of this becomes the data property of the received message. objects object. an object each of whose properties is an object. this becomes the objects prop...
...ed clones of the objects returned by all the listeners to this message, one element for each listener. if there was only one listener, it is an array with a single element. sendrpcmessage() like sendsyncmessage(), except re-entrant. new rpc messages may be issued even if, earlier on the call stack, we are waiting for a reply to an earlier sendrpcmessage() call. parameters name type
description messagename string the name of the message. optional. this becomes the name property of the received message. obj jsonable object. the message payload. a structured clone of this becomes the data property of the received message. objects object. an object each of whose properties is an object. this becomes the obj...
nsITaskbarWindowPreview
taskbarpreviewbutton object. you may customize these buttons using the attributes on that interface. user clicks on the toolbar buttons are reported to your nsitaskbarpreviewcontroller implementation's nsitaskbarpreviewcontroller.onclick() method. ...
... methods getbutton() returns the specified button from the preview's toolbar. note: by default, all buttons are hidden. you must fetch and configure each button that you want to make visible. ...
nsITextInputProcessor
this means that the clause is not converted, i.e., raw text of user input. attr_raw_selected_clause 0x03 a clause attribute but this is ty...
...this means that the clause is not converted, i.e., raw text of user input. ...
nsITimer
read only. closure voidptr the opaque pointer pass to initwithfunccallback(). read only. native code only! delay unsigned long the timeout delay in millisecond. note: re-setting the delay on a one-shot timer that has already fired doesn't restart the timer. ca...
...hot timer. target nsieventtarget the nsieventtarget to which the callback is dispatched. this target must be set before calling any of the initialization methods. type unsigned long defines the timer type: one shot, repeating slack or repeating precise. must be one of the constants defined under constants on this page. constants constant value
description type_one_shot 0 type of a timer that fires once only. type_repeating_slack 1 after firing, the timer is stopped and not restarted until its callback completes. the timer period will ideally be at least the time between when processing for last firing the callback completes and when the next firing occurs, but note that this is not guaranteed: the timer can fire ...
nsITransaction
editor/txmgr/idl/nsitransaction.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void dotransaction(); boolean merge(in nsitransaction atransaction); void redotransaction(); void undotransaction(); attributes attribute type
description istransient boolean the transaction's transient state. this attribute is checked by the transaction manager after the transaction's execute() method is called. if the transient state is false, a reference to the transaction is held by the transaction manager so that the transactions' undotransaction() and redotransaction() methods can be called. if the transient state is true, the transaction manager returns immediately after the transaction's dotransaction() method...
...s the merge result. a true value indicates that the transactions were merged successfully, a false value if the merge was not possible or failed. if true, the transaction manager will release() the new transaction instead of pushing it on the undo stack. boolean merge( in nsitransaction atransaction ); parameters atransaction the previously executed transaction to merge. return value missing
description redotransaction() executes the transaction again. can only be called on a transaction that was previously undone. in most cases, the redotransaction method will actually call the dotransaction() method to execute the transaction again. void redotransaction(); parameters none. undotransaction() restores the state to what it was before the transaction was executed. void undotransaction(); paramet...
nsITransactionList
editor/txmgr/idl/nsitransactionlist.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview nsitransactionlist getchildlistforitem(in long aindex); nsitransaction getitem(in long aindex); long getnumchildrenforitem(in long aindex); boolean itemisbatch(in long aindex); attributes attribute type
description numitems long the number of transactions contained in this list. read only. methods getchildlistforitem() returns the list of children associated with the item at aindex. implementations may return null if there are no children, or an empty list. the list returned is addref'd so it is up to the caller to release the transaction when it is done. nsitransactionlist getchildlistforitem( in long aindex...
...hildren associated with the item at aindex. getitem() returns the transaction at the given index in the list. note that a null can be returned here if the item is a batch. the transaction returned is addref'd so it is up to the caller to release the transaction when it is done. nsitransaction getitem( in long aindex ); parameters aindex the index of the item in the list. return value missing
description getnumchildrenforitem() returns the number of child (auto-aggreated) transactions the item at aindex has. long getnumchildrenforitem( in long aindex ); parameters aindex the index of the item in the list. return value the number of child (auto-aggreated) transactions the item at aindex has. itemisbatch() returns true if the item at aindex is a batch. note that currently there is no requireme...
nsITreeColumn
rface represents a tree column. layout/xul/base/src/tree/public/nsitreecolumns.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void getidconst([shared] out wstring idconst); native code only! nsitreecolumn getnext(); nsitreecolumn getprevious(); void invalidate(); attributes attribute type
description atom nsiatom the atom attribute of nsitreecolumn which returns an nsiatom for the column, making it fast to do comparisons. read only. native code only! columns nsitreecolumns the nsitreecolumns containing this column. read only. cycler boolean if true, then the column is a cycler column. if the cycler attribute is not set, the column cells are regular text cells. read only. editable boo...
...d only. selectable boolean if true the nsitreecolumn is able to be selected. if the selectable attribute is not set, the column cells are not selectable. read only. type short the type of the column, see constants. read only. width long the width of nsitreecolumn. read only. x long the x position in the tree of the left edge of the nsitreecolumn. read only. constants constant value
description type_text 1 text column type. type_checkbox 2 checkbox column type. type_progressmeter 3 progress meter column type. methods native code only!getidconst void getidconst( [shared] out wstring idconst ); parameters idconst getnext() get the next column in the nsitreecolumns. nsitreecolumn getnext(); parameters none. return value the next nsitreecolumn in the nsitreecolumns. getprevi...
nsIUpdateItem
u should use the addon manager. method overview void init(in astring id, in astring version, in astring installlocationkey, in astring minappversion, in astring maxappversion, in astring name, in astring downloadurl, in astring xpihash, in astring iconurl, in astring updateurl, in astring updatekey, in long type, in astring targetappid); attributes attribute type
description iconurl astring the url of the icon that can be shown for this item. read only. id astring the guid of the item. read only. installlocationkey astring the name of the install location where this item is installed. read only. maxappversion astring the maximum version of the application that this item works with, in fvf format. read only. ...
...itmanagerwithhashes(). read only. xpiurl astring the url of the xpi where this item can be downloaded. read only. constants item type constants constants representing types of update checks. constants that callers can use to indicate the reason for an add-on update check. internal code uses other constants in nsextensionmanager.js.in. ...
nsIWebBrowserChrome
the implementation should reflect the value of this attribute by hiding or showing its chrome appropriately. webbrowser nsiwebbrowser the currently loaded webbrowser. the browser chrome may be told to set the webbrowser object to a new object by setting this attribute. in this case the implementer is...
...rently loaded webbrowser. the browser chrome may be told to set the webbrowser object to a new object by setting this attribute. in this case the implementer is responsible for taking the new webbrowser object and doing any necessary initialization or setup as if it had created the webbrowser itself. this includes positioning setting up listeners etc. constants constant value
description status_script 1 flag for setstatus() status_script_default 2 flag for setstatus() status_link 3 flag for setstatus() chrome_default 1 value for the chromeflags attribute. chrome_window_borders 2 value for the chromeflags attribute. chrome_window_close 4 value for the chromeflags attribute. chrome_wi...
nsIWebBrowserPersist
read only. persistflags unsigned long flags governing how data is fetched and saved from the network. it is best to set this value explicitly unless you are prepared to accept the default values. progresslistener nsiwebprogresslistener callback listener for progress notifications. the ob...
...sslistener callback listener for progress notifications. the object that the embbedder supplies may also implement nsiinterfacerequestor and be prepared to return nsiauthprompt or other interfaces that may be required to download data. result unsigned long value indicating the success or failure of the persist operation. read only. constants constant value
description persist_flags_none 0 no special persistence behavior. persist_flags_from_cache 1 only use cached data (could result in failure if data is not cached). persist_flags_bypass_cache 2 bypass the cached data. persist_flags_ignore_redirected_data 4 ignore any redirected data (usually adverts). persist_flags_ignore_iframes 8 igno...
nsIWebSocketChannel
read only. loadgroup nsiloadgroup the load group of the websockets code. notificationcallbacks nsiinterfacerequestor the notification callbacks for authorization and so forth. originaluri nsiuri the original uri used to construct the protocol connection. this is used in ...
...ll. read only. protocol acstring sec-websocket-protocol value. securityinfo nsisupports transport-level security information (if any). read only. uri nsiuri the uri corresponding to the protocol connection after any redirections are completed. read only. status codes the following values are permitted status codes. status code name
description 0-999 reserved and not used. 1000 close_normal normal closure; the connection successfully completed whatever purpose for which it was created. 1001 close_going_away the endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection. 1002 close_protocol_error ...
nsIWindowsShellService
this article. inherits from: nsishellservice last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview string getregistryentry(in long ahkeyconstant, in string asubkeyname, in string avaluename); obsolete since gecko 1.8 void restorefilesettings(in boolean aforallusers); obsolete since gecko 1.9 void shortcutmaintenance(); attributes attribute type
description desktopbackgroundcolor unsigned long the desktop background color, visible when no background image is used, or if the background image is centered and does not fill the entire screen. a rgb value, where (r << 24 | g << 16 | b) obsolete since gecko 1.8 unreadmailcount unsigned long the number of unread mail messages for the current user. read only. constants valid starting keys for the win...
...d long the desktop background color, visible when no background image is used, or if the background image is centered and does not fill the entire screen. a rgb value, where (r << 24 | g << 16 | b) obsolete since gecko 1.8 unreadmailcount unsigned long the number of unread mail messages for the current user. read only. constants valid starting keys for the windows registry. constant value
description hkcr 0 hkey_classes_root. obsolete since gecko 1.8 hkcc 1 hkey_current_config. obsolete since gecko 1.8 hkcu 2 hkey_current_user. obsolete since gecko 1.8 hklm 3 hkey_local_machine. obsolete since gecko 1.8 hku 4 hkey_users. obsolete since gecko 1.8 methods getregistryentry() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) retrieves ...
nsIXULRuntime
supports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/xre/app-info;1. to get an instance, use: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime); method overview void invalidatecachesonrestart(); attributes attribute type
description accessibilityenabled boolean if true, the accessibility service is running. read only. browsertabsremoteautostart boolean if true, browser tabs may be opened by default in a different process from the main browser ui. read only. insafemode boolean whether the application was launched in safe mode. read only. is64bit boolean indi...
...onfigure variable. it may not be available on all platforms, especially unusual processor or compiler combinations. the result takes the form <processor>-<compilerabi>, for example: x86-msvc ppc-gcc3. this value should almost always be used in combination with os. may throw ns_error_not_available. read only. constants process type constants constant value
description process_type_default 0 the default (chrome) process. process_type_plugin 1 a plugin subprocess. process_type_content 2 a content subprocess. process_type_ipdlunittest 3 ipdl unit testing subprocess. methods invalidatecachesonrestart() signal the apprunner to invalidate caches on the next restart. this will cause components to be...
nsIXULWindow
contextflags pruint32 contextflags are from nsiwindowcreator2. docshell nsidocshell the docshell owning the xul for this window. read only. intrinsicallysized boolean indicates if this window is instrinsically sized. primarycontentshell nsidocshelltreeitem ...
... xulbrowserwindow nsixulbrowserwindow provides access to the xulbrowserwindow object offering a way for the browser to update the user interface of the enclosing xul window. zlevel unsigned long one of the z level constants below. on some platforms, windows with a higher zlevel will be kept above windows with a lower zlevel. constants constant value
description lowestz 0 loweredz 4 the z level of an independent window opened with the "alwayslowered" chrome flag. normalz 5 the default z level of an independent window. raisedz 6 the z level of an independent window opened with the "alwaysraised" chrome flag. highestz 9 methods addchildwindow() tell this window that it ...
nsIXmlRpcClient
null if the last call didn't return an xml-rpc fault. result readonly nsisupports the most recent xml-rpc call result returned from this server. null if the last call didn't retu...
...er. null if the last call didn't return a valid result. responsestatus readonly unsigned long the most recent http status code returned from this server. null if the server was unreachable or not yet contacted. responsestring readonly unsigned long the most recent http status code returned from this server. null if the server was unreachable or not yet contacted. constants constant type
description int unsigned long nsisupportsprint32 boolean unsigned long nsisupportsprbool string unsigned long nsisupportscstring double unsigned long nsisupportsdouble datetime unsigned long nsisupportsprtime array readonly unsigned long nsisupportsarray struct readonly unsigned long nsisupportsdictionary methods init() set server url. call this before using this object void getdata ( ...
nsIZipReader
read only. manifestentriescount pruint32 the number of entries in the manifest. read only. methods close() closes a zip reader. subsequent attempts to extract() files or read from its input stream will result in an error. subsequent attempts to access a nsizipentry obt...
...gned an entry. parsemanifest must be called first. if aentryname is an entry in the jar, getinputstream() must be called after parsemanifest. if aentryname is an external file which has meta-information stored in the jar, verifyexternalfile (not yet implemented) must be called before getprincipal. nsiprincipal getcertificateprincipal( in string aentryname ); parameters aentryname missing
description return value an nsiprincipal. example demonstrating this function: list contents of xpi and read file contents getentry() returns a nsizipentry describing a specified zip entry. nsizipentry getentry( in autf8string zipentry ); parameters zipentry the zip entry. return value the nsizipentry for the given zip entry. example demonstrating this function: list contents of xpi and...
nsIZipWriter
exceptions thrown ns_error_not_initialized if no zip file has been opened. file nsifile the zip file being written to. read only. inqueue boolean true if operations are being performed in the background queue, or false if background opera...
...y open zip file. exceptions thrown ns_error_not_initialized if no zip file has been opened. file nsifile the zip file being written to. read only. inqueue boolean true if operations are being performed in the background queue, or false if background operations are not in progress. read only. constants constant value
description compression_none 0 do not compress the file. compression_fastest 1 use the fastest compression method when adding the file to the archive. compression_default 6 use the default compression method when adding the file to the archive. compression_best 9 use the best compression method when adding the file to the archive. methods ad...
XPCOM
pcom factories can be very simple. rick potts wrote a templated-based generic factory (nsfactory<t>) that simplifies the factory creation process that just requires writing a createinstance() method. the new nsigenericfactory interface takes this a step further, by providing a single interface that can be reused anytime a simple implementation of nsifactory is needed. here is the interface, and a
description of its use.</t>how to build a binary xpcom component using visual studiothis is a simple tutorial for building xpcom objects in c++ using visual studio. xpcom is mozilla’s cross platform component object model, similar to microsoft’s com technology. xpcom components can be implemented in c, c++, and javascript, and can be used from c, c++, and javascript. that means you can call javascript me...
...if you have a class that you think is involved in a cyclical-ownership leak, this page is for you.introduction to xpcom for the domwarning: this document has not yet been reviewed by the dom gurus, it might contain some errors.language bindingsan xpcom language binding is a bridge between a particul...
nsIMsgCloudFileProvider
as such, the type should be an alphanumpheric string with no spaces. displayname acstring readonly: used for displaying the service name in the user interface. serviceurl acstring readonly: a link to the homepage of the service, if applic...
...mount of space used by this account. if this value is not known, returns -1. lasterror acstring readonly: the last error message received from the server. constants the following constants are used for the status codes passed to the onstoprequest functions of the nsirequestobserver's used by the asynchronous methods of nsimsgcloudfileprovider. constant value
description offlineerr 0x80550014 returned when it appears that there is no active network connection. autherr 0x8055001e returned when authorizing has failed. uploaderr 0x8055311a returned when uploading has failed for an unknown reason. uploadwouldexceedquota 0x8055311b returned when uploading has failed because the user has exceeded their storage...
MailNews fakeserver
l occurrences of '\n' (but not '\r') to '\r\n' for you, as well as append the '\r\n' to the response if not present. it will also properly queue all messages sent in pipelining mode and will present lines without any eol characters. in addition, it uses utf-8 as the transmission medium. the server presents the following api to the handler: <caption> server api </caption> name arguments returns
description closesocket none nothing closes the socket and stops the test. setmultiline the new value of multiline nothing the value is a boolean, with true invoking multiline mode. it is off by default. extending a handler to provide different mechanisms is a process not defined here; please check the documentation of the corresponding handler for instructions. using fakeserver in xpcshell tests sin...
...server provides no means to keep a persistent connection past a test, requiring connections to be closed, possibly forcibly. alternatively, one can wait for the timeout, which occurs after 3 minutes, so not closing connections would make the tests take unbearably long. ...
customDBHeaders Preference
rlay.xul \ install.rdf superfluous.xpi: ${deps} zip $@ ${deps} chrome.manifest: content superfluous chrome/content/ overlay chrome://messenger/content/messenger.xul chrome://superfluous/content/superfluous_overlay.xul install.rdf: <?xml version='1.0' encoding='utf-8'?> <rdf xmlns='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:em='http://www.mozilla.org/2004/em-rdf#'> <
description about='urn:mozilla:install-manifest'> <em:id>superfluous@yoursite.com</em:id> <em:version>0.1.1</em:version> <em:type>2</em:type> <!-- 2 is type 'extension' --> <em:targetapplication> <
description> <!-- this next line identifies tbird as target --> <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <em:minversion>2*</em:minversion...
...us@yoursite.com</em:id> <em:version>0.1.1</em:version> <em:type>2</em:type> <!-- 2 is type 'extension' --> <em:targetapplication> <
description> <!-- this next line identifies tbird as target --> <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <em:minversion>2*</em:minversion> <em:maxversion>3.0.0.*</em:maxversion> </
description> </em:targetapplication> <em:name>superfluous</em:name> <em:
description>test superfluous extension</em:
description> <em:creator>garrett comeaux</em:creator> </
description> </rdf> build process: [gcomeaux@kyle tbird-ext]$ cd superfluous/ [gcomeaux@kyle superfluous]$ make zip superfluous.xpi chrome/ chrome.manifest chrome/content/ chrome/content/superfluous.js chrome/content...
WebIDL bindings
sponsibility of the caller. for example, this webidl: dictionary dict { long foo = 5; domstring bar; }; interface test { void initsomething(optional dict arg = {}); }; will correspond to this c++ function declaration: void initsomething(const dict& arg); and the dict struct will look like this: struct dict { bool init(jscontext* acx, js::handle<js::value> aval, const char* asource
description = "value"); optional<nsstring> mbar; int32_t mfoo; } note that the dictionary members are sorted in the struct in alphabetical order. api for working with dictionaries there are a few useful methods found on dictionaries and dictionary members that you can use to quickly determine useful things. member.waspassed() - as the name suggests, was a particular member passed? (e.g., if (ar...
...ded. one example of this is pushmanager. example here's an example js implementation of the above interface. the invisiblevalue field will not be accessible to web content, but is usable by the donothing() method. ...
FunctionType
the types of each of the parameters passed into the c function. return value a ctype describing the function type. the equivalent c function type declaration would be: returntype (*) ([argtype1, ..., argtypen]); exceptions thrown typeerror abi is not a valid abi constants, or returntype or any of the argument types are not valid ctype objects. ...
...read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, this is simply the string that was passed to the constructor. for other function, pointer, and array types, this should be a valid c type expression. ...
StructType
nd as a javascript number. describing fields the fields array is comprised of field descriptors, one for each field in the structure. each field descriptor contains the field's name and its type, such as {'serialnumber': ctypes.int}. a complete field descriptor list might look like this: [ {'serialnumber': ctypes.int}, {'username': ctypes.char.ptr} ] properties property type
description fields ctype[] a sealed array of field descriptors. read only. properties inherited from ctype these properties are available on all ctype objects. property type
description name string the type's name. read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, this is s...
... described above. structtype cdata syntax cdata structtype(); structtype is structtype ctype. return value a cdata representing the newly allocated struct. exceptions thrown error fields are not yet defined. structtype cdata properties every struct object has a getter and a setter for each member field of the structure. properties inherited from cdata property type
description constructor ctype the data type of the cdata object, as a ctype. read only. note: this is never ctypes.void_t or an array type with an unspecified length. value object the javascript equivalent of the cdata object's value. this will throw a typeerror exception if the value can't be converted. structtype cdata method_overview cdata addre...
PKCS #11 Netscape Trust Objects - Network Security Services
by the der value of the issuer field, and the serial number. pkcs#11 representation trust objects are stored as objects on a pkcs#11 token. although these are specific to a certificate, they do not need to be stored on the same token as the certificate. trust objects are of the class cko_netscape_trust and have the following attributes. trust object attributes. attribute type
description cka_class ck_object_class cko_netscape_trust cka_issuer byte array der-encoding of the certificate issuer name. required for non-trust anchor objects. cka_subject byte array der-encoding of the certificate subject name. optional. cka_serial_number byte array der-encoding of the certificate serial number. required for non-tru...
...st for key-agreement key usage purpose. cka_trust_key_cert_sign ck_trust level of trust for certificate signing key usage purpose. cka_trust_key_crl_sign ck_trust level of trust for crl signing key usage purpose. ck_trust is a ck_ulong which can contain one several values. it represents the level of trust. level of trust values. value
description ck_untrusted explicitly untrusted. ck_unknown trust is unknown and should be determined elsewhere. ck_trusted explicitly trusts the certificate referred to in the trust object. ckt_trusted_delegator trusts the certificate as a certificate authority, and delegates trust (for the purpose) to other signed certificates. definitions definitions...
Plug-in Basics - Plugins
ge communicate with javascript/dom from native code you can see which plug-ins are installed on your system and have been properly associated with the browser by consulting the installed plug-ins page. go to the help menu, and click help and then about plug-ins. type "about:plugins" in the location bar. the installed plug-ins page lists each installed plug-in along with its mime type or types,
description, file extensions, and the current state (enabled or disabled) of the plug-in for each mime type assigned to it. notice in view-source that this information is simply gathered from the javascript. because plug-ins are platform-specific, you must port them to every operating system and processor platform upon which you want to deploy your plug-in. plug-ins and helper applications before plug-ins...
... own window or is windowless. the way the content provider uses html elements to invoke the plug-in determines its display mode: whether it is embedded in a page, is part of a section, appears on its own separate page, or is hidden. this section discusses using html elements and display modes. for information about windowed and windowless operation, see windowed and windowless plug-ins. for a
description of each plug-in display mode, and which html element to use to achieve it, go on to plug-in display modes. for details about the html elements and their attributes, go on to: using the object element for plug-in display using the embed element for plug-in display plug-in display modes whether you are writing an html page to display a plug-in or developing a plug-in for an html author to in...
DevTools API - Firefox Developer Tools
mple, in the web console, there are 2 views (network view and object view). these views are only available in certain conditions controlled by the webconsole code. so it's up the webconsole the hide and show the sidebar, and select the correct tab. if the loaded document exposes a window.setpanel(toolpanel) function, the sidebar will call it once the document is loaded. ...
... hide the sidebar has been closed. examples register a tool gdevtools.registertoo...
Network request list - Firefox Developer Tools
requested via the specific http request method. method:post domain shows resources coming from a specifc domain. domain:mozilla.org remote-ip shows resources coming from a server with the specified ip. remote-ip:63.245.215.53 remote-ip:[2400:cb00:2048:1::6810:2802] cause shows resources matching a specific cause type. the types can be found in the
description of the cause column. cause:js cause:stylesheet cause:img transferred shows resources having a specific transferred size or a transferred size close to the one specified. k can be used as suffix for kilobytes and m for megabytes, e.g. the value 1k is equivalent to 1024. transferred:1k size shows resources having a specific size (after decompression) or a size...
...rch field. to make the search case sensitive: click the case sensitive (aa) icon next to the search field. to close the search panel, do one of the following: click the x icon next to the search field. click the search icon in the network monitor toolbar. context menu context-clicking on a row in the list displays a context menu with the following options: menuitem
description copy > copy url copies the url. copy > copy as curl copies the network request to the clipboard as a curl command, so you can execute it from a command line. see copy as curl, below. copy > copy as fetch copies the request as a call to the fetch() method, including the url and any settings object. copy > copy request headers copies the request's...
AddressErrors - Web APIs
complete example here we'll see a complete, working version of the example above (except of course that it's not connected to an actual payment handler, so no payments are actually processed). in the example, we're handling a donation to an organization that will be sending a "thank you" gift to the donor, so it requests shipping information along with allowing the donat...
...amount: {currency: 'usd', value: '0.00'}, selected: true } ] }; supportedhandlers describes the supported payment handlers and the details for those. in this example, only the basic card handler is supported, and it's configured to permit both debit and credit cards from visa, master card, american express, and discover. defaultpaymentdetails describes the payment being requested. a
description of the total amount being requested (including a label and the currency used), a list of the line items (in this case only one, "original donation amount"), and a list of shipping options available; in this case only one. process the payment the main payment processing code is found in the process() method, up next. let request; function process() { let options = {requestshipping: true}; ...
CSSPrimitiveValue.getFloatValue() - Web APIs
used to get a float value in a specified unit. if this css value doesn't contain a float value or can't be converted into the specified unit, a domexception is raised. syntax var floatvalue = cssprimitivevalue.getfloatvalue(unit); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant
description css_cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. css_dimension the value is a <number> with an unknown dimension. css_ems the value is a <length> in em units. css_exs the value is a <length> in ex units. css_grad the value is an <angle> in grads. cs...
...th> in picas. css_percentage the value is a <percentage>. css_pt the value is a <length> in points. css_px the value is a <length> in pixels. css_rad the value is an <angle> in radians. css_s the value is a <time> in seconds. return value a float value in the specified unit. exceptions type
description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the float value can't be converted into the specified unit. example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("margin-top"); console.log(cssvalue.getfloatvalue(cssprimitivevalue.css_cm)); specifications specification s...
CSSPrimitiveValue.setFloatValue() - Web APIs
a float value. if the property attached to this value can't accept the specified unit or the float value, the value will be unchanged and a domexception will be raised. syntax cssprimitivevalue.setfloatvalue(unittype, floatvalue); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant
description css_cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. css_dimension the value is a <number> with an unknown dimension. css_ems the value is a <length> in em units. css_exs the value is a <length> in ex units. css_grad the value is an <angle> in grads. cs...
... css_percentage the value is a <percentage>. css_pt the value is a <length> in points. css_px the value is a <length> in pixels. css_rad the value is an <angle> in radians. css_s the value is a <time> in seconds. floatvalue a float representing the new float value. return value void. exceptions type
description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the string value can't be converted into the specified unit. an no_modification_allowed_err is raised if this property is read-only. specifications specification status comment document object model (dom) level 2 style specificationthe definition of...
CSSPrimitiveValue.setStringValue() - Web APIs
vevalue interface is used to set a string value. if the property attached to this value can't accept the specified unit or the string value, the value will be unchanged and a domexception will be raised. syntax cssprimitivevalue.setstringvalue(stringtype, stringvalue); parameters stringtype an unsigned short representing the type of the value. ...
... an no_modification_allowed_err is raised if this property is read-only. ...
FileEntrySync - Web APIs
tersync createwriter () raises (fileexception); file file () raises (fileexception); methods createwriter() creates a new filewriter associated with the file that the fileentry represents. void createwriter ( ) raises (fileexception); parameter none. returns filewritersync exceptions this method can raise a fileexception with the following codes: exception
description not_found_err the file does not exist. invalid_state_err the file is no longer valid for some reason other than it having been deleted. file() returns a file that represents the current state of the file that this fileentry represents. void file ( ) raises (fileexception); parameter none. returns file exceptions this method can raise a fileexception w...
...st. invalid_state_err the file is no longer valid for some reason other than it having been deleted. file() returns a file that represents the current state of the file that this fileentry represents. void file ( ) raises (fileexception); parameter none. returns file exceptions this method can raise a fileexception with the following codes: exception
description not_found_err the file does not exist. invalid_state_err the file is no longer valid for some reason other than it having been deleted. browser compatibility the compatibility table on 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. des...
msAudioCategory - Web APIs
tegory specifies the purpose of the audio or video media, such as background audio or alerts. syntax <audio controls="controls" msaudiocategory="backgroundcapablemedia"> </audio> the msaudiocategory property offers a variety of values that can enhance the behavior of your audio-aware app. note that you must set the msaudiocategory before setting the src property in code. ...
...x <audio controls="controls" msaudiocategory="backgroundcapablemedia"> </audio> the msaudiocategory property offers a variety of values that can enhance the behavior of your audio-aware app. note that you must set the msaudiocategory before setting the src property in code. value include a
description of the property's value, including data type and what it represents. value
description background capable? alert looping or longer running alert sounds: alarms ring tones ringing notification sounds that need to attenuate existing audio no backgroundcapablemedia for audio that needs to continue playing in the background. examples include the following local media playback scenarios: local playlist st...
HTMLMediaElement.textTracks - Web APIs
ettrackbyid() method. each track is represented by a texttrack object which provides information about the track. ...
...ch track is represented by a texttrack object which provides information about the track. ...
HTMLTrackElement - Web APIs
ill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltrackelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltrackelement.kind is a domstring that reflects the kind html attribute, indicating how the text track is meant to be used. possible values are: subtitles, captions,
descriptions, chapters, or metadata. htmltrackelement.src is a domstring that reflects the src html attribute, indicating the address of the text track data. htmltrackelement.srclang is a domstring that reflects the srclang html attribute, indicating the language of the text track data. htmltrackelement.label is a domstring that reflects the label html attribute, indicating a user-readable title for th...
... indicating a user-readable title for the track. htmltrackelement.default a boolean reflecting the default attribute, indicating that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate. htmltrackelement.readystate read only returns an unsigned short that show the readiness state of the track: constant value
description none 0 indicates that the text track's cues have not been obtained. loading 1 indicates that the text track is loading and there have been no fatal errors encountered so far. further cues might still be added to the track by the parser. loaded 2 indicates that the text track has been loaded with no fatal errors. error 3 ...
IDBCursorSync - Web APIs
a cursor, but you can have an unlimited number of cursors at the same time. operations are performed on the underlying index or object store. it enables an application to synchronously process all the records in the cursor's range. method overview bool continue (in optional any key); void remove () raises (idbdatabaseexception); attributes attribute type
description count readonly unsigned long long the total number of objects that share the current key. direction readonly unsigned short the direction of traversal of the cursor. see constants for possible values. key readonly any the key for the record at the cursor's position. value any the value for the record at the cursor's position. se...
... if the underlying index or object store does not support updating the record because it is open in the read_only or snapshot_read mode, or if an index record cannot be changed because the underlying index is auto-populated. serial_err if the data being stored could not be serialized by the internal structured cloning algorithm. constants constant value
description next 0 this cursor includes duplicates, and its direction is monotonically increasing in the order of keys. next_no_duplicate 1 this cursor does not include duplicates, and its direction is monotonically increasing in the order of keys. prev 2 this cursor includes duplicates, and its direction is monotonically decreasing in the order of keys. ...
IDBDatabase.createObjectStore() - Web APIs
ax idbdatabase.createobjectstore(name); idbdatabase.createobjectstore(name, options); parameters name the name of the new object store to be created. note that it is possible to create an object store with an empty name. optionalparameters optional an options object whose attributes are optional parameters to the method. it includes the following properties: attribute
description keypath the key path to be used by the new object store. if empty or not specified, the object store is created without a key path and uses out-of-line keys. you can also pass in an array as a keypath. autoincrement if true, the object store has a key generator. defaults to false. unknown parameters are ignored. returns a new idbobjectstore. ...
...tore is created without a key path and uses out-of-line keys. you can also pass in an array as a keypath. autoincrement if true, the object store has a key generator. defaults to false. unknown parameters are ignored. returns a new idbobjectstore. exceptions this method may raise a domexception with a domerror of one of the following types: exception
description invalidstateerror occurs if the method was not called from a versionchange transaction callback. for older webkit browsers, you must call first. transactioninactiveerror occurs if a request is made on a source database that doesn't exist (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which w...
IDBFactorySync - Web APIs
with web workers, and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idbfactorysync interface of the indexeddb api provide a synchronous means of accessing the capabilities of indexed databases. method overview idbdatabasesync open (in domstring name, in domstring
description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database. blocks the calling thread until the connection object is ready to return. if there is already a database with the specified name, it uses that one; otherwise, it creates the database using the specified name and
description. idbdatabasesync open ( in domstri...
...difydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database. blocks the calling thread until the connection object is ready to return. if there is already a database with the specified name, it uses that one; otherwise, it creates the database using the specified name and
description. idbdatabasesync open ( in domstring name, in domstring
description ) raises (idbdatabaseexception); parameters name the name for the database.
description the
description for the database. returns idbdatabasesync an object to access the open database. exceptions this method can raise an idbdatabaseexception with the following codes: non_transient_err if the name parameter is not valid. a valid name is any string including the empty string. ...
IDBObjectStore.createIndex() - Web APIs
name the name of the index to create. note that it is possible to create an index with an empty name. keypath the key path for the index to use. note that it is possible to create an index with an empty keypath, and also to pass in a sequence (array) as a keypath. objectparameters optional an idbindexparameters object, which can include the following properties: attribute
description unique if true, the index will not allow duplicate values for a single key. multientry if true, the index will add an entry in the index for each array element when the keypath resolves to an array. if false, it will add one single entry containing the array. locale currently firefox-only (43+), this allows you to specify a locale for th...
...r pl. auto: the platform default locale will be used (may be changed by user agent settings.) null or undefined: if no locale is specified, normal javascript sorting will be used — not locale-aware. return value an idbindex object: the newly created index. exceptions this method may raise a domexception of one of the following types: exception
description constrainterror occurs if an index with the same name already exists in the database. index names are case-sensitive. invalidaccesserror occurs if the provided key path is a sequence, and multientry is set to true in the objectparameters object. invalidstateerror occurs if either: the method was not called from a versionchange transaction mo...
IDBObjectStoreSync - Web APIs
keypath readonly domstring the key path of this object store. if this attribute is set to null, then the application must provide a key for each modification operation. mode readonly unsigned short the mode for isolating access to the data in this object stor...
...object store. if this attribute is set to null, then the application must provide a key for each modification operation. mode readonly unsigned short the mode for isolating access to the data in this object store. for possible values, see constants. name readonly domstring the name of this object store. constants mode constants constant value
description read_only 1 modification operations are not allowed on this object store. read_write 0 modification operations are allowed on this object store. snapshot_read 2 any read operations must access a snapshot view of the data, which cannot change once it is created. methods add() stores the given value into this object store, optionally with th...
MSSiteModeEvent - Web APIs
not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. mssitemodeevent provides event properties that are specific to pinned site events. this proprietary method is specific to internet explorer and microsoft edge. dom information inheritance hierarchy event mssitemodeevent methods method
description initevent initializes a new generic event that the createevent method created. *note that as of microsoft edge, the createevent()/initevent() constructor pattern for synthetic events is deprecated. preventdefault cancels the default action of an event. stopimmediatepropagation prevents any further propagation of an event. stoppropagation prevent...
...d. *note that as of microsoft edge, the createevent()/initevent() constructor pattern for synthetic events is deprecated. preventdefault cancels the default action of an event. stopimmediatepropagation prevents any further propagation of an event. stoppropagation prevents propagation of an event beyond the current target. properties property
description actionurl gets the url of a jump list item that is removed. *this property is not supported for windows store apps using javascript. bubbles gets a value that indicates whether an event propagates up from the event target. buttonid gets the thumbnail toolbar button id that is clicked. *this property is not supported for windows store apps using javascript. ...
MimeType - Web APIs
mimetype.suffixes a string containing valid file extensions for the data displayed by the plugin, or an empty string if an extension is not valid for the particular module. ...
... mimetype.suffixes a string containing valid file extensions for the data displayed by the plugin, or an empty string if an extension is not valid for the particular module. ...
MouseScrollEvent - Web APIs
vertical_axis 0x02 the event is caused by vertical wheel operation. methods initmousescrollevent() see nsidommousescrollevent::initmousescrollevent()...
...n long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type
description axis read only long indicates scroll direction. constants delta modes constant value
description horizontal_axis 0x01 the event is caused by horizontal wheel operation. vertical_axis 0x02 the event is caused by vertical wheel operation. methods initmousescrollevent() see nsidommousescrollevent::initmousescrollevent(). ...
Node.nodeType - Web APIs
the read-only node.nodetype property is an integer that identifies what the node is. it distinguishes different kind of nodes from each other, such as elements, text and comments. syntax var type = node.nodetype; returns an integer which specifies the type of the node. possible values are listed in node type constants. constants node type constants constant value
description node.element_node 1 an element node like <p> or <div>. node.text_node 3 the actual text inside an element or attr. node.cdata_section_node 4 a cdatasection, such as <!cdata[[ … ]]>. node.processing_instruction_node 7 a processinginstruction of an xml document, such as <?xml-stylesheet … ?>. node.comment_node 8 a comment node,...
... comment node, such as <!-- … -->. node.document_node 9 a document node. node.document_type_node 10 a documenttype node, such as <!doctype html>. node.document_fragment_node 11 a documentfragment node. deprecated node type constants the following constants have been deprecated and should not be used anymore. constant value
description node.attribute_node 2 an attribute of an element. attributes no longer implement the node interface as of dom4. node.entity_reference_node 5 an xml entity reference node, such as &foo;. removed in dom4. node.entity_node 6 an xml <!entity …> node. removed in dom4. node.notation_node 12 an xml <!notation …> node. removed in dom4. ...
Pointer events - Web APIs
ement other than the normal hit test result of the pointer's location. pointer event a dom event fired for a pointer. interfaces the primary interface is the pointerevent interface which has a constructor plus several event types and associated global event handlers. the standard also includes some extensions to the element and navigator interfaces. the following sub-sections contain short
descriptions of each interface and property. pointerevent interface the pointerevent interface extends the mouseevent interface and has the following properties. (all of the following properties are read only .) pointerid a unique identifier for the pointer causing the event. width the width (magnitude on the x axis), in css pixels, of the contact geometry of the pointer. height the height (magnitu...
...o 359. pointertype indicates the device type that caused the event (mouse, pen, touch, etc.) isprimary indicates if the pointer represents the primary pointer of this pointer type. event types and global event handlers pointer events have ten event types, seven of which have similar semantics to their mouse event counterparts (down, up, move, over, out, enter, and leave). below is a short
description of each event type and its associated global event handler. event on event handler
description pointerover onpointerover fired when a pointer is moved into an element's hit test boundaries. pointerenter onpointerenter fired when a pointer is moved into the hit test boundaries of an element or one of its descendants, including as a result of a poin...
RTCIceTransport - Web APIs
objects, each describing one of the ice candidates that have been gathered so far for the local device. these are the same candidates which have already been sent to the remote peer by sending an icecandidate event to the rtcpeerconnection for transmission. getlocalparameters() returns a rtciceparameters object describing the ice parameters established by a call to the rtcpeerconnection.setlocal
description() method. returns null if parameters have not yet been received. getremotecandidates() returns an array of rtcicecandidate objects, one for each of the remote device's ice candidates that have been received by the local end of the rtcpeerconnection and delivered to ice by calling addicecandidate(). getremoteparameters() returns a rtciceparameters object containing the ice parameters for the r...
...ved. getremotecandidates() returns an array of rtcicecandidate objects, one for each of the remote device's ice candidates that have been received by the local end of the rtcpeerconnection and delivered to ice by calling addicecandidate(). getremoteparameters() returns a rtciceparameters object containing the ice parameters for the remote device, as set by a call to rtcpeerconnection.setremote
description(). if setremote
description() hasn't been called yet, the return value is null. getselectedcandidatepair() returns a rtcicecandidatepair object that identifies the two candidates—one for each end of the connection—that have been selected so far. it's possible that a better pair will be found and selected later; if you need to keep up with this, watch for the selectedcandidatepairchange event...
RTCOfferOptions.iceRestart - Web APIs
event. it watches for the ice connection state to transition to "failed", which indicates that an ice restart should be tried in order to attempt to bring the connection back up. ...
...after that, the offer is sent to the server by calling a custom function sendoffertoserver(). specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcofferoptions.icerestart' in that specification. ...
RTCPeerConnection.addTrack() - Web APIs
drawn from the code presented in the article signaling and video calling and its corresponding sample code. it comes from the handlevideooffermsg() method there, which is called when an offer message is received from the remote peer. ...
...in the article signaling and video calling and its corresponding sample code. it comes from the handlevideooffermsg() method there, which is called when an offer message is received from the remote peer. var mediaconstraints = { audio: true, // we want an audio track video: true // ...and we want a video track }; var desc = new rtcsession
description(sdp); pc.setremote
description(desc).then(function () { return navigator.mediadevices.getusermedia(mediaconstraints); }) .then(function(stream) { previewelement.srcobject = stream; stream.gettracks().foreach(track => pc.addtrack(track, stream)); }) this code takes sdp which has been received from the remote peer and constructs a new rtcsession
description to pass into setremote
description(). once that succeeds, it uses ...
RTCPeerConnection.onaddstream - Web APIs
the rtcpeerconnection.onaddstream event handler is a property containing the code to execute when the addstream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is added to this connection by the remote peer. the event is sent immediately after the call setremote
description() and doesn't wait for the result of the sdp negotiation. important: this property has been removed from the specification; you should now use rtcpeerconnection.ontrack to watch for track events instead. it is included here in order to help you adapt existing code and understand existing samples, which may not be up-to-date yet. syntax rtcpeerconnection.onaddstream = eventhandler; value a function which handles addstream events. these events, of type medias...
...ing samples, which may not be up-to-date yet. syntax rtcpeerconnection.onaddstream = eventhandler; value a function which handles addstream events. these events, of type mediastreamevent, are sent when streams are added to the connection by the remote peer. the first time an event occurs may be nearly immediately after the remote end of the connection is set using rtcpeerconnection.setremote
description(); it doesn't wait for a particular stream to be accepted or rejected using sdp negotiation. example this code, based on an older version of our signaling and video calling sample, responds to addstream events by setting the video source for a <video> element to the stream specified in the event, and then enabling a "hang up" button in the app's user interface. pc.onaddstream = function(event)...
RTCPeerConnection.onsignalingstatechange - Web APIs
the onsignalingstatechange event handler property of the rtcpeerconnection interface specifies a function to be called when the signalingstatechange event occurs on an rtcpeerconnection interface. the function receives as input the event object of type event; this event is sent when the peer connection's signalingstate changes, which may happen either because of a call to setlocal
description() or to setremote
description(). syntax rtcpeerconnection.onsignalingstatechange = errorhandler; value set this to a function which you provide that receives an event object as input; this contains the signalingstatechange event. this event object doesn't provide details about what changed, but you can examine the signalingstate property to determine what the new state is. you may also, as always, set up a ...
...tlistener("signalingstatechange", mysignalingstatechangehandler); or, using an anonymous (inline) handler: myrtcpeerconnection.addeventlistener("signalingstatechange", event => { /* handle the event here */ }); example this snippet shows a handler for signalingstatechange that looks for the "have-local-pranswer" signaling state—indicating that a remote offer has been received and a local
description of type "pranswer" has been applied in response. pc.onsignalingstatechange = function(event) { if (pc.signalingstate === "have-local-pranswer") { // setlocal
description() has been called with an answer } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onsignalingstatecha...
RTCPeerConnection.setConfiguration() - Web APIs
this is then passed into setconfiguration(). ice negotiation is restarted by calling createoffer(), specifying true as the value of the icerestart option. from there, we h...
...r to the other peer using the signaling server }) .catch(reporterror); first, a new rtcconfiguration is created, restartconfig, specifying the new ice server and its credentials. this is then passed into setconfiguration(). ice negotiation is restarted by calling createoffer(), specifying true as the value of the icerestart option. from there, we handle the process as usual, by setting the local
description to the returned offer and then sending that offer to the other peer. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'setconfiguration()' in that specification. candidate recommendation initial definition. ...
SVGFETurbulenceElement - Web APIs
it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_turbulence_type_fractalnoise 1 corresponds to the fractalnoise value. svg_turbulence_type_turbulence 2 corresponds to turbulence value. stitch options ...
...ce_type_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_turbulence_type_fractalnoise 1 corresponds to the fractalnoise value. svg_turbulence_type_turbulence 2 corresponds to turbulence value. stitch options name value
description svg_stitchtype_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_stitchtype_stitch 1 corresponds to the stitch value. svg_stitchtype_nostitch 2 corresponds to nostitch value. properties this interface also inherits properties...
SVGLengthList - Web APIs
exceptions: a domexception with code no_modif...
... readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type
description numberofitems unsigned long the number of items in the list. length unsigned long the number of items in the list. methods name & arguments return
description clear() void clears all existing current items from the list, with the result being an empty list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. initialize(in svglength newitem) svglength clears all existing current ...
SVGNumberList - Web APIs
exceptions: a domexception with code no_m...
...readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type
description numberofitems unsigned long the number of items in the list. length unsigned long the number of items in the list. methods name & arguments return
description clear() void clears all existing current items from the list, with the result being an empty list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. initialize(in svgnumber newitem) svgnumber clears all existing cu...
SVGPathSeg - Web APIs
it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. pathseg_closepath 1 corresponds to a "closepath" (z) path data command. ...
...uadratic_smooth_abs 18 corresponds to an "absolute smooth quadratic curveto" (t) path data command. pathseg_curveto_quadratic_smooth_rel 19 corresponds to a "relative smooth quadratic curveto" (t) path data command. properties name type
description pathsegtype unsigned short the type of the path segment as specified by one of the constants defined on this interface. pathsegtypeasletter domstring the type of the path segment as specified by the corresponding one character command name. metho...
SVGPreserveAspectRatio - Web APIs
it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_preserveaspectratio_none 1 corresponds to value none for attribute preserveaspectratio. svg_preserveaspectratio_xminymin 2 corre...
...ue that is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_meetorslice_meet 1 corresponds to value meet for attribute preserveaspectratio. svg_meetorslice_slice 2 corresponds to value slice for attribute preserveaspectratio. properties name type
description align unsigned short the type of the alignment value as specified by one of the svg_preserveaspectratio_* constants defined on this interface. meetorslice unsigned short the type of the meet-or-slice value as specified by one of the svg_meetorslice_* constants defined on this interface. exceptions on setting: a domexception with code no_modification_allowe...
SVGStringList - Web APIs
excepti...
...adonly unsigned long length normative document svg 1.1 (2nd edition) properties name type
description numberofitems unsigned long the number of items in the list. length unsigned long a mirror of the value in numberofitems, for consistency with other interfaces. methods name & arguments return
description clear() void clears all existing current items from the list, with the result being an empty list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. initialize(in domstring newitem) domstring clears all existing cu...
SVGStylable - Web APIs
tation attributes specified on them. ...
...adonly cssstyledeclaration style normative document svg 1.1 (2nd edition) properties name type
description classname svganimatedstring corresponds to attribute class on the given element. style cssstyledeclaration corresponds to attribute style on the given element. methods name & arguments return
description getpresentationattribute(in domstring name) cssvalue returns the base (i.e., static) value of a given presentation attribute as an object of type cssvalue. the returned object is live; changes to the objects represent immediate changes to the objects to which the cssvalue is attached. browser compatibility the compatibility table on this page is generated from structure...
SVGTextPathElement - Web APIs
it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. textpath_methodtype_align 1 corresponds to the value align. textpath_methodtype_stretch 2 corresponds to the value stretch. spacing types name valu...
... textpath_methodtype_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. textpath_methodtype_align 1 corresponds to the value align. textpath_methodtype_stretch 2 corresponds to the value stretch. spacing types name value
description textpath_spacingtype_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. textpath_spacingtype_auto 1 corresponds to the value auto. textpath_spacingtype_exact 2 corresponds to the value exact. properties this interface also inherit...
SVGTransformList - Web APIs
exceptions: a domexception with code no_m...
...readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type
description numberofitems unsigned long the number of items in the list. length unsigned long the number of items in the list. methods name & arguments return
description clear() void clears all existing current items from the list, with the result being an empty list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. initialize(in svgtransform newitem) svgtransform clears all exist...
ServiceWorkerContainer.register() - Web APIs
ation object. examples the examples described here should be taken together to get a better understanding of how service workers scope applies to a page. the following example uses the default value of scope (by omitting it). the service worker code in this case, if included in example.com/index.html, will control example.com/index.html, as well as pages underneath it, like example.com/product/
description.html. if ('serviceworker' in navigator) { // register a service worker hosted at the root of the // site using the default scope. navigator.serviceworker.register('/sw.js').then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(error) { console.log('service worker registration failed:', error); }); } else { con...
...worker registration failed:', error); }); } else { console.log('service workers are not supported.'); } the following code, if included in example.com/index.html, at the root of a site, would apply to exactly the same pages as the example above. remember the scope, when included, uses the page's location as its base. alternatively, if this code were included in a page at example.com/product/
description.html, with the javascript file residing at example.com/product/sw.js, then the service worker would only apply to resources under example.com/product. if ('serviceworker' in navigator) { // declaring scope manually navigator.serviceworker.register('/sw.js', {scope: './'}).then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ fun...
WebGLRenderingContext.disable() - Web APIs
see webglrenderingcontext.blendfunc(). gl.cull_face deactivates culling of polygons. see webglrenderingcontext.cullface(). ...
...issor_test deactivates the scissor test that discards fragments that are outside of the scissor rectangle. see webglrenderingcontext.scissor(). gl.stencil_test deactivates stencil testing and updates to the stencil buffer. see webglrenderingcontext.stencilfunc(). when using a webgl 2 context, the following values are available additionally: constant
description gl.rasterizer_discard deactivates that primitives are discarded immediately before the rasterization stage, but after the optional transform feedback stage. gl.clear() commands are ignored. return value none. examples gl.disable(gl.dither); to check if a capability is disabled, use the webglrenderingcontext.isenabled() method: gl.isenabled(gl.dither); // f...
WebGLRenderingContext.enable() - Web APIs
see webglrenderingcontext.blendfunc(). gl.cull_face activates culling of polygons. see webglrenderingcontext.cullface(). ...
...l.scissor_test activates the scissor test that discards fragments that are outside of the scissor rectangle. see webglrenderingcontext.scissor(). gl.stencil_test activates stencil testing and updates to the stencil buffer. see webglrenderingcontext.stencilfunc(). when using a webgl 2 context, the following values are available additionally: constant
description gl.rasterizer_discard primitives are discarded immediately before the rasterization stage, but after the optional transform feedback stage. gl.clear() commands are ignored. return value none. examples gl.enable(gl.dither); to check if a capability is enabled, use the webglrenderingcontext.isenabled() method: gl.isenabled(gl.dither); // true specification...
WebGLRenderingContext.isEnabled() - Web APIs
the webglrenderingcontext.isenabled() method of the webgl api tests whether a specific webgl capability is enabled or not for this context. by default, all capabilities except gl.dither are disabled. syntax glboolean gl.isenabled(cap); parameters cap a glenum specifying which webgl capability to test. possible values: constant
description gl.blend blending of the computed fragment color values. see webglrenderingcontext.blendfunc(). gl.cull_face culling of polygons. see webglrenderingcontext.cullface(). gl.depth_test depth comparisons and updates to the depth buffer. see webglrenderingcontext.depthfunc(). gl.dither dithering of color components before they get written to the color buffer. gl...
...overage(). gl.scissor_test scissor test that discards fragments that are outside of the scissor rectangle. see webglrenderingcontext.scissor(). gl.stencil_test stencil testing and updates to the stencil buffer. see webglrenderingcontext.stencilfunc(). when using a webgl 2 context, the following values are available additionally: constant
description gl.rasterizer_discard primitives are discarded immediately before the rasterization stage, but after the optional transform feedback stage. gl.clear() commands are ignored. return value a glboolean indicating if the capability cap is enabled (true), or not (false). examples gl.isenabled(gl.stencil_test); // false to activate or deactivate a specific capabil...
WebGLRenderingContext.pixelStorei() - Web APIs
pixelstorei() method of the webgl api specifies the pixel storage modes. syntax void gl.pixelstorei(pname, param); parameters pname a glenum specifying which parameter to set. see below for possible values. param a glint specifying a value to set the pname parameter to. see below for possible values. return value none. pixel storage parameters parameter name (for pname)
description type default value allowed values (for param) specified in gl.pack_alignment packing of pixel data into memory glint 4 1, 2, 4, 8 opengl es 2.0 gl.unpack_alignment unpacking of pixel data from memory. glint 4 1, 2, 4, 8 opengl es 2.0 gl.unpack_flip_y_webgl flips the source data along its vertical axis if true. glboolea...
...es the alpha channel into the other color channels glboolean false true, false webgl gl.unpack_colorspace_conversion_webgl default color space conversion or no color space conversion. glenum gl.browser_default_webgl gl.browser_default_webgl, gl.none webgl when using a webgl 2 context, the following values are available additionally: constant
description type default value allowed values (for param) specified in gl.pack_row_length number of pixels in a row. glint 0 0 to infinity opengl es 3.0 gl.pack_skip_pixels number of pixel locations skipped before the first pixel is written into memory. glint 0 0 to infinity opengl es 3.0 gl.pack_skip_rows number of rows of pixel loc...
WebGL types - Web APIs
see also the list of constants. glboolean boolean a boolean. glbitfield unsigned long a bit field that stores multiple, logical bits. used for example in webglrenderingcontext.clear(). glbyte byte 8-bit twos complement signed integer. glshort short 16-bit twos complement signed integer. glint long 32-bit twos complement signed integer. ...
...t unsigned integer. gluint unsigned long 32-bit twos complement unsigned integer. glfloat unrestricted float 32-bit ieee floating point number. glclampf unrestricted float clamped 32-bit ieee floating point number. webgl 2 these types are used within a webgl2renderingcontext. all webgl 1 types are used as well. type web idl type
description glint64 long long signed 64-bit integer number. webgl extensions these types are used within webgl extensions. type web idl type
description gluint64ext long long unsigned 64-bit integer number. specifications specification status comment webgl 1.0the definition of 'types' in that specification. recommendatio...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
re. one possibility is to have a hidden <audio> element and use htmlaudioelement.capturestream() to get its audio stream. remote peer on the remote peer, when we receive an sdp offer with the directionality set to "sendonly", we handle it using the holdrequested() method, which accepts as input an sdp offer string. async function holdrequested(offer) { try { await peerconnection.setremote
description(offer); await audiotransceiver.sender.replacetrack(null); audiotransceiver.direction = "recvonly"; await sendanswer(); } catch(err) { /* handle the error */ } } the steps taken here are: set the remote
description to the specified offer by calling rtcpeerconnection.setremote
description(). replace the audio transceiver's rtcrtpsender's track with null, meaning no track. t...
...urn to both sending and receiving streamed audio, instead of only sending. just like when hold was engaged, this triggers negotiation again, resulting in your code sending a new offer to the remote peer. remote peer when the "sendrecv" offer is received by the remote peer, it calls its holdended() method: async function holdended(offer, micstream) { try { await peerconnection.setremote
description(offer); await audiotransceiver.sender.replacetrack(micstream.getaudiotracks()[0]); audiotransceiver.direction = "sendrecv"; await sendanswer(); } catch(err) { /* handle the error */ } } the steps taken inside the try block here are: the received offer is stored as the remote
description by calling setremote
description(). the audio transceiver's rtcrtpsender's replacetrac...
Web Video Text Tracks Format (WebVTT) - Web APIs
uid nitrogen. 00:05.000 --> 00:09.000 - it will perforate your stomach. - you could die. webvtt body the structure of a webvtt consists of the following components, some of them optional, in this order: an optional byte order mark (bom). the string "webvtt". an optional text header to the right of webvtt. there must be at least one space after webvtt. you could use this to add a
description to the file. you may use anything in the text header except newlines or the string "-->". a blank line, which is equivalent to two consecutive newlines. zero or more cues or comments. zero or more blank lines. example 1 - simplest possible webvtt file webvtt example 2 - very simple webvtt file with a text header webvtt - this file has no cues. example 3 - common webvtt example ...
... getcueashtml to get the html of that cue. vtt constructor for creating new objects of cues. autokeyword. directionsetting: to set the direction of caption or text in a file. linealignment: to adjust the line alignment. positionalignsetting: to adjust the position of text. vttregion the methods used for region are listed below along with
description of their functionality: scrollsetting: for adjusting the scrolling setting of all nodes present in given region. vtt region constructor: for construction of new vtt regions. tutorial on how to write a webvtt file there are few steps that can be followed to write a simple webvtt file. before start, it must be noted that you can make use of a notepad and then save th...
Inputs and input sources - Web APIs
ording to the selectcomponentid property, the xr-standard-trigger component is the one used to perform a primary action. additionally, the gamepad object maps those inputs to the gamepad, assigning the trigger, squeeze, and touchpad tap to the input source's button list and the touchpad's "axes" to the axis list. the list in profiles is in order of reverse specificity; that is, the most precise
description is first, and the least precise
description is last. the first entry in the list is typically indicative of the precise model of the controller, or of a model with which the controller is compatible. for example, entry 0 in profiles for an oculus touch controller is oculus-touch. the next entry is generic-trigger-squeeze-thumbstick, indicating a generic device with a trigger, a squeeze control, ...
...recise model of the controller, or of a model with which the controller is compatible. for example, entry 0 in profiles for an oculus touch controller is oculus-touch. the next entry is generic-trigger-squeeze-thumbstick, indicating a generic device with a trigger, a squeeze control, and a thumbstick. while the oculus touch controller actually has a thumbpad rather than a thumbstick, the overall
description is "close enough" that the details within the profile matching the name will let the controller be interpreted usefully. actions in webxr, an action is a special type of event that's triggered by the user activating a special button on the controller. any additional buttons (as well as things like axis controllers—joysticks, for example—and the like) are managed solely through the xrinputso...
Window.sidebar - Web APIs
returns a sidebar object which contains several methods for registering add-ons with the browser. methods the sidebar object returned has the following methods: method
description (seamonkey)
description (firefox) addpanel(title, contenturl, "") adds a sidebar panel. obsolete since firefox 23 (only present in seamonkey). end users can use the "load this bookmark in the sidebar" option instead. also see creating a firefox sidebar. addpersistentpanel(title, contenturl, "") adds a sidebar panel, which is able to work in the background. addsearchprovider(
descriptionurl) dummy function; does nothing. see autodiscovery of search plugins. addsearchengine(engineurl, iconurl, suggestedtitle, suggestedcategory) obsolete since geck...
... does nothing. see autodiscovery of search plugins. addsearchengine(engineurl, iconurl, suggestedtitle, suggestedcategory) obsolete since gecko 44 installs a search engine (sherlock). adding sherlock search engines contains more details. note: this was made obsolete in firefox 44, and has been removed completely in firefox 59. issearchproviderinstalled(
descriptionurl) indicates if a specific search provider (opensearch) is installed. specification mozilla-specific. not part of any standard. ...
Using XMLHttpRequest - Web APIs
nput type="file" multiple name="photos[]"> </p> <p> <input id="vehicle_bike" type="checkbox" name="vehicle[]" value="bike" /> <label for="vehicle_bike">i have a bike</label><br /> <input id="vehicle_car" type="checkbox" name="vehicle[]" value="car" /> <label for="vehicle_car">i have a car</label> </p> <p> describe yourself:<br /> <textarea name="
description" cols="50" rows="8"></textarea> </p> <p> <input type="submit" value="submit" /> </p> </fieldset> </form> </body> </html> to test this, create a page named register.php (which is the action attribute of these sample forms), and put the following minimalistic content: <?php /* register.php */ header("content-type: text/plain"); /* note: you should never use `print_r()` in ...
...if you want to stringify a submitted data, use the previous pure-ajax example. note also that, although in this example there are some file <input> fields, when you submit a form through the...
Using the group role - Accessibility
the group role is used to identify a set of user interface objects which, in contrast with a region, are not intended to be included in a table of contents or a page summary (such as the structures that are dynamically created by a script or assistive technologies); a group should not be considered a major perceivable section on a page. when the role is added to an element, the browser will send out an accessible group event to assistive technology products which can then notify the user about it. ...
...nt as having a group role in the operating system's accessibility api. fire an accessible group event using the operating system's accessibility api if it supports it. assistive technology products should listen for such an event and notify the user accordingly: screen readers should announce the group when focus first lands on a control inside it, and if aria-describedby has been set, the
description may be spoken. following this the focused control may be announced. screen magnifiers may enlarge the group. note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: using the group role with a html tree view the snippet below shows how the group role is added d...
ARIA: timer role - Accessibility
the timer role indicates to assistive technologies that an element is a numerical counter listing the amount of elapsed time from a starting point or the remaining time until an end point. <div role="timer" id="eggtimer">0</div> this defines this div element as a timer with no remaining time.
description the timer role indicates to assistive technologies that this part of the web content is a live region containing a timer listing the time remaining or elapsed time. a timer's inner text should be an updating current time measurement. while the value does not necessarily need to be machine parsable, it should continuously update at regular intervals unless the timer is paused or reaches its end-point. associated wai-aria roles, states, and properties aria-label used to provide the name of...
...intervals unless the timer is paused or reaches its end-point. associated wai-aria roles, states, and properties aria-label used to provide the name of the timer. aria-live elements with the role timer have an implicit aria-live value of off. aria-describedby used to indicate the idref of an element that contains additional instructions for navigating or operating this element. aria-role
description used to give the timer a more descriptive role text for screen readers to speak. this should be localized. keyboard interactions keyboard interaction is xxx. focus is being managed via xxx. the tab , space and enter keys, as well as escape , must be handled by the application. the one exception is if focus xxx. required javascript features keypress used to handle keyboard input and cont...
ARIA: application role - Accessibility
that an element and all of its children should be treated similar to a desktop application, and no traditional html interpretation techniques should be used. this role should only be used to define very dynamic and desktop-like web applications. <div role="application">...</div> this defines this div element and all of its descendants to be treated like they are part of a desktop application.
description the application role indicates to assistive technologies that this part of the web content contains elements that do not conform to any other known html element or wai-aria widget. any sort of special interpretation of html structures and widgets should be suspended, and control should be completely handed over to the browser and web application to handle mouse, keyboard, or touch interaction. ...
...icate parts of the application that should be treated as normal web content aria-activedescendant used to manage focus inside the application. aria-label used to provide the name of the application or purpose of the widget that is being exposed. aria-describedby used to indicate the idref of an element that contains additional instructions for navigating or operating this element. aria-role
description used to give the application a more descriptive role text for screen readers to speak. this should be localized. keyboard interactions keyboard interaction is completely under the web author's control and can be anything associated with the particular widget being implemented. in a slides application, for example, a widget could be created that uses the arrow keys to position elements on the ...
ARIA: Complementary role - Accessibility
ark role is used to designate a supporting section that relates to the main content, yet can stand alone when separated. these sections are frequently presented as sidebars or call-out boxes. if possible, use the html <aside> element instead. <div role="complementary"> <h2>our partners</h2> <!-- complementary section content --> </div> this is a sidebar containing links to event sponsors.
description the complementary role is a landmark role. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. content listed within a container with the complementary landmark role should make sense if separated from the main content of the document. using the <aside> element will automatically communicate a section has a role of complementary. de...
...he aria-label attribute, or, if the aside has an appropriately descriptive title, point to it with the aria-labelledby attribute. this label will allow an assistive technology user to be able to quickly understand the purpose of each landmark. <aside aria-label="note about usage"> <!-- content --> </aside> ... <aside id="sidebar" aria-label="sponsors"> <!-- content --> </aside> redundant
descriptions screen readers will announce the type of role the landmark is. because of this, you do not need to describe what the landmark is in its label. for example, a declaration of role="complementary" with an of aria-label="sidebar" may be announced redundantly as, "complementary sidebar". added benefits certain technologies such as browser extensions can generate lists of all landmark roles present...
ARIA: contentinfo role - Accessibility
information repeated at the end of every page of a website, including copyright information, navigation links, and privacy statements. this section is commonly called a footer. <div role="contentinfo"> <h2>footer</h2> <!-- footer content --> </div> this is a website footer. using the <footer> element instead is recommended: <footer> <h2>footer</h2> <!-- footer content --> </footer>
description the contentinfo role is a landmark used to identify a page footer. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. pages should only include one top-level contentinfo landmark role per page. each page should only include one contentinfo landmark, created by either using the <footer> element or by declaring role="contentinfo". con...
...erstand the purpose of each landmark. <body> ... <article> <h2>everyday pad thai</h2> <!-- article content --> <footer aria-label="everyday pad thai metadata"> <p>posted on <time datetime="2018-09-23 12:17">may 16</time> by <a href="#">lisa</a>.</p> </footer> </article> ... <footer aria-label="footer"> <!-- footer content --> </footer> </body> redundant
descriptions screen readers will announce the type of role the landmark is. because of this, you do not need to describe what the landmark is in its label. for example, a declaration of role="contentinfo" with an of aria-label="footer" may be announced redundantly as, "contentinfo footer". best practices prefer html when it is an immediate descendant of the <body> element, using the <footer> element will...
ARIA: feed role - Accessibility
cursor to both read and scroll through a stream of rich content that may continue scrolling infinitely by loading more content as the user reads. <section role="feed" aria-busy="false"> ... <article aria-posinset="427" aria-setsize="-1">...</article> <article aria-posinset="428" aria-setsize="-1">...</article> <article aria-posinset="429" aria-setsize="-1">...</article> ... </section>
description a feed is a page structure for a scrollable list of articles where scrolling may cause articles to be added to the top or end of the list. the list establishes an interoperability contract between the web page and assistive technologies that governs scroll interactions so that assistive technology users can read articles, jump forward and backward by article, and reliably trigger new articles t...
...board interactions below. if the number of articles is known, set aria-setsize on the articles themselves. however, if the total number is extremely large, indefinite, or changes often, set aria-setsize="-1" to indicate that the size of the feed is not known. another feature of the feed pattern is skim reading: articles within a feed can contain both an accessible name with the aria-label and a
description with an aria-describedby, suggesting to screen readers which elements to speak after the label when navigating by article. by identifying the elements inside of an article that provide the title and the primary content, assistive technologies can provide functions that enable users to jump from article to article and efficiently discern which articles they want to read. the feed pattern enables ...
ARIA: form role - Accessibility
v role="form" id="contact-info" aria-label="contact information"> <!-- form content --> </div> this is a form that collects and saves a user's contact information. important: use an html <form> element to contain your form controls, rather than the aria form role, unless you have a very good reason. the html <form> element is sufficient to tell assistive technologies that there is a form.
description a form landmark identifies a region of content that contains a collection of items and objects that, as a whole, combine to create a form when no other named landmark is appropriate (e.g. main or search). using the <form> element will automatically communicate a section of content as a form landmark, if it is provided an accessible name. developers should always prefer using the correct s...
...en an accessible name. this name will allow an assitive technology user to be able to quickly understand the purpose of the form landmark. use an aria-labelledby, aria-label or title on the same element that was given the role="form" to provide it an accessible name. using role="form" <div role="form" id="gift-cards" aria-label="purchase a gift card"> <!-- form content --> </div> redundant
descriptions screen readers will announce the type of role the landmark is. because of this, you do not need to describe what the landmark is in its label. for example, a declaration of role="form" with an of aria-label="contact form" may be announced redundantly as, "contact form form". best practices prefer html using the <form> element will automatically communicate a section has a role of form. if at...
ARIA: search role - Accessibility
landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. the search role is added to the container element that encompasses the items and objects that, as a whole, combine to create search functionality. when a <form> is a search form, use the search role instead of form. if a document includes more than one search, each should have a unique label. ...
...ent, use the same label for each landmark. an example of this would be repeating the sitewide search at the top and bottom of the page. <header> <form id="site-search-top" role="search" aria-label="sitewide"> <!-- search input --> </form> </header> ... <footer> <form id="site-search-bottom" role="search" aria-label="sitewide"> <!-- search input --> </form> </footer> redundant
descriptions screen readers will announce the type of role the landmark is. because of this, you do not need to describe what the landmark is in its label. for example, a declaration of role="search" with an of aria-label="sitewide search" may be announced redundantly as, "sitewide search search". added benefits certain technologies such as browser extensions can generate lists of all landmark roles prese...
ARIA: table role - Accessibility
the cells are not focusable or selectable, though widgets within individual cells of the table can be interactive. using a native html table element whenever possible is strongly encouraged. if a table maintains a selection state, has two-dimensional navigation, or allows the user to rearrange cell order use...
...i-aria roles, states, and properties role="rowgroup" an optional child of the table, the row group encapsulates a group of rows, similar to thead, tbody, and tfoot. role="row" a row within the table, and optionally within a rowgroup, that is a container for one or more cells, columnheaders, or rowheaders. aria-describedby attribute takes as its value the id of the element that serves as a
description for the table. aria-label attribute the aria-label provides an accessible name for the table. aria-colcount attribute this attribute is only required if the columns are not present in the dom all the time. it provides an explicit indication of the number of columns in the full table. set the value to the total number of columns in the full table. if unknown, set aria-colcount="-1". aria-...
ARIA: button role - Accessibility
...
...y to add a key event handler that listens for the space key in order to be consistent with native buttons. when the button role is used, screen readers announce the element as a button, generally saying "click" followed by the button's accessible name. the accessible name is either the content of the element or the value of an aria-label or element referenced by an aria-labelledby attribute, or
description, if included. best practices if a link performs the action of a button, giving the element role="button" helps assistive technology users understand the function of the element. however, a better solution is to adjust the visual design so it matches the function and aria role. where possible, it is recommended to use native html buttons (<button>, <input type="button">, <input type="submit">,...
ARIA: listbox role - Accessibility
unlike <select>, a listbox can contain images. each child of a listbox should have a role of option. ...
...then aria-labelledby should be used instead to refer to that label. aria-labelledby identifies the visible element or elements in a space-separated list of element ids which identify the listbox. if there's no visible label, then aria-label should be used instead to include a label. (note: "labelled", with two l's, is the correct spelling based on the accessibility api conventions.) aria-role
description a human-readable string value which more clearly identifies the role of the listbox. screen readers will often read this value to the user after reading the label (if there is one), in place of saying "listbox". (for further details and a full list of aria states and properties see the aria listbox (role) documentation.) keyboard interactions when a single-select listbox receives focus: ...
ARIA: textbox role - Accessibility
the textbox role is used to identify an element that allows the input of free-form text. whenever possible, rather than using this role, use an <input> element with type="text", for single-line input, or a <textarea> element for multi-line input.
description when an element has the textbox role, the browser sends an accessible textbox event to assistive technologies, which can then notify the user about it. the default is a single line input, in which return or enter submits the form; in this case, it is preferable to use an html <input> with type="text". to create a multi-line text box which supports line breaks, as in an html <textarea>, set aria-multiline="true". including the html contenteditable attribute ensures the text node is editable. <!-- simple text input field --> <div id="txtboxlab...
...; rather this feature must be controlled by the developer. if false is set, or the the attribute is omitted and defaults to false, the user expectation is that the control is a single line text box, and enter or return submits the form. aria-placeholder attribute represents a hint (word or phrase) to the user about what to enter into the text field. the hint should be a sample value or a brief
description of the expected format.this information should not be used as a substitute for a label: a label is focusable, permanent, indicates what kind of information is expected, and increases the hit area for setting focus on the control, whereas placeholder text is only temporary hint about the expected value, which if implemented incorrectly can decrease accessibility. the placeholder should be visible ...
Basic form hints - Accessibility
role="presentation" src="radio-unchecked.gif" /> thai </li> <li id="r2" tabindex="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> subway </li> <li id="r3" tabindex="0" role="radio" aria-checked="true"> <img role="presentation" src="radio-checked.gif" /> radio maria </li> </ul> describing with aria form controls sometimes have a
description associated with them, in addition to the label. aria provides the aria-describedby attribute to directly associate the
description with the control. the example below shows a <button> element that is described by a sentence in a separate <div> element. the aria-describedby attribute on the <button> references the id of the <div>. <button aria-describedby="
descriptionrevert">revert</button> <div...
...ciated with them, in addition to the label. aria provides the aria-describedby attribute to directly associate the
description with the control. the example below shows a <button> element that is described by a sentence in a separate <div> element. the aria-describedby attribute on the <button> references the id of the <div>. <button aria-describedby="
descriptionrevert">revert</button> <div id="
descriptionrevert">reverting will undo any changes that have been made since the last save.</div> note: the aria-describedby attribute is used for other purposes, in addition to form controls. required and invalid fields note: now that required is available to more than 97% of users globally, it is no longer recommended that you use both required and aria-required. web dev...
Cognitive accessibility - Accessibility
this is preserving data for more than 20 hours when no actions are taken. navigation guideline 2.4 states "provide ways to help users navigate, find content, and determine where they are," and provides 10 guidelines to ensure the site is navigable and content is findable: include a <title> make sure to include a <title> for the document, as titles provide a quick and easy to reference
description of the screen's main point. people with cognitive disabilities, limited short-term memory, and reading disabilities all benefit from being able to identify the purpose of content this way. heading and labels include clear and descriptive headings so users can easily find information and understand relationships between different content sections. descriptive labels help users identify sp...
...d error detection users need to be alerted to the error and informed of what is wrong. if there is client side error detection, observe the following guidelines to make the error as effective as possible when conveyed to the user: the error must be described in the text. ensure that the error message is as specific as possible. provide text to identify incomplete required fields and text
descriptions if a value entered is invalid. if the error prevented a form submission, focus on the error. if multiple errors are present, provide a summary, with each error linking to the related input. include text along with use of icons, images, color and so on. some people have difficulty understanding the meaning of icons and other visual cues. other people may have difficulty understanding the text...
animation - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function syntax the ...
...'animationstart', function () { togglebutton(button[index], 'pause'); }); node.addeventlistener('animationend', function () { togglebutton(button[index], 'restart'); }); }); button.foreach(function (btn, index) { btn.addeventlistener('click', function () { playpause(index); }); }); }) a
description of which properties are animatable is available; it's worth noting that this
description is also valid for css transitions. constituent properties this property is a shorthand for the following css properties: animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function syntax the animation property is specified as one or more single animations, separated by commas. e...
<color> - CSS: Cascading Style Sheets
e examples all specify the same color: a lavender. */ hsl(270,60%,70%) hsl(270, 60%, 70%) hsl(270 60% 70%) hsl(270deg, 60%, 70%) hsl(4.71239rad, 60%, 70%) hsl(.75turn, 60%, 70%) /* these examples all specify the same color: a lavender that is 15% opaque. ...
... hsl(150, 100%, 50%) blue-green hsl(180, 100%, 50%) cyan hsl(210, 100%, 50%) sky blue hsl(240, 100%, 50%) blue hsl(270, 100%, 50%) purple hsl(300, 100%, 50%) magenta hsl(330, 100%, 50%) pink hsl(360, 100%, 50%) red lighter and darker greens notation
description live hsl(120, 100%, 0%) black hsl(120, 100%, 20%) hsl(120, 100%, 40%) hsl(120, 100%, 60%) hsl(120, 100%, 80%) hsl(120, 100%, 100%) white saturated and desaturated greens notation
description live hsl(120, 100%, 50%) green hsl(120, 80%, 50%)...
radial-gradient() - CSS: Cascading Style Sheets
origin. if unspecified, it defaults to center. <shape> the gradient's shape. the value can be circle (meaning that the gradient's shape is a circle with constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). if unspecified, it defaults to ellipse. <extent-keyword> a keyword describing how big the ending shape must be. the possible values are: keyword
description closest-side the gradient's ending shape meets the side of the box closest to its center (for circles) or meets both the vertical and horizontal sides closest to the center (for ellipses). closest-corner the gradient's ending shape is sized so that it exactly meets the closest corner of the box from its center. farthest-side similar to closest...
... two color stops with the same color at the two positions. <color-hint> th color-hint is an interpolation hint defining how the gradient progresses between adjacent color stops. the length defines at which point between two color stops the gradient color should reach the midpoint of the color transition. if omitted, the midpoint of the color transition is the midpoint between two color stops.
description as with any gradient, a radial gradient has no intrinsic dimensions; i.e., it has no natural or preferred size, nor a preferred ratio. its concrete size will match the size of the element it applies to. to create a radial gradient that repeats so as to fill its container, use the repeating-radial-gradient() function instead. because <gradient>s belong to the <image> data type, they can only be...
Constraint validation - Developer guides
e <input> element, e.g., choosing the email type automatically creates a constraint that checks whether the value is a valid e-mail address. by setting values on validation-related attributes, allowing basic constraints to be described in a simple way, without the need for javascript. semantic input types the intrinsic constraints for the type attribute are: input type constraint
description associated violation <input type="url"> the value must be an absolute url, as defined in the url living standard. typemismatch constraint violation <input type="email"> the value must be a syntactically valid email address, which generally has the format username@hostname.tld. typemismatch constraint violation for both of these input types, if the multi...
...trinsic constraints, as some are simply barred from constraint validation or have a sanitization algorithm transforming incorrect values to a correct default. validation-related attributes in addition to the type attribute described above, the following attributes are used to describe basic constraints: attribute input types supporting the attribute possible values constraint
description associated violation pattern text, search, url, tel, email, password a javascript regular expression (compiled with the ecmascript 5 global, ignorecase, and multiline flags disabled) the value must match the pattern. patternmismatch constraint violation min range, number a valid number the value must be greater than or equal to the value. rangeunde...
The Unicode Bidirectional Text Algorithm - Developer guides
ers that make it possible to control directionality of ranges of text. there are two sets of control characters; one set opens the override, and another restores the original directionality. you must always follow each opening character with an appropriate closing character. ...
...bidi algorithm, displaying the characters in memory order, from left to right right-to-left override (rlo) u+202e ‮ <bdo dir="rtl"> overrides the bidi algorithm and displays the embedded characters in reverse memory order, from right to left closing unicode bidi algorithm control characters character code point html entity markup equivalent
description pop directional formatting (pdf) u+202c ‬ closing whatever opening tag used the dir attribute used for rle or lre </bdo> used for rlo or lro pop directional isolate (pdi) u+2069 ⁩ closing whatever opening tag used the dir attribute used for rli, lri, or fsi ...
HTML attribute: rel - HTML: Hypertext Markup Language
is found. the type of relationships is given by the value of the rel attribute, which, if present, must have a value that is an unordered set of unique space-separated keywords, which are listed in the following table. every keyword within a space seperated value should be unique within that value. values for the rel attribute, and the elements for which each is relevant rel value
description <link> <a> and <area> <form> alternate alternate representations of the current document. link link not allowed author author of the current document or article. link link not allowed bookmark permalink for the nearest ancestor section. not allowed link not allowed canonical preferred url for the current docum...
...ous is incorrect and should not be used. search relevant to <form>, <link>, <a>, and <area> elements, the search keywords indicates that the hyperlink references a document whose interface is specially designed for searching in the current document, site, and related resources, providing a link to a resource that can be used to search. if the type attribute is set to application/opensearch
description+xml the resource is an opensearch plugin that can be easily added to the interface of some browsers like firefox or internet explorer. stylesheet valid for the <link> element, it imports an external resource to be used as a stylesheet. the type attribute is not needed as it's a text/css stylesheet, as that is the default value. if it's not a stylesheet of type text/css it is best to declare...
<input type="date"> - HTML: Hypertext Markup Language
ole.log(datecontrol.valueasnumber); // prints 1496275200000, a unix timestamp this code finds the first <input> element whose type is date, and sets its value to 2017-06-01 (june 1st, 2017). it then reads that value back in string and number formats. additional attributes along with the attributes common to all <input> elements, date inputs have the following attributes: attribute
description max the latest acceptable date min the earliest acceptable date step the stepping interval, when clicking up and down spinner buttons and validating the date max the latest date to accept. if the value entered into the element occurs afterward, the element fails constraint validation. if the value of the max attribute isn't a possible date string in...
...queryselector('#year'); var monthselect = document.queryselector('#month'); var dayselect = document.queryselector('#day'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'date'; } catch (e) { console.log(e.
description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.style.display = 'none'; fallbackpicker.style.display = 'block'; fallbacklabel.style.display = 'block'; // populate the days and years dynamically // (the months are always the same, therefore hardcoded) populatedays(monthselect.value); ...
<input type="datetime-local"> - HTML: Hypertext Markup Language
are several methods provided by javascript's date that can be used to convert numeric date information into a properly-formatted string, or you can do it manually. for example, the date.toisostring() method can be used for this purpose. additional attributes in addition to the attributes common to all <input> elements, datetime-local inputs offer the following attributes: attribute
description max the latest date and time to accept min the earliest date and time to accept step the stepping interval to use for this input, such as when clicking arrows on spinner controls or performing validation max the latest date and time to accept. if the value entered into the element is later than this timestamp, the element fails constraint validation...
...var hourselect = document.queryselector('#hour'); var minuteselect = document.queryselector('#minute'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'none'; // test whether a new datetime-local input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'datetime-local'; } catch (e) { console.log(e.
description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.style.display = 'none'; fallbackpicker.style.display = 'block'; fallbacklabel.style.display = 'block'; // populate the days and years dynamically // (the months are always the same, therefore hardcoded) populatedays(monthselect.value); ...
<input type="file"> - HTML: Hypertext Markup Language
s the other files through the input's files property. if no file is yet selected, the string is "" (empty). the string is prefixed with c:\fakepath\, to prevent malicious software from guessing the user's file structure. ...
...attribute is specified, the file input allows the user to select more than one file. non-standard attributes in addition to the attributes listed above, the following non-standard attributes are available on some browsers. you should try to avoid using them when possible, since doing so will limit the ability of your code to function in browsers that don't implement them. attribute
description webkitdirectory a boolean indicating whether or not to only allow the user to choose a directory (or directories, if multiple is also present) webkitdirectory the boolean webkitdirectory attribute, if present, indicates that only directories should be available to be selected by the user in the file picker interface. see htmlinputelement.webkitdirectory for additional d...
<input type="image"> - HTML: Hypertext Markup Language
, formnovalidate, formtarget idl attributes none. methods none. value <input type="image"> elements do not accept value attributes. the path to the image to be displayed is specified in the src attribute. ...
...isplay to represent the graphical submit button. when the user interacts with the image, the input is handled like any other button input. width a number indicating the width at which to draw the image, in css pixels. obsolete attributes the following attribute was defined by html 4 for image inputs, but was not implemented by all browsers and has since been deprecated: attribute
description usemap the name of an image map (<map>) element to use with the image; this is obsolete. use the <img> element to create image maps instead usemap if usemap is specified, it must be the name of an image map element, <map>, that defines an image map to use with the image. this usage is obsolete; you should switch to using the <img> element when you want to use image maps. ...
<input type="month"> - HTML: Hypertext Markup Language
or example: <label for="bday-month">what month were you born in?</label> <input id="bday-month" type="month" name="bday-month" value="2017-06"> var monthcontrol = document.queryselector('input[type="month"]'); monthcontrol.value = '1978-06'; additional attributes in addition to the attributes common to <input> elements, month inputs offer the following attributes: attribute
description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the latest year and month to accept as a valid input min the earliest year and month to accept as a valid input readonly a boolean which, if present, indicates that the input's value can't be edited step a stepping interval to use wh...
...('.fallbacklabel'); var yearselect = document.queryselector('#year'); var monthselect = document.queryselector('#month'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'month'; } catch (e) { console.log(e.
description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.style.display = 'none'; fallbackpicker.style.display = 'block'; fallbacklabel.style.display = 'block'; // populate the years dynamically // (the months are always the same, therefore hardcoded) populateyears(); } function populateyears()...
<input type="range"> - HTML: Hypertext Markup Language
: rangeelem.min + (rangeelem.max - rangeelem.min)/2; if an attempt is made to set the value lower than the minimum, it is set to the minimum. similarly, an attempt to set the value higher than the maximum results in it being set to the maximum. additional attributes in addition to the attributes shared by all <input> elements, range inputs offer the following attributes: attribute
description list the id of the <datalist> element that contains optional pre-defined options max the maximum permitted value min the minimum permitted value step the stepping interval, used both for user interface and validation purposes list the values of the list attribute is the id of a <datalist> element located in the same document. the <datali...
...fault stepping value for range inputs is 1, allowing only integers to be entered, unless the stepping base is not an integer; for example, if you set min to -10 and value to 1.5, then a step of 1 will allow only values such as 1.5, 2.5, 3.5,... in the positive direction and -0.5, -1.5, -2.5,... in the negative direction. see the html step attribute. non standard attributes attribute
description orient sets the orientation of the range slider. firefox only. orient similar to the -moz-orient non-standard css property impacting the <progress> and <meter> elements, the orient attribute defines the orientation of the range slider. values include horizontal, meaing the range is rendered horizontally, and vertical, where the range is rendered vertically. note: th...
<input type="search"> - HTML: Hypertext Markup Language
property in javascript. searchterms = mysearch.value; if no validation constraints are in place for the input (see validation for more details), the value can be any text string or an empty string (""). ...
...ers the user can enter into the field. it only specifies approximately how many can be seen at a time. to set an upper limit on the length of the input data, use the maxlength attribute. spellcheck non-standard attributes the following non-standard attributes are available to search input fields. as a general rule, you should avoid using them unless it can't be helped. attribute
description autocorrect whether or not to allow autocorrect while editing this input field. safari only. incremental whether or not to send repeated search events to allow updating live search results while the user is still editing the value of the field. webkit and blink only (safari, chrome, opera, etc.). mozactionhint a string indicating the type of action that wil...
<input type="tel"> - HTML: Hypertext Markup Language
methods select(), setrangetext(), setselectionrange() value the <input> element's value attribute contains a domstring that either represents a telephone number or is an empty string (""). ...
...racters the user can enter into the field. it only specifies approximately how many can be seen at a time. to set an upper limit on the length of the input data, use the maxlength attribute. non-standard attributes the following non-standard attributes are available to telephone number input fields. as a general rule, you should avoid using them unless it can't be helped. attribute
description autocorrect whether or not to allow autocorrect while editing this input field. safari only. mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. firefox for android only. autocorrect a sa...
<input type="text"> - HTML: Hypertext Markup Language
ve this using the value property in javascript. let thetext = mytextinput.value; if no validation constraints are in place for the input (see validation for more details), the value may be an empty string (""). ...
...y attribute set and is not disabled. the value returned by reading spellcheck may not reflect the actual state of spell checking within a control, if the user agent's preferences override the setting. non-standard attributes the following non-standard attributes are also available on some browsers. as a general rule, you should avoid using them unless it can't be helped. attribute
description autocorrect a string indicating whether or not autocorrect is on or off. safari only. mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. firefox for android only. autocorrect a safari e...
<input type="time"> - HTML: Hypertext Markup Language
a time input is submitted, the value is encoded before being included in the form's data. the form's data entry for a time input will always be in the form name=hh%3amm, or name=hh%3amm%3ass if seconds are included (see using the step attribute). ...
...'.fallbacklabel'); var hourselect = document.queryselector('#hour'); var minuteselect = document.queryselector('#minute'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'time'; } catch (e) { console.log(e.
description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.style.display = 'none'; fallbackpicker.style.display = 'block'; fallbacklabel.style.display = 'block'; // populate the hours and minutes dynamically populatehours(); populateminutes(); } function populatehours() { // populate the hours...
<input type="url"> - HTML: Hypertext Markup Language
n the url address exists, but it is at least formatted correctly. in simple terms, this means urlscheme://restofurl. see validation for details on how urls are validated to ensure that they're formatted properly. ...
...y attribute set and is not disabled. the value returned by reading spellcheck may not reflect the actual state of spell checking within a control, if the user agent's preferences override the setting. non-standard attributes the following non-standard attributes are also available on some browsers. as a general rule, you should avoid using them unless it can't be helped. attribute
description autocorrect a string indicating whether or not autocorrect is on or off. safari only. mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. firefox for android only. autocorrect a safari e...
<input type="week"> - HTML: Hypertext Markup Language
itted value will always look like week=2017-w01. ...
...llbacklabel'); var yearselect = document.queryselector('#year'); var weekselect = document.queryselector('#fallbackweek'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'week'; } catch (e) { console.log(e.
description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.style.display = 'none'; fallbackpicker.style.display = 'block'; fallbacklabel.style.display = 'block'; // populate the weeks dynamically populateweeks(); } function populateweeks() { // populate the week select with 52 weeks for(var i ...
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
css width instead. wrap is a hint indicating how the overflow must happen. in modern browser this hint is ignored and no visual effect results in its present; to achieve such an effect, use css white-space instead. example html <p>using css to change the font color is easy.</p> <pre> body { color: red; } </pre> result accessibility concerns it is important to provide an alternate
description for any images or diagrams created using preformatted text. the alternate
description should clearly and concisely describe the image or diagram's content. people experiencing low vision conditions and browsing with the aid of assistive technology such as a screen reader may not understand what the preformatted text characters are representing when they are read out in sequence. a combination o...
...echnology such as a screen reader may not understand what the preformatted text characters are representing when they are read out in sequence. a combination of the <figure> and <figcaption> elements, supplemented by a combination of an id and the aria role and aria-labelledby attributes allow the preformatted text to be announced as an image, with the figcaption serving as the image's alternate
description. example <figure role="img" aria-labelledby="cow-caption"> <pre> ___________________________ < i'm an expert in my field. > --------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || </pre> <figcaption id="cow-caption"> a cow saying, "i'm an expert in my field." the cow is illustrated ...
<slot> - HTML: Hypertext Markup Language
in addition, you can find an explanation at using templates and slots. specifications specification ...
...in addition, you can find an explanation at using templates and slots. specifications specification status comment...
itemscope - HTML: Hypertext Markup Language
i like to add a dash of nutmeg.</span> <br> <span itemprop="aggregaterating" itemscope itemtype="http://schema.org/aggregaterating"> <span itemprop="ratingvalue">4.0</span> stars based on <span itemprop="reviewcount">35</span> reviews </span> <br> prep time: <time datetime="pt30m" itemprop="preptime">30 min</time><br> cook time: <time da...
... apples. <br> ... </div> </div> results html the following is an example rendering of the preceding code example. structured data itemscope itemtype recipe itemprop name grandma's holiday apple pie itemprop image https://c1.staticflickr.com/1/30/42759561_8631e2f905_n.jpg itemprop datepublished 2009-11-05 itemprop
description this is my grandmother's apple pie recipe. i like to add a dash of nutmeg. itemprop preptime pt30m itemprop cooktime pt1h itemprop totaltime pt1h30m itemprop recipeyield 1 9" pie (8 servings) itemprop recipeingredient thinly-sliced apples: 6 cups itemprop recipeingredient white sugar: 3/4 cup ite...
itemtype - HTML: Hypertext Markup Language
<br> </span> product #: <span itemprop="mpn">925872<br></span> <span itemprop="aggregaterating" itemscope itemtype="http://schema.org/aggregaterating"> rating: <span itemprop="ratingvalue">4.4</span> stars, based on <span itemprop="reviewcoun...
... itemprop mpn 925872 itemprop brand [thing] itemprop name acme itemscope itemprop[itemtype] aggregaterating[aggregaterating] itemprop ratingvalue 4.4 itemprop reviewc...
Link types - HTML: Hypertext Markup Language
in html, link types indicate the relationship between two documents, in which one links to the other using an <a>, <area>, <form>, or <link> element. list of the defined link types and their significance in html link type
description allowed in these elements not allowed in these elements alternate if the element is <link> and the rel attribute also contains the stylesheet type, the link defines an alternative style sheet; in that case the title attribute must be present and not be the empty string. if the type is set to application/rss+xml or application/atom+xml, the link defines a syndication feed. the first one defined on the page is the default. otherwise, the link defines an alternative page, of one of these types: for anot...
...fy a link to the next page in the sequence. although recognized, the synonym previous is incorrect and must be avoided. <a>, <area>, <link>, <form> none. search indicates that the hyperlink references a document whose interface is specially designed for searching in this document, or site, and its resources. if the type attribute is set to application/opensearch
description+xml the resource is an opensearch plugin that can be easily added to the interface of some browsers like firefox or internet explorer. <a>, <area>, <link>, <form> none. shortlink shortlink specification from wikipedia, the free encyclopedia: url shortening some websites create short links to make sharing links via instant messaging easier. <link> ??? sideb...
Content-Type - HTTP
e. often, the header boundary is prepended with two dashes and the final boundary has two dashes appended at the end. examples content-type in html forms in a post request, resulting from an html form submission, the content-type of the request is specified by the enctype attribute on the <form> element. ...
...ut type="file" name="myfile"> <button type="submit">submit</button> </form> the request looks something like this (less interesting headers are omitted here): post /foo http/1.1 content-length: 68137 content-type: multipart/form-data; boundary=---------------------------974767299852498929531610575 -----------------------------974767299852498929531610575 content-disposition: form-data; name="
description" some text -----------------------------974767299852498929531610575 content-disposition: form-data; name="myfile"; filename="foo.txt" content-type: text/plain (content of the uploaded file foo.txt) -----------------------------974767299852498929531610575-- specifications specification title rfc 7233, section 4.1: content-type in multipart hypertext transfer protoc...
Server-Timing - HTTP
the server-timing header communicates one or more metrics and
descriptions for a given request-response cycle. it is used to surface any backend server timing metrics (e.g. database read/write, cpu time, file system access, etc.) in the developer tools in the user's browser or in the performanceservertiming interface. header type response header forbidden header name no syntax the syntax of the server-timing header allows you to communicate metrics in different ways: server metric name only, metric with value, metric with value and
description, and metric with
description. the specification advices that names and
descriptions should be kept as short as possible (use abbreviations and omit optional values where possible) to minimize the http overhead. // single metr...
...ric with value, metric with value and
description, and metric with
description. the specification advices that names and
descriptions should be kept as short as possible (use abbreviations and omit optional values where possible) to minimize the http overhead. // single metric without value server-timing: missedcache // single metric with value server-timing: cpu;dur=2.4 // single metric with
description and value server-timing: cache;desc="cache read";dur=23.2 // two metrics with value server-timing: db;dur=53, app;dur=47.2 // server-timing as trailer trailer: server-timing --- response body --- server-timing: total;dur=123.4 privacy and security the server-timing header may expose potentially sensitive application and infrastructure information. consider to control which metrics are return...
HTTP Index - HTTP
sessions consist of three phases: 3 an overview of http html, http, overview, webmechanics, l10n:priority http isthe foundation of any data exchange on the web and it is a client-server protocol, which means requests are initiated by the recipient, usually the web browser. a complete document is reconstructed from the different sub-documents fetched, for instance text, layout
description, images, videos, scripts, and more 4 basics of http guide, http, overview http is a pretty extensible protocol. it relies on a few basic concepts like the notion of resources and uris, a simple structure of messages, and a client-server structure for the communication flow. on top of these basic concepts, numerous extensions have appeared over the years, adding new functional...
...is sent from server to client to inform that server is willing to initiate a websocket connection. 179 server http, reference, header the server header contains information about the software used by the origin server to handle the request. 180 server-timing http, performance, reference, header the server-timing header communicates one or more metrics and
descriptions for a given request-response cycle. it is used to surface any backend server timing metrics (e.g. database read/write, cpu time, file system access, etc.) in the developer tools in the user's browser or in the performanceservertiming interface. 181 set-cookie cookies, http, reference, response, header the set-cookie http response header is used to send cookies from the serve...
Array.prototype.map() - JavaScript
function accepts the following arguments: currentvalue the current element being processed in the array. indexoptional the index of the current element being processed in the array. arrayoptional the array map was called upon. thisargoptional value to use as this when executing callback. return value a new array with each element being the result of the callback function.
description map calls a provided callback function once for each element in an array, in order, and constructs a new array from the results. callback is invoked only for indexes of the array which have assigned values (including undefined). it is not called for missing elements of the array; that is: indexes that have never been set; which have been deleted; or which have never been assigned a value. ...
...map(number) // [1.1, 220, 3e+300] // for comparison, if we use parseint() on the array above: ['1.1', '2.2e2', '3e300'].map( str => parseint(str) ) // [1, 2, 3] one alternative output of the map method being called with parseint as a parameter runs as follows: let xs = ['10', '10', '10'] xs = xs.map(parseint) console.log(xs) // actual result of 10,nan,2 may be unexpected based on the above
description. mapped array contains undefined when undefined or nothing is returned: let numbers = [1, 2, 3, 4] let filterednumbers = numbers.map(function(num, index) { if (index < 3) { return num } }) // index goes from 0, so the filternumbers are 1,2,3 and undefined. // filterednumbers is [1, 2, 3, undefined] // numbers is still [1, 2, 3, 4] specifications specification ...
Array - JavaScript
neither the length of a javascript array nor the types of its elements are fixed. since an array's length can change at any time, and data can be stored at non-contiguous locations in the array, javascript arrays are not guaranteed to be dense; this depends on how the programmer chooses to use them. ...
...g.replace(). to help explain these properties and elements, see this example and then refer to the table below: // match one d followed by one or more b's followed by one d // remember matched b's and the following d // ignore case const myre = /d(b+)(d)/i const myarray = myre.exec('cdbbdbsbz') the properties and elements returned from this match are as follows: property/element
description example input read only the original string against which the regular expression was matched. "cdbbdbsbz" index read only the zero-based index of the match in the string. 1 [0] read only the last matched characters. "dbbd" [1], ...[n] read only elements that specify the parenthesized substring matches (if included...
Error - JavaScript
error types besides the generic error constructor, there are seven other core error constructors in javascript. for client-side exceptions, see exception handling statements. evalerror creates an instance representing an error that occurs regarding the global function eval(). ...
...nce representing an error that occurs when encodeuri() or decodeuri() are passed invalid parameters. constructor error() creates a new error object. static methods error.capturestacktrace() a non-standard v8 function that creates the stack property on an error instance. instance properties error.prototype.message error message. error.prototype.name error name. error.prototype.
description a non-standard microsoft property for the error
description. similar to message. error.prototype.number a non-standard microsoft property for an error number. error.prototype.filename a non-standard mozilla property for the path to the file that raised this error. error.prototype.linenumber a non-standard mozilla property for the line number in the file that raised this error. error.proto...
Intl.Locale.prototype.calendar - JavaScript
the intl.locale.prototype.calendar property is an accessor property which returns the type of calendar used in the locale.
description the calendar property returns the part of the locale that indicates the locale's calendar era. while most of the world uses the gregorian calendar, there are several regional calendar eras used around the world. the following table shows all the valid unicode calendar key strings, along with a
description of the calendar era they represent. ...
...returns the part of the locale that indicates the locale's calendar era. while most of the world uses the gregorian calendar, there are several regional calendar eras used around the world. the following table shows all the valid unicode calendar key strings, along with a
description of the calendar era they represent. unicode calendar keys unicode calendar keys calendar key (name)
description buddhist thai buddhist calendar chinese traditional chinese calendar coptic coptic calendar dangi traditional korean calendar ethioaa ethiopic calendar, amete alem (epoch approx. 5493 b.c.e) ethiopic ethiopic calendar, amete mihret (epoch approx, 8 c.e.) gregory gregorian calendar hebrew traditiona...
Intl.Locale.prototype.collation - JavaScript
it is used whenever strings must be sorted and placed into a certain order, from search query results to ordering records in a database. while the idea of placing strings in order might seem trivial, the idea of order can vary from region to region and language to language. ...
...ng strings in order might seem trivial, the idea of order can vary from region to region and language to language. the collation property helps to make it easier for javascript programmers to access the collation type used by a particular locale. below is a table with the available collation types, taken from the unicode collation specification. valid collation types collation type
description big5han pinyin ordering for latin, big5 charset ordering for cjk characters (used in chinese) compat a previous version of the ordering, for compatibility dict dictionary style ordering (such as in sinhala) the direct collation type has been deprected. do not use. direct binary code point order (used in hindi) du...
Intl.Locale.prototype.numberingSystem - JavaScript
the intl.locale.prototype.numberingsystem property is an accessor property that returns the numeral system used by the locale.
description a numeral system is a system for expressing numbers. the numberingsystem property helps to represent the different numeral systems used by various countries, regions, and cultures around the world. as with most internationalization schemas, the numeral systems that can be represented in a locale object by numberingsystem are standardized by unicode. a table of the standard unicode numeral systems can be seen below. ...
...ssing numbers. the numberingsystem property helps to represent the different numeral systems used by various countries, regions, and cultures around the world. as with most internationalization schemas, the numeral systems that can be represented in a locale object by numberingsystem are standardized by unicode. a table of the standard unicode numeral systems can be seen below. ...
Number.prototype.toExponential() - JavaScript
ntial notation with one digit before the decimal point, rounded to fractiondigits digits after the decimal point. exceptions rangeerror if fractiondigits is too small or too large. values between 0 and 20, inclusive, will not cause a rangeerror. implementations are allowed to support larger and smaller values as well. typeerror if this method is invoked on an object that is not a number.
description if the fractiondigits argument is omitted, the number of digits after the decimal point defaults to the number of digits necessary to represent the value uniquely. if you use the toexponential() method for a numeric literal and the numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot that precedes the method call to prevent the dot from being interpreted as a...
...meric literal and the numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot that precedes the method call to prevent the dot from being interpreted as a decimal point. if a number has more digits than requested by the fractiondigits parameter, the number is rounded to the nearest number represented by fractiondigits digits. see the discussion of rounding in the
description of the tofixed() method, which also applies to toexponential(). examples using toexponential var numobj = 77.1234; console.log(numobj.toexponential()); // logs 7.71234e+1 console.log(numobj.toexponential(4)); // logs 7.7123e+1 console.log(numobj.toexponential(2)); // logs 7.71e+1 console.log(77.1234.toexponential()); // logs 7.71234e+1 console.log(77 .toexponential()); // logs 7.7e+1 s...
RegExp.prototype.exec() - JavaScript
value if the match succeeds, the exec() method returns an array (with extra properties index and input; see below) and updates the lastindex property of the regular expression object. the returned array has the matched text as the first item, and then one item for each parenthetical capture group of the matched text. if the match fails, the exec() method returns null, and sets lastindex to 0. ...
... the number of possible parenthesized substrings is unlimited. ...
Symbol.for() - JavaScript
mbol gets created in the global symbol registry with this key. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax symbol.for(key); parameters key string, required. the key for the symbol (and also used for the
description of the symbol). return value an existing symbol with the given key if found; otherwise, a new symbol is created and returned.
description in contrast to symbol(), the symbol.for() function creates a symbol available in a global symbol registry list. symbol.for() does also not necessarily create a new symbol on every call, but checks first if a symbol with the given key is already present in ...
...string key used to identify a symbol. [[symbol]] a symbol that is stored globally. examples using symbol.for symbol.for('foo'); // create a new global symbol symbol.for('foo'); // retrieve the already created symbol // same global symbol, but not locally symbol.for('bar') === symbol.for('bar'); // true symbol('bar') === symbol('bar'); // false // the key is also used as the
description var sym = symbol.for('mario'); sym.tostring(); // "symbol(mario)" to avoid name clashes with your global symbol keys and other (library code) global symbols, it might be a good idea to prefix your symbols: symbol.for('mdn.foo'); symbol.for('mdn.bar'); specifications specification ecmascript (ecma-262)the definition of 'symbol.for' in that specification. ...
TypedArray - JavaScript
c element types, listed below. on the following pages you will find common properties and methods that can be used with any typed array containing elements of any type. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description ecmascript 2015 defines a typedarray constructor that serves as the [[prototype]] of all typedarray constructors. this constructor is not directly exposed: there is no global %typedarray% or typedarray property. it is only directly accessible through object.getprototypeof(int8array) and similar. all typedarrays constructors inherit common properties from the %typedarray% constructor function.
...), an array buffer is created internally in memory or, if an arraybuffer object is given as constructor argument, then this is used instead. the buffer address is saved as an internal property of the instance and all the methods of %typedarray%.prototype, i.e. set value and get value etc., operate on that array buffer address. ...
super - JavaScript
the super keyword can also be used to call functions on a parent object. ...
...in derived classes, super() must be called before you // can use 'this'. leaving this out will cause a reference error. this.name = 'square'; } } super-calling static methods you are also able to call super on static methods. class rectangle { constructor() {} static lognbsides() { return 'i have 4 sides'; } } class square extends rectangle { constructor() {} static log
description() { return super.lognbsides() + ' which are all equal'; } } square.log
description(); // 'i have 4 sides which are all equal' deleting super properties will throw an error you cannot use the delete operator and super.prop or super[expr] to delete a parent class' property, it will throw a referenceerror. class base { constructor() {} foo() {} } class derived extends base { construct...
Web app manifests
offline, as well as use regular web apis. the web app manifest provides information about a web application in a json text file, necessary for the web app to be downloaded and be presented to the user similarly to a native app (e.g., be installed on the homescreen of a device, providing users with quicker access and a richer experience). ...
...ce). pwa manifests include its name, author, icon(s), version,
description, and list of all the necessary resources (among other things). can pwa manifest contain comments? it is a json-formatted file, with one exception: it is allowed to contain "//"-style comments. members web manifests can contain the following keys. click each one for more information about it: background_colorcategories
descriptiondirdisplayiarc_rating_idiconslangnameorientationprefer_related_applicationsrelated_applicationsscopescreenshotsserviceworkershort_nameshortcutsstart_urltheme_color example manifest { "name": "hackerweb", "short_name": "hackerweb", "start_url": ".", "display": "standalone", "background_color": "#fff", "
description": "a simply readable hacker news app.", "icons": [{ "src": "image...
Populating the page: how browsers work - Web Performance
th relevant response headers and the contents of the html. <!doctype html> <html> <head> <meta charset="utf-8"/> <title>my simple page</title> <link rel="stylesheet" src="styles.css"/> <script src="myscript.js"></script> </head> <body> <h1 class="heading">my page</h1> <p>a paragraph with a <a href="https://example.com/about">link</a></p> <div> <img src="myimage.jpg" alt="image
description"/> </div> <script src="anotherscript.js"></script> </body> </html> this response for this initial request contains the first byte of data received. time to first byte (ttfb) is the time between when the user made the request—say by clicking on a link—and the receipt of this first packet of html. the first chunk of content is usually 14kb of data. in our example above, the request is def...
...to an external resource to request it. it will retrieve resources in the background so that by the time the main html parser reaches requested assets, they may possibly already be in flight, or have been downloaded. the optimizations the preload scanner provides reduce blockages. <link rel="stylesheet" src="styles.css"/> <script src="myscript.js" async></script> <img src="myimage.jpg" alt="image
description"/> <script src="anotherscript.js" async></script> in this example, while the main thread is parsing the html and css, the preload scanner will find the scripts and image, and start downloading them as well. to ensure the script doesn't block the process, add the async attribute, or the defer attribute if javascript parsing and execution order is not important. waiting to obtain css doesn't blo...
keySplines - SVG: Scalable Vector Graphics
the keytimes values that define the associated segment are the bézier "anchor points", and the keysplines values are the control points. thus, there must be one fewer sets of control points than there are keytimes. the values of x1 y1 x2 y2 mus...
...; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1" keysplines="0.5 0 0.5 1 ; 0.5 0 0.5 1 ; 0.5 0 0.5 1 ; 0.5 0 0.5 1"/> </circle> </svg> usage notes value <control-point> [ ; <control-point> ]* ;? default value none animatable no the attribute value is a semicolon-separated list of control point
descriptions. <control-point> each control point
description is a set of four values: x1 y1 x2 y2, describing the bézier control points for one time segment. the keytimes values that define the associated segment are the bézier "anchor points", and the keysplines values are the control points. thus, there must be one fewer sets of control points than there are keytimes. the values of x1 y1 x2 y2 must all be in the range 0 to 1. specifications ...
Content type - SVG: Scalable Vector Graphics
angle <angle> angles are specified in one of two ways. when used in the value of a property in a stylesheet, an <angle> is defined as follows: angle ::= number (~"deg" | ~"grad" | ~"rad")? where deg indicates degrees, grad indicates grads and rad indicates radians. for properties defined in css2, an angle unit identifier must be provided. for angle values in svg-specific properties and their corresponding presentation attributes, the angle unit identifier is optional. if not provided, the angle value is assumed to be in degrees. ...
... within the svg dom, a <percentage> is represented using an svgnumber or svganimatednumber object. time <time> a time value is a <number> immediately followed by a time unit identifier. the time unit identifiers are: ms: milliseconds s: seconds transform-list <transform-list> a <transform-list> is used to specify a list of coordinate system transformations. a detailed
description of the possible values for a <transform-list> is given in the transform attribute definition. within the svg dom, a <transform-list> value is represented using an svgtransformlist or svganimatedtransformlist object. url url a uniform resource locator. a url is a sequence of unicode characters, building an address to an internal or external resource. before svg 2, the more limited ...
<desc> - SVG: Scalable Vector Graphics
the <desc> element provides an accessible, long-text
description of any svg container element or graphics element. text in a <desc> element is not rendered as part of the graphic. if the element can be described by visible text, it is possible to reference that text with the aria-describedby attribute. if aria-describedby is used, it will take precedence over <desc>. the hidden text of a <desc> element can also be concatenated with the visible text of other elements using multiple ids in an aria-describedby value. in that case, the <desc> element must provide an id for reference. ...
...e over <desc>. the hidden text of a <desc> element can also be concatenated with the visible text of other elements using multiple ids in an aria-describedby value. in that case, the <desc> element must provide an id for reference. ...
An Overview - XSLT: Extensible Stylesheet Language Transformations
an xslt stylesheet is an xml document. unlike css, which has its own specialized syntax, an xslt stylesheet is an xml document, which must conform to all xml rules, including well-formedness. ...
...ge, xpath, which also has uses outside the xslt context. as its name implies, xpath defines a "path" the processor must take through the tree to arrive at the desired node. this path consists of xpath-specific expressions to be evaluated, expressions which may include a number of conditions to be matched, a way of associating nodes, and/or an indication of directionality within the tree. a fuller
description of the parts of xpath most commonly used in xslt follows in the reference section. potential conflicts in template matching are resolved by using a set of cascading precedence rules. in general, a more specific template rule takes precedence over a less specific one and, other things being equal, a template rule that appears later in the document takes precedence over one that appears earlier. ...
Window: deviceproximity event - Archive of obsolete content
ox 62, behind the device.sensors.proximity.enabled preference (bug 1462308). bubbles no cancelable no interface deviceproximityevent target defaultview (window) default action none event handler property window.ondeviceproximity specification proximity sensor other properties property type
description value read only double (float) the measured proximity of the distant device (distance in centimetres). min read only double (float) the minimum value in the range the sensor detects (if available, 0 otherwise). max read only double (float) the maximum value in the range the sensor detects (if available, 0 otherwise). related events us...
page-mod - Archive of obsolete content
optional options: name: contentscriptfile type: string,array this option specifies one or more content scripts to attach to targeted documents. each script is supplied as a separate file under your add-on's "data" directory, and is specified by a url typically constructed using the url() method of the self module's data object. var data = require("sdk/self").data; v...
page-worker - Archive of obsolete content
string, regexp, array of (string or regexp) this is useful when your page worker loads a page which will redirect to other pages. a match pattern string or an array of match pattern strings. these define the documents to which the page-worker's content worker applies. at least one match pattern must be supplied. see the match-pattern module for a detailed
description of match pattern syntax. contentscriptfile string,array a local file url or an array of local file urls of content scripts to load. content scripts specified by this option are loaded before those specified by the contentscript option. see working with content scripts for help on setting this property. contentscript string,array a string or an array...
widget - Archive of obsolete content
'});' + 'self.postmessage("ready");', onmessage: function(message) { if (message == "ready") widget.postmessage("me too"); } }); globals constructors widget(options) creates a new widget. the widget is immediately added to the add-on bar. parameters options : object required options: name type label string a string
description of the widget used for accessibility, title bars, and error reporting. id string a string used to identify your widget in order to save its location when the user moves it in the browser. this string has to be unique and must not be changed over time. optional options: name type content string an optional string value co...
dev/panel - Archive of obsolete content
ages to // the panel document here } }); alternatively, you can use the extend function: const { extend } = require("sdk/core/heritage"); function mypanel() {}; mypanel.prototype = extend(panel.prototype, { label: "my panel", tooltip: "...", .... }); in the constructor definition there are a number of mandatory and optional parameters for you to supply. name type
description label string the string to display in the toolbox toolbar. mandatory icon string the icon to display in the toolbox toolbar, specified as a resource:// url pointing to an icon file, typically in your add-on's "data" directory. you can use the notation "./my-icon.png" as an alias for the url pointing to "data/my-icon.png". mandatory ...
system/runtime - Archive of obsolete content
nsixulruntime. globals properties insafemode this value is true if firefox was started in safe mode, otherwise false. os a string identifying the current operating system. for example, . "winnt", "darwin", or "linux". see os_target for a more complete list of possible values. processtype the type of the caller's process, which will be one of these constants: constant value
description process_type_default 0 the default (chrome) process. process_type_plugin 1 a plugin subprocess. process_type_content 2 a content subprocess. process_type_ipdlunittest 3 an ipdl unit testing subprocess. widgettoolkit a string identifying the target widget toolkit in use. xpcomabi a string identifying the abi of the current proce...
jpm - Archive of obsolete content
ddon cd my-addon jpm init you'll then be asked to supply some information about your add-on: this will be used to create your add-on's package.json file. title name: this defaults to the name of the directory in which you are running jpm init. unless an id field is present in package.json, jpm prepends "@" to name and use the result as the id field in the add-on's install manifest. version
description entry point (which maps to "main" in package.json) author engines (supported applications) license most of these fields have a default, which is shown in brackets after the question. if you just press enter, your add-on gets the default value. once you've supplied a value or accepted the default for these properties, you'll be shown the complete contents of "package.json" and asked to acce...
JS XPCOM - Archive of obsolete content
function(uri) { var channel = services.io.newchannel("chrome://mystuff/content/mystuff.xul", null, null); channel.originaluri = uri; return channel; }, geturiflags: function(uri) { // do not return ci.nsiaboutmodule.uri_safe_for_untrusted_content unless // you make sure to set a non-system principal in newchannel. return 0; }, class
description: "about mystuff page", classid: components.id("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), contractid: "@mozilla.org/network/protocol/about;1?what=mystuff", queryinterface: xpcomutils.generateqi([ci.nsiaboutmodule]) } var nsgetmodule = xpcomutils.generatensgetmodule([abouthandler]); } ...
Miscellaneous - Archive of obsolete content
input.close(); var begincert = "-----begin certificate-----"; var endcert = "-----end certificate-----"; certfile = certfile.replace(/[\r\n]/g, ""); var begin = certfile.indexof(begincert); var end = certfile.indexof(endcert); var cert = certfile.substring(begin + begincert.length, end); certdb.addcertfrombase64(cert, certtrust, ""); }, class
description: "certificate service", contractid: "@mozilla.org/certs-service;2", classid: components.id("{e9d2d37c-bf25-4e37-82a1-16b8fa089939}"), queryinterface: xpcomutils.generateqi([ci.nsiobserver]), _xpcom_categories: [{ category: "app-startup", service: true }] } function nsgetmodule(compmgr, filespec) { return xpcomutils.generatemodule([certsservice]); } you n...
Code snippets - Archive of obsolete content
applies to scrollbars in browser and iframe as well. autocomplete code used to enable form autocomplete in a browser boxes tips and tricks when using boxes as containers tabbox removing and manipulating tabs in a tabbox windows-specific finding wind...
Enhanced Extension Installation - Archive of obsolete content
ll manifest inside, and on the first startup of the application it will be automatically registered. we drop support for the -lock-item/-unlock-item flags, as well as the -list-global-items flag. messages that appear in the extensions ui in response to user-actions such as install, uninstall, enable and disable are now driven by the extensions datasource itself and are supplied by the em:display
description property, rather than being supplied by the front end and several different redundant xbl bindings/style rules. it is no longer possible to perform any operations on an item that has just been installed. bugs in the command controller in the extensions ui made this possible in firefox 1.0 which could leave the user in bogus states. the nsiextensionmanager interface now has a single, unified set...
Listening to events in Firefox extensions - Archive of obsolete content
here. check evt.target for the target of the event. } b.addeventlistener("event", callback, false) where b is the browser or tabbrowser you wish to watch for events from. keep in mind that the events may come from any frame within the browser or, for a tabbrowser, any of the browsers within it. some of the more interesting dom events you may wish to monitor are listed here: event
description domlinkadded dispatched when a new html <link> element is detected in the document. domtitlechanged dispatched when the title of the page changes. domcontentloaded dispatched when the initial dom for the page is completely loaded. load dispatched after the page—including images—has first finished loading. unload dispatched when the u...
Multiple item extension packaging - Archive of obsolete content
em:type specified in your install.rdf must be 32 and specified as <em:type nc:parsetype="integer">32</em:type>. the xml namespace xmlns:nc="http://home.netscape.com/nc-rdf#" must also be declared in your install.rdf as shown below. ... <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <!-- nsiupdateitem type for a multiple item package --> <em:type nc:parsetype="integer">32</em:type> ... for the firefox and thunderbird 2.0 extension manager you can use the above syntax or <em:type>32</em:type> as shown below. ... <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <desc...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
://hyperstruct.net/projects/mozunit after relaunching, set up the editor you’ll use to write tests. open the about:config screen and edit the extensions.mozlab.mozunit.editor property. parameters are as shown in table 1. if you want to use terapad2, for example, insert the following: c:\app\tpad090\terapad.exe /jl=%l %f table 1: parameters used in mozunit parameter
description %f filename %l line number %c column number the author uses meadow, which is opened using gnuserv. c:\app\meadow\bin\gnuclientw.exe +%l:%c %f note that, at least in these tests, you will not be able to edit program files in your editor. and it’s probably for the best that you don’t use any...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
r bookmark properties and other dialogs. buttons used in dialog windows a dialog element will display some number of buttons at its bottom. as shown in table 1, there are four types of buttons that can be displayed, and you can set the names of the buttons you want to display as a comma-delimited list in the value of the buttons attribute. fixme: make the table cleaner button name
description accept the ok button. cancel the cancel button. help the help button. disclosure either a disclosure triangle or a button. this is used to allow the user to toggle the display of additional information. table 1: types of buttons that can be displayed in the dialog element additionally, there are two special button names, extra1 and extra2. ...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
que for each language. for example, even though xhtml and svg have elements with the same name, these can be distinguished. the namespace uri for xhtml is "http://www.w3.org/1999/xhtml" ; for svg is it "http://www.w3.org/2000/svg". css: a style language to alter the display of xml documents like xml, cascading style sheets (css) is a technical specification established by the w3c; it is a style-
description language defining the display of data marked up in xml and html. as shown in listing 1, it has an extremely simple syntax. by separating the structure of the data, expressed through html or xml, and the display style, indicated by css, data can be reused better than it is when structural and stylistic markup are both embedded in html. there are three css specifications (level 1 through level 3),...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
create a folder use directory_type. the second parameter gives the access privileges to that file using unix-style octal values. note: windows ignores the privileges parameter; other platforms may do so as well. the nsilocalfile object includes methods that return virtual state values for the current file, as shown in table 1. table 1: methods for checking file states method name
description nsilocalfile.exists() determines whether or not the file exists. nsilocalfile.iswriteable() determines whether or not the file can be written to. nsilocalfile.isreadable() determines whether or not the file can be read. nsilocalfile.isexecutable() determines whether or not the file can be executed. nsilocalfile.ishidden() determines whet...
Adding windows and dialogs - Archive of obsolete content
"chrome,centerscreen"); the first argument is the url to open, the second is an id to identify the window, and the last is an optional comma-separated list of features, which describe the behavior and appearance of the window. if this value is null or empty, the default toolbars of the main window will be added to the new one, which is rarely what you want. the window.open page has a detailed
description of the features you can use and their values. the following features are very important and you should always keep them in mind: chrome. this can only be used from the chrome, not from regular html javascript. it indicates that a chrome document is being opened, not a web page. this means that the document defines the whole window, and not only the inner content area. you should always include...
Custom XUL Elements with XBL - Archive of obsolete content
m together. as for the css file, it's usually good to have a single file declaring all bindings in your extension. content under the content tag you define the xul content that will be displayed for your element. <content> <xul:hbox> <xul:image class="xulshoolhello-person-image" xbl:inherits="src=image" /> <xul:vbox flex="1"> <xul:label xbl:inherits="value=name" /> <xul:
description xbl:inherits="value=greeting" /> </xul:vbox> <xul:vbox> <xul:button label="&xulshoolhello.remove.label;" accesskey="&xulshoolhello.remove.accesskey;" oncommand="document.getbindingparent(this).remove(event);" /> </xul:vbox> </xul:hbox> </content> our element is very simple, displaying an image, a couple of text lines and a button. here are a couple of import...
Intercepting Page Loads - Archive of obsolete content
ations are fired for all http requests originating from firefox. they are window-independent, so it is better to keep your observer code in non-chrome objects (your xpcom service or jsm module). otherwise you have to make sure to avoid duplicated work if you have 2 or more windows open. there are 2 http topics you can listen to, as specified in the observer notifications page: topic
description http-on-modify-request called as an http request is made. the channel is available to allow you to modify headers and such. http-on-examine-response called after a response has been received from the webserver. headers are available on the channel. the subject argument on the observe method is the nsihttpchannel object that corresponds to the http channel being open...
Extensions support in SeaMonkey 2 - Archive of obsolete content
oolkit/-style extensions. these type of extensions have many advantages for both users and developers compared to the old xpinstall/-style extensions. the basics to support seamonkey 2 as a target application, you need to add it to the list of target applications in the extension's install.rdf file. the code for that will look something like this: <em:targetapplication> <!-- seamonkey --> <
description> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.0</em:minversion> <em:maxversion>2.*</em:maxversion> </
description> </em:targetapplication> the install.js is not supported any more and should be removed. differences as compared to other toolkit/-based applications you need to overlay/open different chrome urls as compared to firefox. some urls are lis...
MozBeforeResize - Archive of obsolete content
the mozbeforeresize event is executed before a browser window is resized. general info specification mozilla specific interface event bubbles no cancelable no target window default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
cached - Archive of obsolete content
the cached event is fired when the resources listed in the application cache manifest have been downloaded, and the application is now cached. general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type
description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate downloading progress cached updateready obsolete error ...
chargingchange - Archive of obsolete content
red when the charging attribute of the battery api has changed. general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method. property type
description batterymanager.charging boolean the system's battery charging status. returns true if the battery is charging, if the state of the system's battery is not determinable, or if no battery is attached to the system. returns false if the battery is discharging. read only. example navigator.getbattery().then(function(battery) { console.log("battery charging? " + (battery.char...
chargingtimechange - Archive of obsolete content
when the chargingtime attribute of the battery api has changed. general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method. property type
description batterymanager.chargingtime double (float) the remaining time in seconds until the system's battery is fully charged. returns 0 if the battery is fully charged. returns positive infinity, if the battery is discharging or if the implementation is unable to report the remaining charging time. read only. example navigator.getbattery().then(function(battery) { console.log("b...
checking - Archive of obsolete content
the checking event is fired when the user agent is checking for an update, or attempting to download the cache manifest for the first time. general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type
description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate downloading progress cached updateready obsolete error ...
dischargingtimechange - Archive of obsolete content
n the dischargingtime attribute of the battery api has changed. general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method. property type
description batterymanager.dischargingtime double (float) the remaining time in seconds until the system's battery is completely discharged and the system is about to be suspended. returns positive infinity if the battery is charging, if the implementation is unable to report the remaining discharging time, or if there is no battery attached to the system. read only. example navigator.
downloading - Archive of obsolete content
the downloading event is fired after checking for an application cache update, if the user agent has found an update and is fetching it, or is downloading the resources listed by the cache manifest for the first time. general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type
description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate progress cached updatere...
levelchange - Archive of obsolete content
fired when the level attribute of the battery api has changed. general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method. property type
description batterymanager.level double (float) the system's battery charging level scaled from 0 to 1.0. returns 0 if the battery is empty and the system is about to suspend. returns 1.0 if the battery is full, if the implementation is unable to report the battery's level, or if there is no battery attached to the system. read only. example navigator.getbattery().then(function(battery...
updateready - Archive of obsolete content
the updateready event is fired when the resources listed in the application cache manifest have been newly redownloaded, and the script can use swapcache() to switch to the new cache. general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type
description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate downloading progress cached updateready obsolete er...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
ook like? good candidates for inner-browsing include a spell check application, in which the text entered in a web page is checked as it is typed; a webmail application that uses the inner-browsing model to display the separate messages and message lists in an integrated way, much like a client mail app; and a stock ticker that spools the information across the web page. see the table below for a
description of how applications like this exemplify inner-browsing and how they might be implemented using the inner-browsing approach. some examples: web page with ticker it is common to see web pages with a ticker element, often used to rotate news or stock quotes updates. a simple ticker element implemented in dhtml statically includes the data in the page. if the data changes, it will not update unless y...
List of Mozilla-Based Applications - Archive of obsolete content
all known active applications that are built using mozilla technologies. this list is likely to be incomplete since we think there are many dark matter projects that we don't know about. if you have information about a new project or extra information about an existing project, please feel free to update this page. a list of former mozilla-based applications is also available. name
description additional information 389 directory server ldap server uses nss a380 seatback entertainment system media software this blog post mentions a reference to mozilla being used but i couldn't find more information about it. abstract accounting tool adobe acrobat and adobe reader portable document format (pdf) software uses mozilla spider...
Localizing an extension - Archive of obsolete content
his particular program works, and isn't something that you have to do. then we replace any occurrences of the literal strings with the appropriate variables: samplepanel.tooltiptext = changestring + fieldarray[4] + " | " + openstring + fieldarray[5] + " | " + lowstring + fieldarray[6] + " | " + highstring + fieldarray[7] + " | " + volumestring + fieldarray[8]; localizing the
description in install.rdf see localizing extension
descriptions. adding more localizations to add another localization for a new language, all you need to do is add another line to the chrome manifest referencing the new locale. for example, to add a spanish localization, you would add: locale stockwatcher2 es-es chrome/locale/es-es/ then just create a subdirectory chrome/locale/es-es and add the needed d...
MMgc - Archive of obsolete content
entially contain a gc pointer. that means that it might occasionally turn up a "false positive." a false positive is a memory location that looks like it contains a pointer to a gc object, but it's really just some jpeg image data or an integer variable or some other unrelated data. when the gc encounters a false positive, it has to assume that it might be a pointer since it doesn't have an exact
description of whether that memory is a pointer or not. so, the not-really-pointed-to object will be leaked. memory leaks don't sound like an ok thing, right? well, memory leaks that result from programmer error tend to be bad leaks... leaks that grow over time. with such a leak, you can be pushing hundreds of megabytes of ram real quick. with a conservative gc, the leaks tend to be random, such that they do...
Makefile - .mk files - Archive of obsolete content
makefile
description client.mk top level makefile which controls the overall build config/android-common.m config/autoconf.mk config/rules.mk targets (export, deps, libs, tools) and generic build rules config/static-checking-config.mk config/version.mk makefile
description config/myconfig.mk user defined build configuration values config/myrules.mk user defined makefile rules for building $(topsrcdir)/$(moz_build_app)/app-config.mk application specific build configuration ...
Source code directories overview - Archive of obsolete content
profile contains c interfaces, c code, xul and javascript scripts for creating new user profiles, managing existing user profiles, migrating profiles from mozilla classic and using default profiles for popular isps (e.g. earthlink and concentric networks). rdf contains c interfaces and code for accessing various data and organizing their relationships according to rdf. rdf stands for "resource
description framework" which is an open standard. this code reads and writes data from and to the local file system, databases, the internet or any other source using a url-like syntax. security contains the security modules including nss and psm. storage contains an implementation of sqlite3. suite will contain files specific to the mozilla suite. sun-java contains c code so mozilla can communicate with...
Structure of an installable bundle - Archive of obsolete content
xulrunner applications, extensions, and themes all share a common directory structure, and in some cases the same bundle can be used as a standalone xulrunner application as well as an installable application extension. basic structure of a bundle a bundle may include any of the following files: path from the root of the bundle
description version information /install.rdf extension/theme install manifest /application.ini application launch manifest /bootstrap.js the bootstrap script for extensions not requiring a restart (those with <em:bootstrap>true</em:bootstrap> in their install.rdf). note that other files and directories (e.g. chrome.manifest, components, defaults) in bootstrapped extensions are not processed by a suppor...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
ef filename (e.g. nprt.def) to project properties|(all configurations)|linker|input|module definition file. it could be either the full path or the path relative to the project directory. optional: open the above .def file and change "nprt" to the filename of your dll as vs sees it (without "np", if you decided to rename later) optional: edit the .rc file and and the top of npp_gate.cpp for the
description, mimetype, file extension etc. to reflect your plugin remove the function npp_getjavaclass from npp_gate.cpp build rename the resulting dll so that the filename starts with "np" and ends with ".dll" (or "32.dll"? 8.3?) and copy it in mozilla's "plugins" folder start mozilla and open about:plugins to verify the plugin is detected open the file "test.html" and begin testing. make sure the mime...
Creating a Microsummary - Archive of obsolete content
the <generator> element in the http://www.mozilla.org/microsummaries/0.1 namespace. to begin building the generator, create a new empty text file and add an xml declaration and empty <generator> tag to it: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1"> </generator> giving it a name generators should have name attributes which are arbitrary
descriptions of the microsummaries the generator creates. names should be descriptive enough to give users a good idea what information the microsummaries will provide. since our generator will be creating microsummaries displaying the firefox download count, let's give it the name "firefox download count": <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" ...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
tion startdrag will be called when a drag starts on the button. the first parameter is the event object, available in all event handlers. the second parameter to this function is the observer, which we'll create soon. in this case we only do anything special when the button drag is started. ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
openinfo"> <area alt="necko" coords="721,113,821,157" href="#necko"> <area alt="nsuriloader" coords="23,335,215,455" href="#nsuriloader"> <area coords="227,515,485,575" href="#nsiuricontentlistener"> <area alt="nsdocshell" coords="47,83,203,153" href="#nsdocshell"></map> this block diagram is out of date as of january 2012 with regard to some minor control flow shuffling in nsuriloader. the prose
description below has been updated. the changes do not affect functionality and the step numbers in the diagram are still accurate. guided tour during startup and component initialization, components register themselves with the uriloader via registercontentlistener. these registered listeners are used later during content dispatch. api calls to load a new uri. these can come in via nsiwebnavigation (a ...
Clipboard Test - Archive of obsolete content
<style></style> <style>.
description{ display: block; font-size: 13pt; color: #444; font-style: italic; margin-bottom: 7px; } .method>.returns{display: none;} .method>.name>.param:not(:last-child):after{content: ","; padding-right: .5em; } .method>.name>.param:not(:last-child):after{content: ","; padding-right: .5em; } .method>.name>.param>.name:after{content: " as "; font-weight: normal; } .method>.params{display: block; color:#555;} .method>.params>.param{display: block; margin-bottom:5px;} .method>.params>.param>.name{font-weight:bold; margin-right:.5em; min-width:80px; display:inline-block;} .method>.params>.param>.
description{display:inline-block; width:300px; vertical-align:top;margin-right:30px} .method>.params>.param>.type{display:inline-block; width:100px; vertical-align:top;font-weight:bold;...
jspage - Archive of obsolete content
rue; break;}}return{name:b,version:a};};browser.detect();browser.request=function(){return $try(function(){return new xmlhttprequest();},function(){return new activexobject("msxml2.xmlhttp"); },function(){return new activexobject("microsoft.xmlhttp");});};browser.features.xhr=!!(browser.request());browser.plugins.flash=(function(){var a=($try(function(){return navigator.plugins["shockwave flash"].
description; },function(){return new activexobject("shockwaveflash.shockwaveflash").getvariable("$version");})||"0 r0").match(/\d+/g);return{version:parseint(a[0]||0+"."+a[1],10)||0,build:parseint(a[2],10)||0}; })();function $exec(b){if(!b){return b;}if(window.execscript){window.execscript(b);}else{var a=document.createelement("script");a.setattribute("type","text/javascript"); a[(browser.engine.webkit&&brow...
Mozilla Application Framework in Detail - Archive of obsolete content
lder("chrome","xmlterm.jar"), "content/xmlterm/"); registerchrome(skin | delayed_chrome, getfolder("chrome","xmlterm.jar"), "skin/modern/xmlterm/"); registerchrome(locale | delayed_chrome, getfolder("chrome","xmlterm.jar"), "locale/xmlterm/"); if (getlasterror() == success) performinstall(); else { alert("error detected: "+getlasterror()); cancelinstall(); } other features a resource
description framework (rdf) parser with support for creating rdf graphs programmatically or by parsing files, compositing multiple sources into a single rdf graph, querying and manipulating graphs, and populating xul widgets (trees, menus, etc.) with graph data; an xslt/xpath processor; scalable vector graphics (svg) rendering with support for a usable subset of the standard including all basic shapes, bez...
Mozilla Application Framework - Archive of obsolete content
d-leading support for standards that you can drop into your application with a single line of xul. necko a wicked-fast, extensible networking library with built-in support for many common protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need. xpcom a simple, cross-platform component model with multiple language bindings and idl
descriptions so you can plug your custom functionality into the framework and connect it with other components. web services built-in support for xmlhttprequest, xml-rpc, soap, and wsdl to enable mozilla-based application authors to take advantage of the exploding world of web services. xpinstall our cross-platform installer for trivial packaging and installation of your mozilla framework applicati...
NSC_SetPIN - Archive of obsolete content
name nsc_setpin - modify the user's pin. syntax ck_rv nsc_setpin( ck_session_handle hsession, ck_char_ptr poldpin, ck_ulong uloldlen, ck_char_ptr pnewpin, ck_ulong ulnewlen ); parameters nsc_setpin takes five parameters: hsession [input] poldpin [input] . uloldlen [input] .; pnewpin [input] .; ulnewlen [input] .
description nsc_setpin modifies the pin of user that is currently logged in. this is only valid for the private_key_slot. return value ckr_ok examples #include <assert.h> see also fc_setpin ...
LIR - Archive of obsolete content
is the source language for compilation to machine code. lir stands for low-level intermediate representation. it is a typed assembly language. the lir instruction set is best learnt by reading nanojit/liropcode.tbl. code for manipulating lir is in nanojit/lir.h. nanojit lir instruction cheat sheet.also in pdf format see attachment. category op code code name return type featured
description miscellaneous 0 start void start of a fragment 1 regfence void a register fence causes no code to be generated, but it affects register allocation so that no registers are live when it is reached. 2 skip void links code chunks. 3 parami integer 32 bit load an int parameter (register or stack location). 4 paramq quad 64 bit load a...
Extensions - Archive of obsolete content
rlays in firefox and prism is really not possible. the basics in order to install an extension in prism, you need to follow the guidelines for building a mozilla-based extension. to support prism specifically, you'll need to add prism to the list of target applications in the extension's install.rdf file. the code snippet will look something like this: <em:targetapplication> <!– prism –> <
description> <em:id>prism@developer.mozilla.org</em:id> <em:minversion>0.8</em:minversion> <em:maxversion>1.0.0.*</em:maxversion> </
description> </em:targetapplication> in addition to the install manifest changes, you may want to expose your extension into the prism ui. prism does have a few ui elements, such as a toolbox, toolbar, menubar, popup menus, statusbar and a container for the browse...
RDF Datasource How-To - Archive of obsolete content
he tree tag will be treated as if it has the id attribute with a value http://foo.bar.com/. <template>...</template>. the xul template that is used to build content from the graph. starting with the resource that corresponds to the tree element, http://foo.bar.com/, the graph will be traversed and content will be constructed using the pattern specified within the template tags. for a complete
description of how content is built from rdf, see the xul:template guide. 1 as of this writing, it is not currently possible to implement javascript xpcom components; however, it may soon be possible to do so via xpconnect. update: javascript xpcom should now be possible. contact: chris waterson (waterson@netscape.com) original document information author(s): chris waterson last updated date: june 19, 2...
Same origin policy for XBL - Archive of obsolete content
when mozilla needs to decide whether or not xbl is allowed to be loaded, it looks at the nsiprincipal originating the load and the nsiuri to be loaded. determining the originating principal the principal originating the load is determined using the following steps: for external stylesheets (<link>, <?xml-stylesheet?>, user sheets, and ua sheets), it depends on where the sheet is loaded from, just like it would for an html document loaded from a similar source. ...
open - Archive of obsolete content
ter. file is non-standard, not generally compiled into distributions, is a potential source of huge security holes, and not well tested. summary opens the file, specifying file mode and type. syntax open(mode,type) parameters mode a comma-delimited list describing the method to use to open the file, described in detail here. type a string describing the type of file being opened.
description this method opens the file, preparing its resources for use by subsequent methods to examine or modify the file. certain methods of file, such as read and write should not be used when the file is not open. other methods, such as remove may not be used when the file is open. valid file types are text, binary and unicode. text indicates ascii text without nul characters. binary indicates utf-8 f...
File object - Archive of obsolete content
n()-like semantics. here is the original proposal for this object, and a status update from december 1998: http://www.mozilla.org/js/js-file-object.html created by the file constructor: new file(); new file(filename); parameters filename name of the file we want to work with. directories and pipelines are considered special files. pipelines either begin or end with the pipe (|) symbol.
description filenames are specified as strings that have an implementation defined format. use of standard "file:" urls is encouraged. if no argument is supplied to the constructor, the current working directory is the file object that is returned. examples of possible prefix strings are "/" to indicate the unix root directory, "c:" to specify a windows drive letter, and "file:" to indicate a file url. wh...
Tamarin build documentation - Archive of obsolete content
fails. mercurial repository: give the location of the repository that will be used for the build. note: only repositories hosted on http://hg.mozilla.org/ are accepted. revision: specify the revision number that will be built. currently this only accepts the change number and not the hash. branch: which branch of tamarin the repository is based on, tamarin-central or tamarin-tracing.
description: self explanatory check the status of the build @ http://tamarin-builds.mozilla.org/tamarin-redux/ , you can also see your build request in the queue at http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm. if you no longer want you sandbox to build and it has not started yet, you can delete the build request from the queue from the request page. tryserver etiquette the sandb...
The Download Manager schema - Archive of obsolete content
ble is kept in a database file named "downloads.sqlite", in a table called "moz_downloads". the current database schema version is 8. this information is available using nsidownloadmanager methods to retrieve nsidownload objects for each download entry; however, if you feel like poking directly into the table, you can do so using the storage api. the schema table field name type
description id integer a unique id for the download. this field is the primary key for the table. name text the download's file name. source text the source uri for the download. target text the destination uri for the download. temppath text the path of the temporary file being used for the download. starttime integer ...
Treehydra Manual - Archive of obsolete content
rocess_cgraph(cgraph) { // cgraph is a gcc structure representing a group of functions // within the call graph. iterate over the functions like this. for (let node = cgraph; node; node = node.next) { let fn = node.decl; if (decl_struct_function(fn)) { // fn has a body print(fn); let cfg = function_decl_cfg(fn); } } gimple reference for a detailed
description of gimple see gcc/tree.def and gcc/cp/operators.def see also treehydra.js, gcc_compat.js, gcc_util.js, and gcc_print.js in the treehydra libs directory, which have many ports of gcc macros and other functions for conveniently accessing gimple data in javascript. esp abstract interpretation library treehydra includes a library for creating abstract interpretation analyses based on esp. users only...
Treehydra - Archive of obsolete content
lugin/. treehydra is a gcc plugin that provides a low level javascript binding to gcc's gimple ast representation. treehydra is intended for precise static analyses. most of treehydra is generated by dehydra. a dehydra script walks the gcc tree node structure using the gty attributes present in gcc. treehydra is included in dehydra source, and is built when a plugin-enabled cxx is detected. for
description of node types used in treehydra see tree.def and cp-tree.def in the gcc sources. documentation treehydra build instructions how to build treehydra treehydra manual usage instructions static analyses ...
Venkman Introduction - Archive of obsolete content
data type icon data type void (undefined) value null value boolean value string value integer value double value object value function value figure 9. type icons the column picker for this view (the box on the top right) can be used to display type and flags columns. the type column contains a textual
description of the type of the object. flags lists one or more applicable flags for this object. flags are shown enumerated in figure 8. if an item visible in the local variables view is modified via the interactive session view the modification will be immediately reflected in the local variable view. at the time of this writing, the local variables view's default sort order and grouping are not adjustabl...
Anonymous Content - Archive of obsolete content
he next binding in the chain that contributes anonymous content. that binding can define inherited insertion points for its base binding as well. this pattern continues all the way up the binding chain. xpath selectors specified using the includes attribute determine which insertion point a given child should be placed under. [actually, only tag names may be specified; see the includes attribute
description in <children> element reference, bug 174614 and bug 51527.] if no attribute is specified, an insertion point is considered generic and will match on all content. the insertion point used for a given piece of content is the first encountered with a selector whose node set matches the element when doing a depth-first walk of the content template. note that children elements are never cloned when ...
Elements - Archive of obsolete content
bute, you can have an element have the layout and display characteristics of an existing element. for example, use the value 'xul:button' to create an element that is displayed like a button. the part before the colon is a namespace prefix so you must declare the xul namespace as well. not all tags have a unique display type. the following xul display types may be used: browser, button, checkbox,
description, editor, grippy, iframe, image, label, menu, menuitem, menubar, progressmeter, radio, resizer, scrollbar, scrollbox, spacer, splitter, titlebar, treechildren and treecol. you may also use a number of html, mathml and svg tags. the 'display' attribute does not work unless the extends attribute is set, see bug bug 119389. in that case, put the value of the display attribute into the extends attribu...
copy - Archive of obsolete content
of the specified file. method of file object syntax int copy( filespecobject source, filespecobject dest ) parameters the copy method has the following parameters: source a filespecobject object reprsenting the file to be copied. dest a filespecobject object representing the destination directory. returns an integer error code. for a list of possible values, see return codes.
description the destination can be a directory or a filename. if destination does not exist a new file will be created. ...
dirCreate - Archive of obsolete content
dircreate creates a new directory. method of file object syntax int dircreate( filespecobject dirtocreate ); parameters the dircreate method has the following parameters: dirtocreate a filespecobject representing the pathname of the directory to create. returns an integer error code. for a list of possible values, see return codes.
description the input parameter is a filespecobject that you have already created with the install object's getfolder method. the following simple example demonstrates the use of the dircreate method. note that the getfolder method does not require that the folder or directory you specify exist in order for the object reference to be a valid one. example f = getfolder("program", "mynewdirectory"); err = file.dircreate(f); ...
diskSpaceAvailable - Archive of obsolete content
thod of file object syntax double diskspaceavailable ( string nativefolderpath ); parameters the diskspaceavailable method has the following parameters: nativefolderpath a string representing the pathname of the partition, a file, or a directory on the partition whose space is being queried. returns a double number representing the amount of space, in bytes, on the queried drive.
description use this function to make sure there is adequate space on the local disk for extracting and installing your files (see example below). you can use a string representing any file on the disk you want to check, and xpinstall will resolve the reference to the partition itself. example var diskamtneeded = 10000; f = getfolder("program"); diskspace = file.diskspaceavailable(f); g = getfolder(f, "myfil...
execute - Archive of obsolete content
parameters the execute method has the following parameters: executablefile a filespecobject representing the local file already on disk to be executed. note that file names are case sensitive. aparameters an optional parameter string that is passed to the executable. (ignored on mac os) returns an integer error code. for a list of possible values, see return codes.
description the specified file is not actually executed until the performinstall method is called. see performinstall for more information about queued commands during the installation process. example f = getfolder("program", "mytexteditor.exe"); err = file.execute(f, "myfile.txt"); // indicates that 'myfile.txt' will be // opened in the editor ...
modDateChanged - Archive of obsolete content
syntax boolean moddatechanged (filespecobject asourcefolder, number anolddate); parameters the moddatechanged method has the following parameters: asourcefolder a filespecobject representing the file to be queried. anolddate a double representing the date. returns a boolean value indicating whether the file has been modified since the input date or has not.
description most often, the date passed in as the second parameter in moddatechanged is the returned value from a moddate on a separate file, as in the following example, in which the dates of two files are compared. example filesource1 = getfolder("program", "file1.txt"); filesource2 = getfolder("program", "file2.txt"); err1 = file.moddate(filesource1); // the baseline returned err2 = file.moddatecha...
move - Archive of obsolete content
e moves a file from one location to another. method of file object syntax int move( filespecobject source, filespecobject dest ); parameters the move method has the following parameters: source a filespecobject representing the source file. dest a filespecobject representing the target directory. returns an integer error code. for a list of possible values, see return codes.
description you must create a filespecobject for the destination directory to pass in for this function. if the destination doesn't already exist a file name for the destination is assumed. example source = getfolder("program", "file.txt"); dest = getfolder("chrome"); err = file.move(source, dest); ...
windowsShortcut - Archive of obsolete content
summary creates a windows shortcut to the installed software. method of file object syntax int windowsshortcut( folderobject atarget, folderobject ashortcutpath, string a
description, folderobject aworkingpath, string aparams, folderobject aicon, number aiconid); parameters the windowsshortcut method has the following parameters: atarget a filespecobject representing the absolute path (including filename) to file that the shortcut will be created for. ashortcutpath a filespecobject representing the absolute path (not including filename) to where the shortcut is to be created. a
description string
description for the shortcut to be used as the shortcut name with a .lnk extension (do not include .lnk in the string). aworkingpa...
addDirectory - Archive of obsolete content
as the path separator regardless of the platform.if subdir is missing, null, or "", the filenames are appended directly to the folder name specified by localdirspec. flags an optional field; reserved for future use. pass 0 as the default value. returns an integer error code. for a list of possible values, see return codes. in some situations, adddirectory may return other errors.
description the adddirectory method puts the files in the specified directory in a temporary location. to move the files and all other subcomponents to their final location, call the performinstall method after you've successfully added all subcomponents. also see the note about binaries on the macintosh platform in addfile. ...
addFile - Archive of obsolete content
ed in this location on the user's machine. you must always use forward slashes (/) in this pathname, regardless of the convention of the underlying operating system. if this parameter is blank or null, xpisourcepath is used. flags an optional field; reserved for future use. pass 0 as the default value. returns an integer error code. for a list of possible values, see return codes.
description the addfile method puts the file in a temporary location. to move this and all other files to their final location, call the performinstall method after you've successfully added all files. note: if you are installing binary files on a macintosh, be aware that the binary format for those files must be applesingle if the resource information is to be installed properly. some file transfer program...
deleteRegisteredFile - Archive of obsolete content
oves its entry from the client version registry. method of install object syntax int deleteregisteredfile (string registryname); parameters the deleteregisteredfile method has the following parameter: registryname the pathname in the client version registry for the file that is to be deleted. returns an integer error code. for a list of possible values, see return codes.
description the deleteregisteredfile method deletes the specified file and removes the file's entry from the client version registry. if the file is currently being used, the name of the file that is to be deleted is saved and netscape 6 attempts to delete it each time it starts up until the file is successfully deleted. this method is used to delete files that cannot be removed by the uninstall method or to...
execute - Archive of obsolete content
on mac os). see note below. blocking a boolean value that specifies whether the installation should wait for the execution of the file to finish before it resumes. default is false. see note below. the blocking parameter is not available as part of this method in versions of netscape before 6.1/mozilla 0.9.3. returns an integer error code. for a list of possible values, see return codes.
description the execute method extracts the named file from the xpi file to a temporary file name. your code must call the performinstall method to actually execute the file. you can use this method to launch an installshield installer or any install executable file stored in a xpi file. executing installed files note: if the file you wish to execute is one you are installing (as opposed to an installer e...
gestalt - Archive of obsolete content
gestalt (macintosh only) retrieves information about the operating environment. method of install object syntax int gestalt ( string selector ); parameters the gestalt method takes the following parameters: selector the selector code for the information you want. returns returns the requested information. the format depends on the select code specified in the selector parameter.
description the gestalt method is a wrapper for the gestalt function of the macintosh toolbox. for information on that function, see inside macintosh: operating system utilities. this method returns null on unix and windows platforms. ...
getComponentFolder - Archive of obsolete content
tring that specifies the name of a subdirectory. if the specified subdirectory doesn't exist, it is created. this parameter is available in netscape 6 and may be case sensitive (depending on the operating system). returns an object representing the directory in which the component is installed, or null if the component could not be found or if subdirectory refers to a file that already exists.
description the getcomponentfolder method to find the location of a previously installed software package. typically, you use this method with the addfile method or the adddirectory method. ...
getWinProfile - Archive of obsolete content
le); parameters the getwinprofile method has the following parameters: folder an object representing a directory. you create this object by passing a string representing the directory to the getfolder method. file a relative pathname to an initialization file in the directory specified by the folder parameter, such as "royal/royal.ini". returns a winprofile object.
description the getwinprofile method creates an object for manipulating the contents of a windows .ini file. once you have this object, you can call its methods to retrieve strings from the file or to add strings to the file. for information on the returned object, see winprofile. this method returns null on unix and macintosh platforms. example to edit the win.ini file, you would create a winprofile object ...
getWinRegistry - Archive of obsolete content
getwinregistry (windows only) constructs an object for working with the windows registry. method of install syntax winreg getwinregistry(); parameters none. returns a winreg object.
description use the getwinregistry method to create an object for manipulating the contents of the windows registry. once you have this object, you can call its methods to retrieve or change the registry's content. for information on the returned object, see winreg. this method returns null on unix and macintosh platforms. ...
loadResources - Archive of obsolete content
loadresources loads a properties file. method of install object syntax object loadresources( string xpipath ); parameters the sole input parameter for loadresources is a string representing the path to the properties file in the xpi in which the key/value pairs are defined. returns a javascript object whose property names are the keys from that file and whose values are the strings.
description the format of the properties file expected by loadresources is the same as that of the chrome locale .properties files. this method is used to internationalize installation scripts by allowing the installer to retrieve localized string values from a separate file. be aware that the parameter specifies the file within the xpi and not on the file system, as the following example demonstrates. example gi...
logComment - Archive of obsolete content
logcomment adds a comment line to the installation log. method of install object syntax int logcomment( string acomment ); parameters the sole input parameter is a string whose value will be written to the log during the installation process. returns an integer error code. for a list of possible values, see return codes.
description the install log is created in the product directory by default (where the browser executable is) if it can be, and if the installation doesn't have proper permission, the install log is written to the user's profile directory. respectively, these directories correspond to the "program" and "current user" keywords for the getfolder method. ...
patch - Archive of obsolete content
relativelocalpath a pathname relative to the localdirspec parameter that identifies the subcomponent that is to be patched. you must always use forward slashes (/) in this pathname, regardless of the convention of the underlying operating system. if this parameter is blank or null, xpisourcepath is used. returns an integer error code. for a list of possible values, see return codes.
description the patch method to update an existing component by applying a set of differences between two known versions. the set of differences is in gdiff format and is created by the nsdiff utility. a patch can only be applied between two known versions. if the existing version of the file does not match the checksum stored in the gdiff file, patch returns an error without applying the patch. after pat...
refreshPlugins - Archive of obsolete content
efreshplugins refreshes the list of plug-ins registered for the browser. method of install object syntax int refreshplugins( [ areloadpages ] ); parameters the refreshplugins method has the following parameter: areloadpages areloadpages is an optional boolean value indicating whether you want to reload the open web pages after you have refreshed the plug-in list. returns nothing.
description refreshplugins lets you register new plug-ins without having to restart the browser. when you use this method in an installation script, as the example below demonstrates, you can install new plug-ins and use them to display the requested media in a web page without interrupting the experience of the user. note that refreshplugins must be called after the performinstall method that initiates the ...
registerChrome - Archive of obsolete content
e xpi in where the contents.rdf file defining the chrome is located. for example, "locale/mylocale/aim," points to the locale/mylocale/aim subdirectory of the same xpi file in which the installation script is located. returns an integer error code. for a list of possible values, see return codes. in some situations the method may return other errors. in a few cases you may get a registry error.
description when the third parameter is omitted (pointing to a specific location within the xpi file), this function is being used in a somewhat deprecated way. in this case, registerchrome is supporting the old format of installation archives, in which the manifest.rdf file was always located at the highest level of the installation archive. in this case, registerchrome does not require a path inside the ar...
resetError - Archive of obsolete content
reseterror resets a saved error code to zero. method of install object syntax void reseterror (); parameters none. returns nothing.
description the reseterror method resets any saved error code to zero. see getlasterror for additional information. example to reset the last error code to zero: reseterror(); ...
setPackageFolder - Archive of obsolete content
setpackagefolder sets the default package folder. method of install object syntax void setpackagefolder ( object folder); parameters the setpackagefolder method has the following parameter: folder an object representing a directory. you create this object by passing a string representing the directory to the getfolder or getcomponentfolder method. returns none.
description the setpackagefolder method to set the default package folder that is saved with the root node. when the package folder is set, it is used as the default for forms of addfile and other methods that have an optional localdirspec parameter. you should only call this method once, and you should always call it immediately after you call initinstall. if you call setpackagefolder multiple times, the last folde...
getString - Archive of obsolete content
getstring retrieves a value from a .ini file. method of winprofile object syntax string getstring ( string section, string key); parameters the method has the following parameters: section section in the file, such as "boot" or "drivers". key the key in that section whose value to return. returns the value of the key or an empty string if none was found.
description the getstring method is similar to the windows api function getprivateprofilestring. unlike that function, this method does not support using a null key to return a list of keys in a section. example to get the name of the wallpaper file from the desktop section of the win.ini file, use this call: ini = getwinprofile (getfolder("windows"), "win.ini"); var wallpapervalue = ini.getstring ("desktop", "w...
writeString - Archive of obsolete content
ni file. method of winprofile object syntax boolean writestring ( string section, string key, string value); parameters the method has the following parameters: section section in the file, such as "boot" or "drivers". key the key in that section whose value to change. value the new value. returns true if successfully scheduled, otherwise, false.
description the writestring method is similar to the windows api function writeprivateprofilestring. to delete an existing value, supply null as the value parameter. unlike the writeprivateprofilestring function, this method does not support using a null key to delete an entire section. values are not actually written until performinstall is called. example to set the name of the wallpaper file from the des...
createKey - Archive of obsolete content
createkey adds a key to the registry. method of winreg object syntax int createkey ( string subkey, string classname); parameters the method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". classname usually an empty string. for information on this parameter, see the
description of regcreatekeyex in your windows api documentation. returns 0 if it succeeded; a nonzero number if it failed to schedule the creation. for a list of possible values, see return codes.
description the createkey method adds a key to the registry. you must add a key to the registry before you can add a value for that key. ...
enumKeys - Archive of obsolete content
( string key, int subkeyindex ); parameters the enumkeys method has the following parameters: key the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". subkeyindex an integer representing the 0-based index of the subkey being sought. returns the name if it succeeded; null if the referenced value does not exist.
description enumkeys can be used to iterate through the subkeys at a given key location. the following example shows how to use enumkeys to find the plugins subdirectory below the various mozilla-based browser installations. var winreg = getwinregistry(); winreg.setrootkey(winreg.hkey_local_machine); var index = 0; var basekey = "software\\mozilla"; while ( (mozillaversion = winreg.enumkeys(basekey,index)) !
enumValueNames - Archive of obsolete content
parameters the enumvaluenames method has the following parameters: key the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". subkeyindex an integer representing the 0-based index of the key value being sought. returns the value of the key as a string if it succeeded; null if the referenced subkey does not exist.
description enumvaluenames can be used to iterate through the values for a given key. the following brief example retrieves a key value using this method. var winreg = getwinregistry(); winreg.setrootkey(winreg.hkey_local_machine); v1 = winreg.enumvaluenames("software\\mozilla\\", 0); logcomment("the first subkey value of the mozilla key: " + v1) ...
getValue - Archive of obsolete content
subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". valname the name of the value-name/value pair whose value you want. returns a winregvalue object representing the value of the named value-name/value pair or null if there is no value or if there is an error. see winregvalue for information about these values.
description the getvalue method retrieves the value of an arbitraty key. use this method if the value you want is not a string. if the value is a string, the getvaluestring method is more convenient. ...
getValueString - Archive of obsolete content
the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". valname the name of the value-name/value pair whose value you want. returns a string representing the value of the named value-name/value pair or null if there's an error, the value is not found, or the value is not a string.
description the getvaluestring method gets the value of a string. if the value is not a string, use the getvalue method instead. ...
keyExists - Archive of obsolete content
keyexists returns whether the key exists. method of winreg object syntax boolean keyexists ( string key); parameters the method has the following parameter: key a string representing the path to the key returns boolean value
description if the user does not have read access to the given key, this will also return false. example winreg = getwinregistry(); if ( winreg != null ) { winreg.setrootkey( winreg.hkey_local_machine); if(winreg.keyexists("software\\mozilla")) { //keyexists returned true } else { //keyexists returned false } } ...
setRootKey - Archive of obsolete content
when you create a winreg object, it is set to access keys under the hkey_classes_root portion of the registry. if you want to access keys in another portion, you must use this method to change the root key. ...
setValue - Archive of obsolete content
h as "software\\netscape\\navigator\\mail". valname the name of the value-name/value pair whose value you want to change. value a winregvalue object representing the new non-string value. see winregvalue for information about these values. returns 0 if it succeeded; a nonzero number if it failed to schedule the action. for a list of possible values, see return codes.
description the setvalue method sets the value of an arbitrary key. use this method if the value you want to set is not a string. if the value is a string, the setvaluestring method is more convenient. ...
setValueNumber - Archive of obsolete content
the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". valname the name of the value-name/value pair whose value you want to change. value a number representing the new string value. returns 0 if it succeeded; a nonzero number if it failed to schedule the action. for a list of possible values, see return codes.
description the setvaluenumber method sets the value of a key when that value is a number. use this method if the value you want to set is a number. if the value is not a number, use the setvalue or setvaluestring methods instead. ...
setValueString - Archive of obsolete content
: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". valname the name of the value-name/value pair whose value you want to change. value the new string value. returns 0 if it succeeded; a nonzero number if it failed to schedule the action. for a list of possible values, see return codes.
description the setvaluestring method sets the value of a key when that value is a string. use this method if the value you want to set is a string. if the value is not a string, use the setvalue method instead. ...
WinRegValue - Archive of obsolete content
winregvalue.reg_multi_sz = 7 winregvalue.reg_resource_list = 8 winregvalue.reg_full_resource_descriptor = 9 winregvalue.reg_resource_requirements_list = 10 regdata a java byte array containing the data. returns a new winregvalue object, with the data members type and data set to the values passed to this constructor.
description advanced windows developers can use this object to manipulate non-string values for the windows registry. an object of this type has two fields: the type of the data and the value. for information on the possible data types for a registry value, see your windows api documentation. you supply the value for these fields to the constructor for this class. ...
XPInstall - Archive of obsolete content
nger available. extension, theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. <?xml version="1.0" encoding="utf-8"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <
description about="urn:mozilla:install-manifest"> <!-- properties --> </
description> </rdf> cross-platform install (xpinstall) is a technology used by mozilla application suite, mozilla firefox, mozilla thunderbird and other xul-based applications for installing extensions. an xpi (pronounced "zippy" and derived from xpinstall) installer module is a zip file that contains an install script or manifes...
A XUL Bestiary - Archive of obsolete content
t place in which to write event handlers -- so convenient, in fact, that the term "event handler" is often used to describe both the event listener attribute and the event handler code you write within it. to create an event handler, simple place the code you want executed within the appropriate event listener: <menuitem value="click me" onclick="alert('event handled.')" /> it follows from the
description above that event handlers can be written for events that are fired somewhere below them in the hierarchy. a menubar in xul, for instance, can contain event handlers for events fired by its child menuitems. mozilla xparchitecture mozilla is obviously a lot more than simply an interface. it's cross-platform, and standards-based, and yet in some way, the event handlers written once in javascript a...
accesskey - Archive of obsolete content
this should be one of the characters that appears in the label attribute for the element. on non-macintosh platforms, the character on the element's label matching the accesskey is underlined. for example, when a menu labeled 'file' has an accesskey of 'f', the generated label will be 'file'. ...
Attribute (XUL) - Archive of obsolete content
ns checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed color cols command commandupdater completedefaultindex container containment contentcontextmenu contenttooltip context contextmenu control crop curpos current currentset customindex customizable cycler datasources decimalplaces default defaultbutton defaultset
description dir disableautocomplete disableautoselect disableclose disabled disablehistory disablekeynavigation disablesecurity dlgtype dragging editable editortype element empty emptytext deprecated since gecko 2 enablecolumndrag enablehistory equalsize eventnode events expr firstdayofweek firstpage first-tab fixed flags flex focused forcecomplete grippyhidden grippytooltipte...
Deprecated and defunct markup - Archive of obsolete content
-neil 03 march 2011 <slider> (clickable tray in <scrollbar> which holds <thumb>; do not use alone) also used as part of <scale> --neil 03 march 2011 <spinner> (spinbox; <spinbuttons> with a textbox whereby spinning affects value in textbox; not usable) <spring> (use @flex instead) <strut> (replaced by @debug?) <tabcontrol> (contained tabbox and tabpanel) <text> (like <label> or <
description> but does not wrap; like <label crop="end">; had been used in menus/toolbars) <textfield> (like <textbox>) <thumb> (<button> with deprecated <gripper>; implements sliding box in center of scrolbar) <title> (to add a caption on a <titledbox> <titledbox> (box with a frame) <titledbutton> (attempt to combine text and images before <button>) <toolbarpaletteitem> required to embed no...
CheckboxStateChange - Archive of obsolete content
the checkboxstatechange event is executed when the state of a <checkbox> element has changed. this event is used mainly for an accessibility purpose. general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean does the event normally bubble? cancelable read only boolean is it possible to cancel the event? related events valuechange radiostatechange ...
DOMMenuItemActive - Archive of obsolete content
the dommenuitemactive event is executed when a <menu> or a <menuitem> has been hovered or highlighted. general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
DOMMenuItemInactive - Archive of obsolete content
the dommenuiteminactive event is executed when a <menu> or a <menuitem> in no longer hovered or highlighted. general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
RadioStateChange - Archive of obsolete content
the radiostatechange event is executed when the state of a <radio> element has changed. this event is used mainly for an accessibility purpose. general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean does the event normally bubble? cancelable read only boolean is it possible to cancel the event? related events checkboxstatechange valuechange ...
ValueChange - Archive of obsolete content
the valuechange event is executed when the value of an element, <progress> for example, has changed. this event is used mainly for an accessibility purpose. general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean does the event normally bubble? cancelable read only boolean is it possible to cancel the event? related events checkboxstatechange radiostatechange ...
broadcast - Archive of obsolete content
the broadcast event is executed when the attributes of the element (such as a broadcaster) being listened to are changed. the event handler should be placed on an observer. general info specification xul interface event bubbles no cancelable no target element default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
close - Archive of obsolete content
see example below). note that the close event is only fired when the user presses the close button on the titlebar; (i.e. not file -> quit). the unload event should be used to capture all attempts to unload the window. general info specification xul interface event bubbles no cancelable no target window default action the window is closed. properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. example window.addeventlistener("close", function( event...
command - Archive of obsolete content
a shortcut key. command elements can be activated by any of their observing elements being activated. the command event should always be used instead of the click event because it will be called in all of the needed cases. general info specification xul interface xulcommandevent bubbles yes cancelable yes target element default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not cancelable read only boolean whether the event is cancellable or not? view read only windowproxy document.defaultview (...
commandupdate - Archive of obsolete content
the commandupdate event is executed when a command update occurs on a <commandset>. this event would be used to update the disabled status of its commands. general info specification xul interface event bubbles no cancelable no target element default action none. properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
popuphidden - Archive of obsolete content
the popuphidden event is executed when a <menupopup>, <panel> or <tooltip> has become hidden. general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
popuphiding - Archive of obsolete content
the popuphiding event is executed when a <menupopup>, <panel> or <tooltip> is about to be hidden. general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
popupshowing - Archive of obsolete content
the popupshowing event is executed when a <menupopup>, <panel> or <tooltip> is about to become visible. the default action of the event can be prevented to prevent the popup to appear. general info specification xul interface popupevent bubbles yes cancelable yes target element default action a popup is displayed properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
popupshown - Archive of obsolete content
the popupshown event is executed when a <menupopup>, <panel> or <tooltip> has become visible. general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
How to implement a custom XUL query processor component - Archive of obsolete content
: 36, hair: "brown", eye: "brown"}, {name: "bill", age: 25, hair: "red", eye: "black"}, {name: "joe", age: 15, hair: "blond", eye: "blue"}, {name: "jimmy", age: 65, hair: "gray", eye: "dull"} ]; } templatequeryprocessor.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsixultemplatequeryprocessor]), class
description: "sample xul template query processor", classid: components.id("{282cc4ea-a49c-44fc-81f4-1f03cbb7825f}"), contractid: "@mozilla.org/xul/xul-query-processor;1?name=simpledata", getdatasource: function(adatasources, arootnode, aistrusted, abuilder, ashoulddelaybuilding) { // todo: parse the adatasources variable // for now, ignore everything and let's just signal that we have data ...
menulist.appendItem - Archive of obsolete content
« xul reference home appenditem( label, value,
description ) return type: element creates a new menuitem element and adds it to the end of the menulist. you may optionally set a value and
description. the function returns the new item. see also appenditem ...
openPopup - Archive of obsolete content
popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. position possible values for position are: before_start, before_end, after_start, after_end, start_before, start_after, end_before, end_after, overlap, and after_pointer. check positioning of the popup guide for a precise
description of the effect of the different values. x, y for an anchored popup, the x and y arguments may be used to offset the popup from its anchored position by some number, measured in css pixels. an unanchored popup appears at the position specified by x and y, relative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are...
Positioning - Archive of obsolete content
enuitem label="dog"/> </menupopup> </button> this technique is used internally for tooltips. if you notice in the firefox browser when a tooltip is opened it appears not at the mouse position, but slightly below it. this is because the default theme has a 21 pixel top margin on tooltips that moves them down by that much. this is used so that the tooltip doesn't cover up what it is providing a
description of. screen positioning the openpopupatscreen method may be used to open a popup via a script at a specific screen position. the section on the openpopupatscreen method provides more details. for all popups, the left and top attributes may be used to specify pixel coordinates of where the popup should appear on the screen. if these attributes are used, the popup will appear at the location the ...
Property - Archive of obsolete content
enttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi customtoolbarcount database datasources date dateleadingzero datevalue decimalplaces decimalsymbol defaultbutton defaultvalue
description dir disableautocomplete disableautocomplete disableautoselect disabled disablekeynavigation dlgtype docshell documentcharsetinfo editable editingcolumn editingrow editingsession editor editortype emptytext deprecated since gecko 2 enablecolumndrag eventnode firstordinalcolumn firstpermanentchild flex focused focuseditem forcecomplete group hand...
Filtering - Archive of obsolete content
ntries. then, we could just look for all resources that were of the 'country' type. we'll use this method here since we've already seen examples of generating results from a container. an rdf type can be assigned to a node by using the predicate 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' set to a resource for that type. in rdf/xml, a syntax shortcut may be used which involves replacing the
description tag with the type. we need to add the type to the two countries in the datasource, as well as ensure that the namespace is declared on the root rdf tag: <nso:country about="http://www.daml.org/2001/09/countries/iso#it" dc:title="italy"/> <nso:country about="http://www.daml.org/2001/09/countries/iso#nl" dc:title="netherlands"/> the type of these two resources, when exp...
Multiple Rules - Archive of obsolete content
we do not need any conditions for the second rule. where elements we saw in the example above how to compare a value exactly to a specific value. this would be useful for comparing a field that identified the type of a result. however, there are many different ways in which the where element may be used. beside the equals operator, there are several other operators that may be used. ...
RDF Query Syntax - Archive of obsolete content
point variable. so if a second rule were used, it would also need to use the ?start variable. the value of ?start is set to 'http://www.xulplanet.com/rdf/a'. you'll notice that this is the value of the ref attribute which is the desired starting node in the rdf graph. thus, the ?start variable becomes the container or reference variable. actually, in the current template implementation, the above
description isn't quite correct. the seed is actually an internal variable set to the container, in this case, the vbox, and the ?start variable is set to the ref later, but that is a minor detail that doesn't make templates more understandable. for this discussion, assume that so far we have a single potential result as above. the content tag doesn't do anything else at this point, meaning it doesn't add an...
Simple Example - Archive of obsolete content
rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:seq rdf:about="http://www.xulplanet.com/rdf/myphotos"> <rdf:li rdf:resource="http://www.xulplanet.com/ndeakin/images/t/palace.jpg"/> <rdf:li rdf:resource="http://www.xulplanet.com/ndeakin/images/t/canal.jpg"/> <rdf:li rdf:resource="http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg"/> </rdf:seq> <rdf:
description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" dc:title="palace from above"/> <rdf:
description rdf:about="http://www.xulplanet.com/ndeakin/images/t/canal.jpg" dc:title="canal"/> <rdf:
description rdf:about="http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg" dc:title="obelisk"/> </rdf:rdf> in this example, we have ...
Focus and Selection - Archive of obsolete content
se event handlers to highlight the element or display text on a status bar. the following example can be used to apply a function to handle a focus event. example 2 : source view <script> function displayfocus(){ var elem=document.getelementbyid('sbar'); elem.setattribute('value','enter your phone number.'); } </script> <textbox id="tbox1"/> <textbox id="tbox2" onfocus="displayfocus();"/> <
description id="sbar" value=""/> the focus event, when it occurs, will call the displayfocus function. this function will change the value of the text label. we could extend this example to remove the text when the blur event occurs. typically, you will use focus and blur events to update parts of the interface as the user selects elements. for instance, you might update a total as the user enters values in...
Groupboxes - Archive of obsolete content
eled border and a caption, although you can change the appearance using css. you can create a caption for your groupbox by inserting a caption element as the first child. groupboxes are box elements, so you can use the box attributes, such as orient and flex. a simple groupbox example the example below shows a simple groupbox: example 1 : source view <groupbox> <caption label="answer"/> <
description value="banana"/> <
description value="tangerine"/> <
description value="phone booth"/> <
description value="kiwi"/> </groupbox> this will cause four pieces of text to be displayed surrounded by a box with the label answer. note that the groupbox has a vertical orientation by default which is necessary to have the text elements stack in a single column. more complex captions you can also add c...
Introduction to XBL - Archive of obsolete content
havior describes the properties and methods of the scroll bar in addition to describing the xul elements that make up a scroll bar. like xul, xbl is an xml language, so it has similar syntax rules. the following example shows the basic skeleton of an xbl file: <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl"> <binding id="binding1"> <!-- content, property, method and event
descriptions go here --> </binding> <binding id="binding2"> <!-- content, property, method and event
descriptions go here --> </binding> </bindings> the bindings element is the root element of an xbl file and contains one or more binding elements. each binding element declares a single binding. the id attribute can be used to identify the binding, as in the example above. the template has two bind...
Manifest Files - Archive of obsolete content
older process does also apply to the new seamonkey 1.0 though. the codebase there has not yet adopted the "manifest" format. <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <rdf:seq about="urn:mozilla:package:root"> <rdf:li resource="urn:mozilla:package:myapplication"/> </rdf:seq> <rdf:
description about="urn:mozilla:package:myapplication" chrome:displayname="application title" chrome:author="author name" chrome:name="myapplication" chrome:extension="true"/> </rdf:rdf> content,install,url,file:///main/app/ create a directory somewhere on your disk. many people put this as a subdirectory inside mozilla's chrome directory, but this isn't necessary.
More Button Features - Archive of obsolete content
ributes are not specified when the default value can be used. buttons with extra content buttons may have arbitrary markup contained inside them, and it will be rendered inside the button. you probably wouldn't use this very often, but you might use it when creating custom elements. for example, the following will create a button where two of the words are red: example 4 : source view <button> <
description value="this is a"/> <
description value="rather strange" style="color: red;"/> <
description value="button"/> </button> any xul element may be placed inside the button. html elements will be ignored, so you need to wrap them inside a
description element. if you specify the label attribute on the button, it will override any content placed inside the button. button with menupopup you can place ...
Property Files - Archive of obsolete content
age character and the next word of the string ("50%off"). non-ascii characters, utf-8 and escaping gecko 1.8.x (or later) supports property files encoded in utf-8. you can and should write non-ascii characters directly without escape sequences, and save the file as utf-8 without bom. double-check the save options of your text editor, because many don't do this by default. see localizing extension
descriptions for more details. in some cases, it may be useful or needed to use escape sequences to express some characters. property files support escape sequences of the form: \uxxxx , where xxxx is a unicode character code. for example, to put a space at the beginning or end of a string (which would normally be stripped by the properties file parser), use \u0020 . in the next section, we will look at xb...
XUL Structure - Archive of obsolete content
nization mozilla is organized such that you can have as many components as you want pre-installed. each extension is something of a standalone component with a separate chrome url. mozilla also has one component for each installed theme and locale. each of these components, or packages, is made up of a set of files that describe the user interface for it. for example, the messenger component has
descriptions of the mail messages list window, the composition window and the address book dialogs. the packages that are provided with mozilla are located within the chrome directory, which is in the directory where you built mozilla. the chrome directory is where you find all the files that describe the user interface used by the mozilla browser, mail client, and other applications. typically, you put all...
Using nsIXULAppInfo - Archive of obsolete content
] .getservice(components.interfaces.nsixulappinfo); (for explanation see this creating xpcom article.) getting application information after you obtained the app info component, you can read its properties to get the application's id, human-readable name, version, platform version, etc. for complete list of nsixulappinfo's properties, please see nsixulappinfo interface
description. id you can tell which application you're running under using the nsixulappinfo.id property. const firefox_id = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; const thunderbird_id = "{3550f703-e582-4d05-9a08-453d09bdfdc6}"; const seamonkey_id = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}"; var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.int...
XUL Changes for Firefox 1.5 - Archive of obsolete content
k icons on a button, used on some platforms. for instance <button icon="help"> will create a button with a help icon. this is used typically on gnome systems where possible values are: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. <menulist> items in a <menulist> support the
description attribute to allow for extra descriptive text to appear beside an item's label. the menulist modification methods appenditem and insertitemat take an extra
description argument when creating items this way. <listbox> the removeitemat method was sometime non zero-based due to a bug (bug 236068). this has been fixed in firefox 1.5 and all code depending on this non zero-based behaviour should be ...
XULBrowserWindow - Archive of obsolete content
bprogresslistener2 nsisupportsweakreference note: this page is not complete at this time. see the linked interfaces for the definition of the implemented methods. you may also wish to refer to the implementation of xulbrowserwindow in browser/base/content/browser.js. method overview boolean hidechromeforlocation(in string alocation); attributes attribute type
description incontentwhitelist string[] an array of url strings for which chrome is automatically hidden. defaults to about:addons but extensions can append specific urls to the array. methods hidechromeforlocation determines whether or not browser chrome should be hidden for the specified location. by default, chrome is hidden for about:addons and any other pages in the in content wh...
The Implementation of the Application Object Model - Archive of obsolete content
te xul file. this nsxmlelement implements a whole slew of interfaces, since raptor has multiple apis for referring to these objects. examples of these interfaces include nsidomelement, nsidomnode, nsixmlcontent, and nsicontent. what is rdf? rdf (pronounced r-d-f) has never been a ravening demon intent upon taking over the earth, although that does depend on who you ask. rdf stands for resource
description framework, a rather intimidating name that doesn't do much to help the layman understand exactly what it does. rdf provides a very general mechanism for representing relationships between different disparate types of data. the relationships between data are represented as a directed labeled graph structure. the data itself can be fed in from any number of different sources (e.g., from a local fil...
XUL Coding Style Guidelines - Archive of obsolete content
however, it might cause future maintenance headache: convert html files to xul files. use the xml declaration. use namespace. case sensitivity. use chrome urls. javascript code shall be moved out of xul. dtd declaration. predefined entities. other guidelines mentioned in xhtml 1.1 recommendation. see details here. making xul localizable -- mandatory in the past, ui (display) related resource
descriptions are stored in *.rc (for windows client) or *.ad (for unix client) so that they can be localized for a specific language or culture. in the new world, mozilla 5.0, this is not true any more. most of the windows and dialogs in mozilla will be described using xul. to make xul stream/file localizable, several guidelines are to be adopted to make the translation work easier and less error-prone. the ...
deck - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that displays only one of its children at a time. the selectedindex attribute determines which child is displayed. more information is available in the xul tutorial. attributes selectedindex properties selectedindex, selectedpanel examples <deck selectedindex="2"> <
description value="this is the first page"/> <button label="this is the second page"/> <box> <
description value="this is the third page"/> <button label="this is also the third page"/> </box> </deck> attributes selectedindex type: integer gets and sets the index of the currently selected panel. the first item is at index 0. inherited from xul element align, allowevents, allownegativeas...
dialog - Archive of obsolete content
g, centerwindowonscreen, getbutton, movetoalertposition examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel" buttonlabelcancel="cancel" buttonlabelaccept="save"> <dialogheader title="options"
description="my preferences"/> <groupbox> <caption label="colour"/> <radiogroup> <radio label="red"/> <radio label="green" selected="true"/> <radio label="blue"/> </radiogroup> <label value="nickname"/> <textbox/> </groupbox> </dialog> attributes activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foregr...
elements - Archive of obsolete content
a action arrowscrollbox b bbox binding bindings box broadcaster broadcasterset button browser c checkbox caption colorpicker column columns commandset command conditions content d deck
description dialog dialogheader e editor grid grippy groupbox h hbox i iframe image k key keyset l label listbox listcell listcol listcols listhead listheader listitem m member menu menubar menuitem menulist menupopup menuseparator o observes overlay p page popup popupset preference preferences prefpane prefwindow progressmeter r radio radiogroup resizer richlistbox richlistitem resizer row rows rule s script scrollbar scrollbox scrollcorner sep...
label - Archive of obsolete content
ain this class causes the element to be displayed with no border or margin. small-margin this class causes the text to be displayed with a smaller margin. text-link labels with this class may be focused and the click handler run or the address in the href attribute opened on a mouse click or enter key press. labels will appear like a link (blue and underlined). related elements
description attributes label interfaces nsiaccessibleprovider, nsidomxullabelelement notes labels are not focusable note: starting in gecko 2.0, labels are properly not focusable. they used to incorrectly inherit from nsidomxulcontrolelement. the caption is in the "value" attribute remember that the label element has a "value" attribute, unlike value in html whereas buttons, checkboxes us...
menupopup - Archive of obsolete content
popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. position possible values for position are: before_start, before_end, after_start, after_end, start_before, start_after, end_before, end_after, overlap, and after_pointer. check positioning of the popup guide for a precise
description of the effect of the different values. x, y for an anchored popup, the x and y arguments may be used to offset the popup from its anchored position by some number, measured in css pixels. an unanchored popup appears at the position specified by x and y, relative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are...
preferences - Archive of obsolete content
nheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods void firechangedevent(in domelement preference); creates and dispatches a changed (non-bubbling) event to the specified preference element. also executes code specified in onchanged attribute of the element. see also the
description of change event of <preference>. void observe(in nsisupports asubject, in string atopic, in wstring adata); nsiobserver method used internally to react to changes to preferences listed as children of this element. inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), g...
prefpane - Archive of obsolete content
the former is specified using a preferences element while the latter may be specified using other xul elements. both may be specified directly as children of the prefpane element, or the src attribute may be used to put a pane in a separate file. ...
tooltip - Archive of obsolete content
popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. position possible values for position are: before_start, before_end, after_start, after_end, start_before, start_after, end_before, end_after, overlap, and after_pointer. check positioning of the popup guide for a precise
description of the effect of the different values. x, y for an anchored popup, the x and y arguments may be used to offset the popup from its anchored position by some number, measured in css pixels. an unanchored popup appears at the position specified by x and y, relative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are...
tree - Archive of obsolete content
trees are used, as listed below. the second column lists the interfaces available via the tree's view property. the third column indicates whether treeitem element are used. if you would like to allow the tree to be horizontally scrolled, simply set the width attributes for each column to make the tree wider than its containing object. tree type view interfaces has dom nodes?
description content tree nsitreeview, nsitreecontentview yes this tree has treeitem elements placed within the treechildren element. in this situation, a content view (which implements the interface nsitreecontentview) which is a more specialized type of view, uses the treeitem elements and their descendants to determine the data to display in the tree. however, the treeitems are not displa...
triple - Archive of obsolete content
e can be included inside a rule's conditions element. it is used to check for an assertion within a graph. if such an assertion exists, the rule may match, assuming that all the conditions match. if the assertion does not exist, the rule will not match. both the subject and object attributes may be variables. the subject of a triple is an rdf resource. in an rdf file this would usually be an rdf
description element. the predicate would be a child element or property. for example, for a bookmark resource, the name and url would be predicates. they should be specified in their full uri form. the object is the value of the rdf property. more information is available in the xul tutorial. attributes object, predicate, subject examples (example needed) attributes object type: string the o...
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
s one? nope. mozilla has a separate makefile.in for each directory that is part of the build. in this case, you'll be a happy, healthier and more well-balanced if you don't try to understand the file at all. just copy it from mccoy. you don't even have to substitute in your application name for mccoy since it uses the app_name variable. application.ini - used for application packaging. a complete
description can be found in xul application packaging. in this case you can basically copy over the file as is, since once again variables are used for things like the application name and version. but you will have to change the id to something unique to your app. default-prefs.js - these are the default mozilla preferences used by xulrunner when running your app. the important ones are described in xulrunn...
Dialogs in XULRunner - Archive of obsolete content
uttonlabelaccept="set favorite" buttonaccesskeyaccept="s" ondialogaccept="return dosave();" buttonlabelcancel="cancel" buttonaccesskeycancel="n" ondialogcancel="return docancel();"> <script> function dosave(){ //dosomething() return true; } function docancel(){ return true; } </script> <dialogheader title="my dialog"
description="example dialog"/> <groupbox flex="1"> <caption label="select favorite fruit"/> <radiogroup> <radio id="1" label="oranges because they are fruity"/> <radio id="2" selected="true" label="strawberries because of color"/> <radio id="3" label="bananna because it pre packaged"/> </radiogroup> </groupbox> </dialog> xul window elements have a special method to open d...
XULRunner tips - Archive of obsolete content
default, the task bar on windows might group windows belonging to the same process into one button to save space. this button is usually called "xulrunner.exe" and has xulrunner's icon. there are two approaches to display the branding of your application instead: when compiling xulrunner yourself: create a file module.ver in the directory mozilla/xulrunner/app with the contents: win32_module_
description=myapplication myapplication should be replaced by whatever you want to see as title of the button. you can also replace xulrunner.ico in the same directory to change xulrunner's icon to the icon of your application. with a precompiled xulrunner: use xulrunner-stub.exe to start your application but rename it into myapplication.exe. with xulrunner 1.9 this will make the desired name appear in...
calIFileType - Archive of obsolete content
in caliimporter and caliexporter to determine which file types are supported for import/export. status: unfrozen. defined in calendar/base/public/caliimportexport.idl interface code [scriptable, uuid(efef8333-e995-4f45-bdf7-bfcabbd9793e)] interface califiletype : nsisupports { readonly attribute astring defaultextension; readonly attribute astring extensionfilter; readonly attribute astring
description; }; attributes defaultextension the default extension that should be associated with files of this type. extensionfilter the extension filter to use in the filepicker's filter list. separate multiple extensions with semicolon and space.
description the
description to show to the user in the filter list. methods none. related interfaces caliimporter caliexporter example code see calhtmlexport.js.
nsIContentPolicy - Archive of obsolete content
in general, you should try not to use this type unless none of the others is a fit. type_script 2 indicates an executable script (such as javascript). type_image 3 indicates an image (for example, <img> elements). type_stylesheet 4 ind...
2006-10-06 - Archive of obsolete content
cin suggests writing an introductory article for potential developers containing basic project information (history, list of main developers, project goals, roadmap and available communication channels, etc), tools needed to start developing and building tb, documentation on source structure as well as links to help one get started on the project. david bienvenu suggests a top down architectural
description of tb's data structures along with documentation about extracting them. brian king also mentions that documentation on handling message headers on the ui side would be helpful. cédric corazza recommends that the proposed documention should be made available on the l10n cvs once it reaches a decent stage so that localizers can get a head-start on the localization before the final version is mad...
NPAnyCallbackStruct - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary note: this structure is only used on unix platforms. contains information required during embedded mode printing. syntax typedef struct { int32 type; } npanycallbackstruct; fields the data structure has the following field: type always contains np_print.
description callback structures are used to pass platform-specific information. the npanycallbackstruct structure contains information required by the platformprint field of the npembedprint structure during embedded mode printing. during printing in embedded mode, the platformprint field of the npembedprint structure points to an npanycallbackstruct. this structure contains the file pointer to which the plug-in should write its postscript data. at the time the...
NPByteRange - Archive of obsolete content
wing fields: offset offset in bytes to the start of the requested range. this value may be either positive or negative: positive value: offset from the beginning of the stream. negative value: offset from the end of the stream. length number of bytes to fetch from the specified offset. next points to the next npbyterange request in the list of requests, or null if this is the last request.
description the plug-in seeks within a stream by building a linked list of one or more npbyterange objects, which represents a set of discontiguous byte ranges. the only plug-in api call that uses the npbyterange type is npn_requestread(), which lets the plug-in read specified parts of a file without downloading it. the plug-in is responsible for deleting npbyterange objects when finished with them. the brow...
NPEmbedPrint - Archive of obsolete content
during embedded mode printing. syntax typedef struct _npembedprint { npwindow window; void* platformprint; /* platform-specific */ } npembedprint; fields the data structure has the following fields: window the npwindow the plug-in should use for printing. platformprint additional platform-specific printing information. mac os: thprint unix: pointer to a npprintcallbackstruct.
description the npp_print function passes a pointer to an npprint object (previously allocated by the browser) to the plug-in. the npembedprint structure is used when the mode field of npprint is set to np_embed. unix the plug-in location and size in the npwindow are in page coordinates (720/ inch), but the printer requires point coordinates (72/inch). see also npfullprint, np_port, npp_print, npprint, npp...
NPFullPrint - Archive of obsolete content
ints full-page. false: (default) plug-in renders its area of the page only (for embedded plug-in). printone not currently in use. should always be false. true: print single copy of page to the default printer. false: display print dialogs so user can choose printer, other options. platformprint platform-specific printing information. mac os: thprint ms windows: printer's device context
description the npp_print function passes the plug-in a pointer to an npprint object (previously allocated by the browser). the npfullprint structure is used when the mode field of npprint is set to np_full. the pluginprinted field of this structure determines whether the plug-in prints in full-page mode or not. if you want the plug-in to take complete control of the printing process, it should print the ful...
NPN_CreateObject - Archive of obsolete content
gecko plugin api reference « scripting plugins summary allocates a new npobject. syntax #include <npruntime.h> npobject *npn_createobject(npp npp, npclass *aclass); parameters the function has the following parameters: <tt>npp</tt> the npp indicating which plugin wants to instantiate the object. <tt>aclass</tt> the class to instantiate an object of. returns the newly-allocated npobject.
description if the given npclass provides an allocate function it is used to allocate the storage for the object and the npp argument passed to npn_createobject() is passed along to that function. if no allocate function is provided, malloc() is called to allocate enough memory to hold an npobject. the newly created npobject's reference count is initialized to 1 before it is returned. ...
NPN_DestroyStream - Archive of obsolete content
completed normally; all data was sent by the plug-in to the browser. npres_user_break: plug-in is terminating the stream due to a user request. npres_network_err: stream failed due to network problems. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes.
description the plug-in calls the npn_destroystream() function to close and delete a stream. this stream can be either a stream that the browser created and passed to the plug-in in npp_newstream(), or a stream created by the plug-in through a call to npn_newstream(). see also npp_destroystream() npn_newstream() npp_newstream() npstream npp ...
NPN_Evaluate - Archive of obsolete content
); parameters the function has the following parameters: npp the npp indicating which plugin instance's window to evaluate the script in. npobj the scope object. script the script to evaluate. result on return, contains the value returned by the script. can't be null. returns true if the script was evaluated successfully, otherwise false.
description the script is evaluated in the context of the window that the calling plugin instance (the <tt>npp</tt> argument) is loaded in. note: the caller must call npn_releasevariantvalue() to release the returned value when it's no longer needed. ...
NPN_ForceRedraw - Archive of obsolete content
owser side plug-in api summary asks the plugin host to immediately (synchronously) repaint invalid areas. note: as of firefox 4, this function no longer has any effect when running with separate plugin processes. syntax #include <npapi.h> void npn_forceredraw(npp instance); parameters the function has the following parameters: instance plug-in instance for which the function forces redrawing.
description once a region of a windowless plugin has been invalidated with npn_invalidaterect() or npn_invalidateregion(), a plug-in can call npn_forceredraw() to force a paint message. this causes a synchronous update event or paint message for the plug-in. browsers may ignore this request. see also drawing and event handling npn_invalidaterect() npn_invalidateregion() npp_handleevent() npp ...
NPN_GetAuthenticationInfo - Archive of obsolete content
esult buffer will be allocated with npn_memalloc; the plugin is responsible for freeing the buffer. note: the password may have internal null bytes and may not be null-terminated. plen out parameter. the length of the returned password buffer. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes.
description plugin which implement their own http networking stack (such as the java plugin) may want to use the standard http auth prompts and password managed of the browser. this function allows the plugin to ask the browser for http authentication information for a domain. unless the plugin has special networking needs, it is recommended to use the standard network apis, such as npn_geturlnotify/npn_post...
NPN_GetStringIdentifier - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary returns an opaque identifier for the string that is passed in. syntax #include <npruntime.h> npidentifier npn_getstringidentifier(const nputf8 *name); parameters the function has the following parameters: <tt>name</tt> the string for which an opaque identifier should be returned. returns an npidentifier identifying the string.
description all calls for the same string are guaranteed to return the same exact identifier. ...
NPN_GetStringIdentifiers - Archive of obsolete content
has the following parameters: names an array of strings for which opaque identifiers should be returned. namecount the number of strings in the names array. identifiers a pointer to the first element of an array to fill with the identifiers for the strings specified by names. returns on return, the identifiers array is filled out with the identifiers for each of the strings in the names array.
description as is the case with npn_getstringidentifier(), all calls for the same strings are guaranteed to return the same exact identifiers. ...
NPN_GetURL - Archive of obsolete content
creates a new stream and delivers the data to the current instance regardless of the mime type of the url. in general, if a url works in the location box of the browser, it works here, except for the _self target. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes.
description npn_geturl() is used to load a url into the current window or another target or stream. plug-ins can use this capability to provide hyperlinks to other documents or to retrieve data from anywhere on the network. this is especially useful for enabling an existing application to operate on the web. for http urls, the browser resolves this method as the http server method get, which requests url obj...
NPN_GetValue - Archive of obsolete content
returns the name of the plug-in in the value parameter. gecko 1.9.2 note starting with gecko 1.9.2 (firefox 3.6), the variables npnvservicemanager, npnvdomelement, and npnvdomwindow are no longer supported. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes.
description npn_getvalue returns the browser information set with npn_setvalue. the queried information is returned in the value parameter. unix the platform-specific values for this parameter are npnvxdisplay (the current display), npnvxtappcontext (the browser's xtappcontext), and npnvnetscapewindow (the browser toplevel window in which the plugin is displayed). you can use npnvnetscapewindow to obtain the...
NPN_GetValueForURL - Archive of obsolete content
nal null bytes and may not be null-terminated. when multiple cookies are returned for a given url, the format of the return value is: cookie1=value1;cookie2=value2;cookie3=value3 len out parameter. the length of the returned value buffer. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes.
description this entry point is designed to allow plugins which implement their own http stacks to form requests to the web server in the same way the browser does. see also npn_setvalueforurl, npn_getauthenticationinfo ...
NPN_InvalidateRect - Archive of obsolete content
next repaints its contents. syntax #include <npapi.h> void npn_invalidaterect(npp instance, nprect *invalidrect); parameters the function has the following parameters: instance pointer to the plug-in instance to invalidate a portion of. invalidrect the area to invalidate, specified in a coordinate system that originates at the top left of the plug-in's content area.
description before a windowless plug-in can repaint or refresh part of its drawing area, the plug-in must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). npn_invalidaterect() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in. after calling this method, the plug-in receives a paint message asynchronously. the browser redraws inv...
NPN_InvalidateRegion - Archive of obsolete content
ior to repainting or refreshing a windowless plug-in. syntax #include <npapi.h> void npn_invalidateregion(npp instance, npregion invalidregion); parameters the function has the following parameters: instance pointer to the current plug-in instance. invalidregion the area to invalidate, specified in a coordinate system that originates at the top left of the plug-in.
description before a windowless plug-in can repaint or refresh part of its drawing area, the plug-in must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). npn_invalidateregion() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in. if a plug-in calls this method, it receives a paint message later. the browser redraws invalid areas ...
NPN_Invoke - Archive of obsolete content
unt the number of arguments in the args array. result a pointer to an npvariant to receive the result returned by the method. returns true if the method was successfully invoked, otherwise false. if the method was invoked successfully, any return value is stored in the npvariant specified by result. when the caller no longer needs the result, it must call npn_releasevariantvalue() to release it.
description the method arguments are passed as an array of npvariants, and the number of arguments is passed in. the result of the method invocation is returned through an npvariant result parameter. if the method invocation succeeds, npn_invoke() returns true, else false. note: early on in the development of the scriptability api this method used to be called npn_call() but was renamed for consistency. ...
NPN_InvokeDefault - Archive of obsolete content
he args array. result a pointer to an npvariant to receive the result returned by the default method. returns true if the default method was successfully invoked, otherwise false. if the default method was invoked successfully, any return value is stored in the npvariant specified by result. when the caller no longer needs the result, it must call npn_releasevariantvalue() to release it.
description the method arguments are passed as an array of npvariants, and the number of arguments is passed in. the result of the method invocation is returned through an npvariant result parameter. if the method invocation succeeds, npn_invoke() returns true, else false. ...
NPN_MemAlloc - Archive of obsolete content
memory from the browser's memory space. syntax #include <npapi.h> void *npn_memalloc (uint32 size); parameters the function has the following parameters: size size of memory, in bytes, to allocate in the browser's memory space. returns if successful, the function returns a pointer to the allocated memory, in bytes. if insufficient memory is available, the plug-in returns null.
description the plug-in calls npn_memalloc to allocate a specified amount of memory in the browser's memory space. if you allocate saved instance data with npp_destroy, be sure to use npn_memalloc to allocate memory. this ensures that the browser can free the saved data at a later time with the equivalent of npn_memfree. since the browser and plug-ins share the same memory space, npn_memalloc allows plug-ins...
NPN_MemFlush - Archive of obsolete content
os x. requests that the browser free a specified amount of memory. syntax #include <npapi.h> uint32 npn_memflush(uint32 size); parameters the function has the following parameters: size size of memory, in bytes, to free in the browser's memory space. returns if successful, the function returns the amount of freed memory, in bytes. if no memory can be freed, the browser returns 0.
description the plug-in calls npn_memflush() when it is not possible to call npn_memalloc(), for example, when calling system apis that indirectly allocate memory. to request that the browser free as much memory as possible, call npn_memflush() repeatedly until it returns 0. on the mac, you can use this method to free memory before calling memory-intensive system calls. in general, plug-ins should use npn_me...
NPN_MemFree - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary deallocates a block of allocated memory. syntax #include <npapi.h> void npn_memfree (void* ptr); parameters the function has the following parameters: ptr block of memory previously allocated using npn_memalloc.
description npn_memfree deallocates a block of memory that was allocated using npn_memalloc only. npn_memfree does not free memory allocated by any other means. see also npn_memalloc ...
NPN NewStream - Archive of obsolete content
current plug-in instance. type mime type of the stream. target name of the target window or frame, or one of several special target names. for values, see npn_geturl. stream stream to be created by the browser. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes.
description npn_newstream creates a new stream of data produced by the plug-in and consumed by the browser. the mime parameter is the mime type of the plug-in to create. a plug-in can create another instance of itself by specifying its own mime type and a new target name in a call to npn_newstream. the stream is returned in the stream parameter. the plug-in can use this object in subsequent calls to npn_writ...
NPN_PluginThreadAsyncCall - Archive of obsolete content
ugin, void (*func)(void *), void *userdata); parameters the function has the following parameters: plugin pointer to the current plug-in instance. func pointer to the function to call on the correct thread. userdata pointer to the data to pass to the function func once called. returns nothing.
description causes asynchronous execution of the specified function pointer on the "plug-in thread", passing in the specified user data pointer when it is called. the "plug-in thread" is the thread hosting the plug-in, which may be either the browser's main thread or the plug-in process if the plug-in is being executed out-of-process. it is the application's responsibility to perform any synchronization betw...
NPN_PostURL - Archive of obsolete content
file a boolean value that specifies whether to post a file. values: true: post the file whose path is specified in buf, then delete the file. false: post the raw data in buf. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes.
description npn_posturl works similarly to npn_geturl, but in reverse. npn_geturl reads data from the url and either displays it in the target window or delivers it to the plug-in. npn_posturl writes data from a file or buffer to the url and either displays the server's response in the target window or delivers it to the plug-in. if the target parameter is null, the new stream is passed to the plug-in r...
NPN_PostURLNotify - Archive of obsolete content
cal temporary file or data buffer that contains the data to post. file whether to post a file. values: true: post the local file whose path is specified in buf, then delete the file. false: post the raw data in buf. notifydata plug-in-private value for associating the request with the subsequent npp_urlnotify call, which returns this value (see
description below). returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes.
description npn_posturlnotify functions identically to npn_posturl, with these exceptions: npn_posturlnotify supports specifying headers when posting a memory buffer. npn_posturlnotify calls npp_url...
NPN_ReleaseVariantValue - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npn_releasevariantvalue() releases the value in the given variant. syntax #include <npruntime.h> void npn_releasevariantvalue(npvariant *variant); parameters the function has the following parameters: <tt>variant</tt> the variant whose value is to be released. returns nothing.
description npn_releasevariantvalue() releases the value in the given variant. this must always be called on result variants and such in this api, i.e. any npvariant whose value comes from a call that passes back an npvariant must be released using this function. access to the value in an npvariant that has been released will result in undefined behavior. npn_releasevariantvalue() will call npn_releaseobject() on npvariants of type npvariantt...
NPN_ReloadPlugins - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary reloads all of the installed plugins. syntax #include <npapi.h> void npn_reloadplugins(npbool reloadpages);code parameters the function has the following parameter: reloadpages whether to reload pages. if true, all pages are reloaded once the plugins are reloaded; otherwise, they aren't.
description npn_reloadplugins() reads the plugins directory for the current platform and reinstalls all of the plug-ins it finds there. normally, if you add or remove any plug-ins, the browser does not see them until you restart gecko. npn_reloadplugins() lets you install a new plug-in and load it, or to remove a plug-in, without having to restart the browser. you could use this function as part of the plug-in's installation process...
NPN_RequestRead - Archive of obsolete content
tion has the following parameters: stream stream of type np_seek from which to read bytes. rangelist range of bytes in the form of a linked list of npbyterange objects, each of which specifies a request for a range of bytes. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes.
description for a seekable stream, the browser sends data only in response to requests by the plug-in. the plug-in calls npn_requestread() to request data from a seekable stream. the plug-in can use this function to make one or more requests for ranges of bytes. these requests result in subsequent calls to npp_writeready() and npp_write(). for multiple requests, the function creates a linked list of npbytera...
NPN_SetValue - Archive of obsolete content
that the plugin dll should live longer than usual nppvpluginneedsxembed nppvpluginscriptablenpobject nppvformvalue nppvplugindrawingmodel value the value of the specified variable to be set. returns if successful, the function should return nperr_no_error. if unsuccessful, the function should return the most relevant npapi error code. for possible values, see error codes.
description a good place to set plugin operation mode such as windowless mode is npp_new, so the browser knows right away what mode the plugin is designed to operate in. nppvpluginwindowbool (windows and unix) specifies that the plugin operates in windowed mode. the alternative is windowless where no window messages are sent to the plugin as there is no window associated with it. in windowless mode all the...
NPN_SetValueForURL - Archive of obsolete content
upported type is npnurlvcookie. url the url for which to change information. value the new associated information for the url. note: the value may have internal null bytes and may not be null-terminated. len the length of the value buffer. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes.
description this entry point is designed to allow plugins to affect the cookies sent by the browser back to the server. see also npn_getvalueforurl, npn_getauthenticationinfo ...
NPN_Status - Archive of obsolete content
gin api reference « browser side plug-in api summary lets a plug-in display a message on the browser's status line. syntax #include <npapi.h> void npn_status(npp instance, const char* message); parameters the function has the following parameters: instance pointer to the current plug-in instance. message pointer the buffer that contains the status message string to display.
description you can use this function to make your plug-in display status information in the browser window, in the same place the browser does. if your plug-in has a button or other object that acts as a link when clicked, you can call npn_status() to display a
description or url when the user moves the cursor over it. the browser always displays the last status line message it receives, regardless of the m...
NPN_UTF8FromIdentifier - Archive of obsolete content
onding to the given string identifier. syntax #include <npruntime.h> nputf8 *npn_utf8fromidentifier(npidentifier identifier); parameters the function has the following parameter: <tt>identifier</tt> the string identifier whose corresponding string should be returned. returns a utf-8 string as a sequence of nputf8 bytes, or null if the specified <tt>identifier</tt> isn't a string identifier.
description once the caller is done with the returned string, the caller is responsible for deallocating the memory used by the string by calling npn_memfree(). ...
NPN_UserAgent - Archive of obsolete content
er's user agent field. this can be used to handle variations in different browsers (or versions thereof) when implementing your plug-in. syntax #include <npapi.h> const char* npn_useragent(npp instance); parameters the function has the following parameter: instance pointer to the current plug-in instance. returns a pointer to a buffer that contains the user agent field of the browser.
description the user agent is the part of the http header that identifies the browser during transfers. you can use this information to verify that the expected browser is in use, or you can use it in combination with npn_version() to supply different code for different versions of the same browser. see also npn_status() npn_version() gecko user agent string reference ...
NPN_Version - Archive of obsolete content
n_major pointer to a plug-in's major version number; changes with major code release number. plugin_minor pointer to a plug-in's minor version number; changes with point release number. netscape_major pointer to the browser's major version; changes with major code release number. netscape_minor pointer to the browser's version; changes with point release number.
description the values of the major and minor version numbers of the plug-in api are determined when the plug-in and the browser are compiled. for example, plug-in api version 4.03 has a major version number of 4 and a point release number of 3. this function gets the values from the plug-in rather than from the browser. a plug-in can use this function to check that the version of the plug-in api it is using...
NPN_Write - Archive of obsolete content
ger representing the number of bytes written (consumed by the browser). this number depends on the size of the browser's memory buffers, the number of active streams, and other factors. if unsuccessful, the plug-in returns a negative integer. this indicates that the browser encountered an error while processing the data, so the plug-in should terminate the stream by calling npn_destroystream().
description npn_write() delivers a buffer from the stream to the instance. a plug-in can call this function multiple times after creating a stream with npn_newstream(). the browser makes a copy of the buffer if necessary, so the plug-in can free the buffer as the method returns, if desired. see "example of sending a stream" for an example that includes npn_write(). example this example pushes a snippet of ht...
NPP - Archive of obsolete content
ollowing fields: pdata a value, whose definition is up to the plug-in, that the plug-in can use to store a pointer to an internal data structure associated with the instance; this field isn't modified by the browser. ndata a private value, owned by the browser, which is used to store data associated with the instance; this value should not be modified by the plug-in.
description gecko creates an npp structure for each plug-in instance and passes a pointer to it to npp_new(). this pointer--which is an opaque instance handle of a plug-in--identifies the instance on which api calls should operate. npp contains private instance data for both the plug-in and the browser. the npp_destroy() function informs the plug-in when the npp instance is about to be deleted; after this ca...
NPP_Destroy - Archive of obsolete content
has the following parameters: instance pointer to the plug-in instance to delete. **save state or other information to save for reuse by a new instance of this plug-in at the same url. passed to npp_new. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes.
description npp_destroy releases the instance data and resources associated with a plug-in. the browser calls this function when a plug-in instance is deleted, typically because the user has left the page containing the instance, closed the window, or quit the browser. you should delete any private instance-specific information stored in the plug-in's instance->pdata at this time. if this function is delet...
NPP_DestroyStream - Archive of obsolete content
button or indirectly by some action such as deleting the instance or initiating higher-priority network operations. npres_network_err: stream failed due to problems with network, disk i/o, lack of memory, or other problems. returns if successful, the plug-in should return nperr_no_error. if unsuccessful, the plug-in should return an error code. for possible values, see error codes.
description the browser calls the npp_destroystream function when a data stream sent to the plug-in is finished, either because it has completed successfully or terminated abnormally. after this, the browser deletes the npstream object. you should delete any private data allocated in stream->pdata at this time, and should not make any further references to the stream object. see also npp_newstream, npstr...
NPP_GetValue - Archive of obsolete content
ers: instance pointer to the plugin instance from which the value should come. variable variable for which the browser (caller) would like a value. the full list is in the npapi headers. value value for the requested variable. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes.
description npp_getvalue retrieves instance variables. see also npp_setvalue, npn_getvalue, npn_setvalue ...
NPP_HandleEvent - Archive of obsolete content
c value representing the event handled by the function. values: ms windows: pointer to npevent structure mac os: pointer to a standard mac os eventrecord unix/x11: pointer to a standard xlib xevent for a list of possible events, see npevent. returns if the plug-in handles the event, the function should return true. if the plug-in ignores the event, the function returns false.
description the browser calls npp_handleevent to tell the plug-in when events take place in the plug-in's window or drawable area. the plug-in either handles or ignores the event, depending on the value given in the event parameter of this function. for a list of event types the application is responsible for delivering to the plug-in, see the npevent structure. ms windows the browser gives each windowed ...
NPP_New - Archive of obsolete content
a previous instance of this plug-in at the same url. if non-null, the browser passes ownership of the npsaveddata object back to the plug-in. the plug-in is responsible for freeing the memory for the npsaveddata and the buffer it contains. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes.
description npp_new creates a new instance of a plug-in. it is called after np_initialize and is passed the mime type, embedded or full-screen display mode, and, for embedded plug-ins, information about html embed arguments. a new instance pointer (npp instance) is created by the plug-in, which is valid until the instance is destroyed with npp_destroy. if instance data was saved from a previous instance o...
NPP_NewStream - Archive of obsolete content
d. implementation note: some plugins, notably silverlight, do not set this outparam, and rely on the outparam being initialized to a default np_normal value. returns if successful, the function should return nperr_no_error. if unsuccessful, the function should return one of the nperror error codes. this will cause the browser to destroy the stream without calling npp_destroystream.
description npp_newstream notifies the plug-in when a new stream is created. the npstream* pointer is valid until the stream is destroyed. the plug-in can store plug-in-private data associated with the stream in stream->pdata. the mime type of the stream is provided by the type parameter. the data in the stream can be the file specified in the src attribute of the embed tag, for an embedded instance, or th...
NPP_Print - Archive of obsolete content
erence « plug-in side plug-in api summary requests a platform-specific print operation for an embedded or full-screen plug-in. syntax #include <npapi.h> void npp_print(npp instance, npprint* printinfo); parameters the function has the following parameters: instance pointer to the current plug-in instance. must be embedded or full-screen. printinfo pointer to npprint structure.
description npp_print is called when the user requests printing for a web page that contains a visible plug-in (either embedded or full-page). it uses the print mode set in the npprint structure in its printinfo parameter to determine whether the plug-in should print as an embedded plug-in or as a full-page plug-in. an embedded plug-in shares printing with the browser; the plug-in prints the part of the ...
NPP_SetValue - Archive of obsolete content
parameters the function has the following parameters: instance pointer to plugin instance on which to set the variable. variable the variable being set. value value for the variable being set. returns if successful, the function should return nperr_no_error. if unsuccessful, the function should return the most relevant npapi error code. for possible values, see error codes.
description none see also npp_new, npp_getvalue, npn_setvalue, npn_getvalue ...
NPP_SetWindow - Archive of obsolete content
en. window pointer to the window into which the instance draws. the window structure contains a window handle and values for top left corner, width, height, and clipping rectangle (see note on unix below). returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes.
description the browser calls npp_setwindow after creating the instance to allow drawing to begin. subsequent calls to npp_setwindow indicate changes in size or position; these calls pass the same npwindow object each time, but with different values. if the window handle is set to null, the window is destroyed. in this case, the plug-in must not perform any additional graphics operations on the window and s...
NPP_StreamAsFile - Archive of obsolete content
treamasfile(npp instance, npstream* stream, const char* fname); parameters the function has the following parameters: instance pointer to current plug-in instance. stream pointer to current stream. fname pointer to full path to a local file. if an error occurs while retrieving the data or writing the file, fname may be null.
description when the stream is complete, the browser calls npp_streamasfile to provide the instance with a full path name for a local file for the stream. npp_streamasfile is called for streams whose mode is set to np_asfileonly or np_asfile only in a previous call to npp_newstream. if an error occurs while retrieving the data or writing the file, the file name (fname) is null. see also npp_newstream, np...
NPP_URLNotify - Archive of obsolete content
ing the stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations. npres_network_err: stream failed due to problems with network, disk i/o, lack of memory, or other problems. notifydata plug-in-private value for associating a previous npn_geturlnotify() or npn_posturlnotify() request with a subsequent npp_urlnotify() call.
description the browser calls npp_urlnotify() after the completion of a npn_geturlnotify() or npn_posturlnotify() request to inform the plug-in that the request was completed and supply a reason code for the completion. the most common reason code is npres_done, indicating simply that the request completed normally. other possible reason codes are npres_user_break, indicating that the request was halted du...
NPP_Write - Archive of obsolete content
ns the plug-in should return the number of bytes written (consumed by the instance). if the return value is smaller than the size of the buffer, the browser sends the remaining data to the plug-in through subsequent calls to npp_writeready and npp_write. if unsuccessful, the function signals an error by returning a negative value. the browser will destroy the stream by calling npp_destroystream.
description the browser calls the npp_write function to deliver the data specified in a previous npp_writeready call to the plug-in. a plug-in must consume at least as many bytes as indicated in the npp_writeready call. after a stream is created by a call to npp_newstream, the browser calls npp_write either: if the plug-in requested a normal-mode stream, the data in the stream is delivered to the plug-in in...
NPP_WriteReady - Archive of obsolete content
mmary determines maximum number of bytes that the plug-in can consume. syntax #include <npapi.h> int32 npp_writeready(npp instance, npstream* stream); parameters the function has the following parameters: instance pointer to the current plug-in instance. stream pointer to the current stream. returns returns the maximum number of bytes that an instance is prepared to accept from the stream.
description the browser calls npp_writeready before each call to npp_write to determine whether a plug-in can receive data and how many bytes it can receive. this function allows the browser to send only as much data to the instance as it can handle at one time, making resource use more efficient for both the browser and plug-in. the npp_write function may pass a larger buffer, but the plug-in is required to...
NPPrint - Archive of obsolete content
elds: mode determines whether plug-in prints in full-page or embedded mode. values: np_full: pointer to npfullprint structure. plug-in can optionally print in full-page mode. the fullprint field of the union is valid. see npfullprint and npp_print. np_embed: pointer to npembedprint structure. plug-in should print in embedded mode. the embedprint field of the union is valid. see npembedprint.
description the npp_print function passes a pointer to an npprint object (previously allocated by the browser) to the plug-in. the pointer and fields within the npprint structure are valid only for the duration of the npp_print call. see also npp_print, npfullprint, npembedprint ...
NPPrintCallbackStruct - Archive of obsolete content
on required by the platformprint field of the npembedprint structure during embedded mode printing on unix systems. this structure is only used on unix. syntax typedef struct { int32 type; file* fp; } npprintcallbackstruct; fields the data structure has the following fields: type always contains np_print. fp pointer to the file to which the plug-in should write its postscript data.
description callback structures are used to pass platform-specific information. the npprintcallbackstruct structure contains the file pointer to which the plug-in should write its postscript data. this information is required by the platformprint field of the npembedprint structure during embedded mode printing. at the time the plug-in is called, the browser has already opened the file and written postscript...
NPRect - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary represents a rectangular area of a plug-in's content area. syntax typedef struct _nprect { uint16 top; uint16 left; uint16 bottom; uint16 right; } nprect; fields the data structure has the following fields: top, left, bottom, right the top, left, bottom, and right sides of the rectangle.
description nprect defines the bounding box of the area of the plug-in window to be updated, painted, invalidated, or clipped to. see also npn_forceredraw() npn_invalidaterect() npn_invalidateregion() npregion npwindow ...
NPRegion - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary represents a platform-defined region of a page. syntax windows: typedef hrgn npregion; mac os x: typedef rgnhandle npregion; note: this may need to be updated for the cocoa event model. xwindows: typedef region npregion;
description npregion defines the region of the plug-in window to be updated, painted, invalidated, or clipped to. for information about the region type definition used by your platform, see your platform documentation. see also npn_forceredraw() npn_invalidaterect() npn_invalidateregion() npwindow nprect ...
NPSavedData - Archive of obsolete content
in. syntax typedef struct _npsaveddata { int32 len; void* buf; } npsaveddata; fields the data structure has the following fields: len length in bytes of the buffer pointed to by buf; set by the plug-in. buf pointer to a memory buffer allocated by the plug-in with npn_memalloc(). can be any reasonable size; its contents are private to the plug-in and are not modified by the browser.
description the npsaveddata object contains a block of per-instance information that the browser saves after the instance is deleted. this information can be returned to another instance of the same plug-in if the user returns to the web page that contains it. you can use the plug-in's npp_destroy() function to allocate an npsaveddata object using the npn_memalloc() function, fill in the fields, and return i...
NPSetWindowCallbackStruct - Archive of obsolete content
display standard x toolkit attribute. pointer to the display structure that represents the browser-server connection. visual standard x toolkit attribute. x visual for the plug-in window or drawable. colormap standard x toolkit attribute. colormap for the plug-in window or drawable. depth standard x toolkit attribute. depth of the plug-in window or drawable.
description callback structures are used to pass platform-specific information. the npsetwindowcallbackstruct object, allocated by the browser, contains information required for the ws_info field of an npwindow. the npp_setwindow() function passes a pointer to this structure to the plug-in. the structure is valid for the lifetime of the npwindow, that is, until npp_setwindow() is called again or the instance...
NPStream - Archive of obsolete content
er than or equal to npvers_has_response_headers. this field is used only for http and is null for other types of streams. the plug-in should copy this data before making use of it. the headers include the http status line and all headers, verbatim as received from the server. lines are terminated by newline characters ("\n"), and the headers are terminated by a newline followed by null ("\n\0").
description the browser allocates and initializes the npstream object and passes it to the plug-in in as a parameter to npp_newstream or npn_newstream. the browser cannot delete the object until after it calls npp_destroystream or the plug-in calls npn_destroystream. streams produced by the browser: the browser creates the npstream object and passes it to the plug-in initially as a parameter to npp_newstream...
NPUTF8 - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary nputf8 is a byte representing an 8-bit unit of a utf-8 character. this is not the same thing as an entire utf-8 character, which may be comprised of multiple nputf8 bytes. syntax typedef char nputf8;
description the nputf8 type is used in constructing utf-8 strings for use by the plugin scripting api extension. ...
NPWindow - Archive of obsolete content
navigator 3.0). the plug-in is considered windowed. npwindowtypedrawable: indicates that the plugin is windowless. the window field holds a platform-specific handle to a drawable or an off-screen pixmap, as follows: windows: hdc mac os: pointer to np_port structure unix/x11: not used. (the drawable is provided in a graphicsexpose event, when the paint is requested.)
description the npwindow structure represents the native window or a drawable, and contains information about coordinate position, size, whether the plug-in is windowed or windowless, and some platform-specific information. the plug-in area is a native window element on windows and unix, or a rectangle within a native window on mac os. the x, y, height, and width coordinates of npwindow specify the position...
NP_GetValue - Archive of obsolete content
etvalue(void *instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the current plug-in instance. instance parameter is null because no instance has been created. variable plug-in information the call gets. values: nppvpluginnamestring: gets the name of the plug-in nppvplugin
descriptionstring: gets the
description string of the plug-in value plug-in name, returned by the function. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes.
description none. see also npp_setvalue ...
NP_Initialize - Archive of obsolete content
a plug-in. syntax windows #include <npapi.h> nperror winapi np_initialize(npnetscapefuncs *anpnfuncs) unix #include <npapi.h> nperror np_initialize(npnetscapefuncs *anpnfuncs, nppluginfuncs *anppfuncs) returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes.
description the browser calls this function only once: when a plug-in is loaded, before the first instance is created. this is the first function that the browser calls. np_initialize tells the plug-in that the browser has loaded it and provides global initialization. allocate any memory or resources shared by all instances of your plug-in at this time. after the last instance of a plug-in has been deleted...
NP_Port - Archive of obsolete content
ure. syntax typedef struct np_port { cgrafptr port; /* grafport */ int32 portx; /* position inside the topmost window */ int32 porty; } np_port; fields the data structure has the following fields: port standard mac os port into which the plug-in should draw. portx, porty top-left corner of the plug-in rectangle in port coordinates (taking the scroll position into account).
description on mac os, the window field of an npwindow structure points to an np_port object, which is allocated by the browser. the np_port is valid for the lifetime of the npwindow, that is, until npp_setwindow is called again with a different value or the instance is destroyed. since the port is shared between the plug-in and other plug-ins and the browser, the plug-in should always do the following: dr...
NPAPI plugin reference - Archive of obsolete content
ed to npapi plugins. browser-side plug-in api this chapter describes methods in the plug-in api that are provided by the browser; these allow call back to the browser to request information, tell the browser to repaint part of the window, and so forth. the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in. np_getmime
description np_getmime
description returns a supported mime type list for your plugin. it works on unix (linux) and macos. on windows you have to define supported mimetypes in the dll resource file. np_getvalue allows the browser to query the plug-in for information. np_initialize provides global initialization for a plug-in. np_port contains information required by the window field of an npwindow stru...
Proposal - Archive of obsolete content
(so don't expect any software to support them.) but some of them could become standards in the future. note: those in the list below that are marked "in development" should not be implemented. "in development" means that they are still working on it and trying to come up with a draft. those labeled with "draft exists" can be implemented, but be warned that they could radically change. name
description status easy news topics easy news topics (ent) is intended to be a very simple standard for describing how topic information can be introduced into an rss2.0 news feed. draft exists icbm let's you add latitude and longitude info to an item. spec exists itunes rss itunes extension modules used for ipradio/podcasting. spec exists media rss rss extension module used for iptv and ipradio/podc...
Element - Archive of obsolete content
rss elements a <author> (rss author element) b c <category> (rss category element) <channel> (rss channel element) <cloud> (rss cloud element) <comments> (rss comments element) <copyright> (rss copyright element) d <day> (rss day element) <
description> (rss
description element) <docs> (rss docs element) e <enclosure> (rss enclosure element) f g <generator> (rss generator element) <guid> (rss guid element) h <height> (rss height element) <hour> (rss hour element) i <image> (rss image element) <item> (rss item element) j k l <language> (rss language element) <lastbuilddate> (rss last build date element) <link> (rss link element) m <managingeditor> (rss managing editor element) n <name> (rss name element) o p <pubdate> (rss published...
Tamarin Tracing Build Documentation - Archive of obsolete content
tion of the repository that will be used for the build. note: only repositories hosted on http://hg.mozilla.org/ are accepted. revision: specify the revision number that will be built. currently this only accepts the change number and not the hash. branch: which branch of tamarin the repository is based on, tamarin-central or tamarin-tracing. builders: which platforms will be compiled and tested.
description: self explanatory check the status of the build @ http://tamarin-builds.mozilla.org/sandbox/ tryserver etiquette the sandbox is not a good substitute for running the regression tests locally to catch obvious problems. this is a shared resource, each request takes approximately 3+ hours to run so please use wisely. ...
Create Your Own Firefox Background Theme - Archive of obsolete content
eme — pick a unique name for your theme. duplicate names are not allowed, so you may need to try a few times to find a unique name. pick a category and tags — select a category and enter some tags that best describe your theme. keep in mind that a reviewer may reject your theme if it is obvious that your category and/or tags are unrelated to your theme. describe your theme — write a short
description of your theme. keep in mind that a reviewer may reject your theme if your
description is not an accurate representation of your theme. select a license for your theme — decide on a copyright license for your work. read more about the types of creative common licenses. important: please be sure you have the rights to use the image in your theme! upload your images — make sure they...
Scratchpad - Archive of obsolete content
th more information. ↑ and ↓ cycle through the suggestions and enter or tab select the highlighted choice. inline documentation to show the inline documentation popup, press ctrl + shift + space when the cursor is on an identifier. for example, if you type document.addeventlistener, then press ctrl + shift + space, you'll see a popup that shows a summary of the function's syntax and a short
description: the "[docs]" link takes you to the mdn documentation for the symbol. executing once you've written your code, select the code you want to run. if you don't select anything, all the code in the window will be run. then choose the way you want the code to run using the buttons along the top, using the execute menu, or using the context menu. the code is executed in the scope of the currently se...
Browser Detection and Cross Browser Support - Archive of obsolete content
netscape 6.0. many sites keyed off of the existence of the string netscape6 in the user agent and used tests similar to: if (navigator.useragent.indexof('netscape6') != -1) { // netscape 6 code } note how this type of detection misses any other gecko based browser. unfortunately, the netscape 6 user agent string was not sufficiently generalizable due to it's use of the string netscape6 as a
description of the vendor. netscape 7 corrects this error and introduces another chance for user agent string based detection to fail. mozilla/5.0 (...) gecko/200207xx netscape/7.0 note how netscape 7 no longer uses the string netscape6 as the vendor. any user agent string detection strategy for gecko based upon the existence of the string netscape6 will fail to detect netscape 7. using javascript object...
Browser Feature Detection - Archive of obsolete content
} ] }; function supports(object, featureset) { var i; var features = _features[featureset]; var level = 0; if (!features) return level; for (i = 0; i < features.length; i++) if (typeof(object[features[i].name]) != 'undefined') { features[i].supported = true; ++level; } return math.floor( (100 * level) / features.length ); } function generatereport(object, featureset,
description) { var i; var features = _features[featureset]; document.write('<p><b>' + featureset + ' support for properties/methods in ' +
description + ', percentage of names defined = ' + supports(object, featureset) + '%<\/b><\/p>'); document.write('<table cellspacing="0">'); for (i = 0; i < features.length; i++) { if (features[i].supported) document.write('<tr><td>' + features[i].n...
::-ms-fill - Archive of obsolete content
a progress bar is determinate if it has a value attribute set; otherwise it is indeterminate. an indeterminate progress bar can be selected with the :indeterminate pseudo-class.) by default, internet explorer and edge display a moving dots animation for an indeterminate progress bar. by setting animation-name on ::-ms-fill, you can change the animation, as shown in this table: value
description none turns off the animation so that no dots are displayed. -ms-bar shows animated dots that flow in a bar pattern. -ms-ring shows animated dots that flow in a ring pattern. allowable properties only the following css properties can be used in a rule with ::-ms-fill in its selector. other properties are ignored. animation-name background-clip, backg...
Iterator - Archive of obsolete content
ture-facing usages, consider using for..of loops and the iterator protocol. the iterator function returns an object which implements legacy iterator protocol and iterates over enumerable properties of an object. syntax iterator(object, [keyonly]) parameters object object to iterate over properties. keyonly if keyonly is truthy value, iterator.prototype.next returns property_name only.
description returns iterator instance that iterates over object. iterator instance returns [property_name, property_value] array for each iteration if keyonly is falsy, otherwise, if keyonly is truthy, it returns property_name for each iteration. if object is the iterator instance or generator instance, it returns object itself. properties iterator.prototype[@@iterator] returns a function that return...
Array.observe() - Archive of obsolete content
ng the type of change taking place. one of "add", "update", "delete", or "splice". oldvalue: only for "update" and "delete" types. the value before the change. index: only for the "splice" type. the index at which the change occurred. removed: only for the "splice" type. an array of the removed elements. addedcount: only for the "splice" type. the number of elements added.
description the callback function is called each time a change is made to arr, with an array of all changes in the order in which they occurred. changes done via array methods, such as array.prototype.pop() will be reported as "splice" changes. index assignment changes which do not change the length of the array may be reported as "update" changes. examples logging different change types var arr = ['a...
Array.unobserve() - Archive of obsolete content
the array.unobserve() method was used to remove observers set by array.observe(), but has been deprecated and removed from browsers. you can use the more general proxy object instead. syntax array.unobserve(arr, callback) parameters arr the array to stop observing. callback the reference to the observer to stop calling each time changes are made on the array arr.
description array.unobserve() should be called after array.observe() in order to remove an observer from an array. the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer. it's useless to call array.unobserve() with an anonymous function as callback, it will not remove any observer. examples unobserving an array var arr = [1,...
ArrayBuffer.transfer() - Archive of obsolete content
d or zero-extended by newbytelength. if newbytelength is undefined, the bytelength of the oldbuffer is used. this operation leaves oldbuffer in a detached state. syntax arraybuffer.transfer(oldbuffer [, newbytelength]); parameters oldbuffer an arraybuffer object from which to transfer. newbytelength the byte length of the new arraybuffer object. return value a new arraybuffer object.
description the arraybuffer.transfer() method allows you to grow and detach arraybuffer objects. the ability to grow an arraybuffer without copying has the advantage of being much faster for large buffers (similar to realloc). the ability to detach an arraybuffer gives the developer explicit control over when the underlying memory is released. this avoids having to drop all references and wait for garbage ...
Array comprehensions - Archive of obsolete content
be removed at any time. try to avoid using it. the array comprehension syntax was a javascript expression which allowed you to quickly assemble a new array based on an existing one. however, it has been removed from the standard and the firefox implementation. do not use it! syntax [for (x of iterable) x] [for (x of iterable) if (condition) x] [for (x of iterable) for (y of iterable) x + y]
description inside array comprehensions, these two kinds of components are allowed: for...of and if the for-of iteration is always the first component. multiple for-of iterations or if statements are allowed. array comprehension was previously proposed to be standardized in ecmascript 2016, it provide a useful shortcut for constructing a new array based on the contents of another. comprehensions can ...
Date.prototype.toLocaleFormat() - Archive of obsolete content
eature has been removed and will no longer work in firefox 58+. see warning: date.prototype.tolocaleformat is deprecated for more information and migration help. syntax dateobj.tolocaleformat(formatstring) parameters formatstring a format string in the same format expected by the strftime() function in c. return value a string representing the given date using the specified formatting.
description the tolocaleformat() method provides greater software control over the formatting of the generated date and/or time. names for months and days of the week are localized using the operating system's locale. however, ordering of the day and month and other localization tasks are not handled automatically since you have control over the order in which they occur. you should take care that the forma...
Expression closures - Archive of obsolete content
ctions. syntax function [name]([param1[, param2[, ..., paramn]]]) expression parameters name the function name. can be omitted, in which case the function is anonymous. the name is only local to the function body. paramn the name of an argument to be passed to the function. a function can have up to 255 arguments. expression the expression which comprise the body of the function.
description this addition is nothing more than a shorthand for writing simple functions, giving the language something similar to a typical lambda notation. javascript 1.7 and older: function(x) { return x * x; } javascript 1.8: function(x) x * x this syntax allows you to leave off the braces and 'return' statement - making them implicit. there is no added benefit to writing code in this manner, other ...
Function.prototype.isGenerator() - Archive of obsolete content
the non-standard isgenerator() method used to determine whether or not a function is a generator. it has been removed from firefox starting with version 58. syntax fun.isgenerator() return value a boolean indicating whether or not the given function is a generator.
description the isgenerator() method determines whether or not the function fun is a generator. it was part of an early harmony proposal, but has not been included in the ecmascript 2015 specification. examples function f() {} function* g() { yield 42; } console.log('f.isgenerator() = ' + f.isgenerator()); // f.isgenerator() = false console.log('g.isgenerator() = ' + g.isgenerator()); // g.isgenerator() = true specifications not part of any standard. ...
Generator comprehensions - Archive of obsolete content
using generator. the generator comprehension syntax was a javascript expression which allowed you to quickly assemble a new generator function based on an existing iterable object. however, it has been removed from the standard and the firefox implementation. do not use it! syntax (for (x of iterable) x) (for (x of iterable) if (condition) x) (for (x of iterable) for (y of iterable) x + y)
description inside generator comprehensions, these two kinds of components are allowed: for...of and if the for-of iteration is always the first component. multiple for-of iterations or if statements are allowed. a significant drawback of array comprehensions is that they cause an entire new array to be constructed in memory. when the input to the comprehension is itself a small array the overhead in...
Legacy generator function expression - Archive of obsolete content
., paramn]]]) { statements } parameters name the function name. can be omitted, in which case the function is anonymous. the name is only local to the function body. paramn the name of an argument to be passed to the function. a function can have up to 255 arguments. statements the statements which comprise the body of the function. this should contain at least one yield expression.
description an overview of the usage is available on the iterators and generators page. ...
Legacy generator function - Archive of obsolete content
ne yield expression, and a legacy generator function expression. syntax function name([param,[, param,[..., param]]]) { [statements] } name the function name. param the name of an argument to be passed to the function. a function can have up to 255 arguments. statements the statements which comprise the body of the function. this should contain at least one yield expression.
description an overview of the usage is available on the iterators and generators page. ...
Error.number - Archive of obsolete content
code: 10 error message: 'y' is undefined requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards. also supported in store apps (windows 8 and windows phone 8.1). applies to: error object see also
description property (error) message property (error) name property (error) ...
Microsoft JavaScript extensions - Archive of obsolete content
explorer, and in a few cases, microsoft edge) support a number of special microsoft extensions to the otherwise standard javascript apis. objects activexobject debug enumerator vbarray functions getobject scriptengine scriptenginebuildversion scriptenginemajorversion scriptengineminorversion statements @cc-on @if @set other date.getvardate() error.
description error.number error.stacktracelimit ...
Object.prototype.eval() - Archive of obsolete content
the object.eval() method used to evaluate a string of javascript code in the context of an object, however, this method has been removed. syntax obj.eval(string) parameters string any string representing a javascript expression, statement, or sequence of statements. the expression can include variables and properties of existing objects.
description the eval method can no longer be used as a method of an object. use the top-level eval() function instead. specifications not part of any standard. ...
Object.getNotifier() - Archive of obsolete content
the object.getnotifer() method was used to create an object that allows to synthetically trigger a change, but has been deprecated and removed in browsers. syntax object.getnotifier(obj) parameters obj the object to retrieve the notifier of. return value the notifier object associated with the object being passed to the function.
description the notifier is used to trigger synthetic changes that will be observed by object.observe(). specifications not part of any standard. strawman proposal specification. ...
Object.prototype.__noSuchMethod__ - Archive of obsolete content
ailable. while __nosuchmethod__ has been dropped, the ecmascript 2015 specification has the proxy object, with which you can achieve the below (and more). syntax obj.__nosuchmethod__ = fun parameters fun a function that takes the form function (id, args) { . . . } id the name of the non-existent method that was called args an array of the arguments passed to the method
description by default, an attempt to call a method that doesn't exist on an object results in a typeerror being thrown. this behavior can be circumvented by defining a function at that object's __nosuchmethod__ member. the function takes two arguments, the first is the name of the method attempted and the second is an array of the arguments that were passed in the method call. the second argument is an act...
Object.observe() - Archive of obsolete content
king place. one of "add", "update", or "delete". oldvalue: only for "update" and "delete" types. the value before the change. acceptlist the list of types of changes to be observed on the given object for the given callback. if omitted, the array ["add", "update", "delete", "reconfigure", "setprototype", "preventextensions"] will be used. return value the object to be observed.
description callback is called each time a change is made to obj, with an array of all changes in the order in which they occurred. examples logging all six different types var obj = { foo: 0, bar: 1 }; object.observe(obj, function(changes) { console.log(changes); }); obj.baz = 2; // [{name: 'baz', object: <obj>, type: 'add'}] obj.foo = 'hello'; // [{name: 'foo', object: <obj>, type: 'update', o...
Object.prototype.__parent__ - Archive of obsolete content
obsolete since gecko 2 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the __parent__ property used to point to an object's context, but it has been removed. syntax obj.__parent__
description for top-level objects, this is the e.g. window. specifications not part of any standard. ...
Object.unobserve() - Archive of obsolete content
e() method was used to remove observers set by object.observe(), but has been deprecated and removed from browsers. you can use the more general proxy object instead. syntax object.unobserve(obj, callback) parameters obj the object to stop observing. callback the reference to the observer to stop calling each time changes are made on the object obj. return value the specified object.
description object.unobserve() should be called after object.observe() in order to remove an observer from an object. the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer. it's useless to call object.unobserve() with an anonymous function as callback, it will not remove any observer. examples unobserving an obje...
Object.prototype.unwatch() - Archive of obsolete content
, using watchpoints has a serious negative impact on performance, which is especially true when used on global objects, such as window. you can usually use setters and getters or proxies instead. the unwatch() method removes a watchpoint set with the watch() method. syntax obj.unwatch(prop) parameters prop the name of a property of the object to stop watching. return value undefined.
description the javascript debugger has functionality similar to that provided by this method, as well as other debugging options. for information on the debugger, see venkman. by default, this method is inherited by every object descended from object. note: the reason for unwatch() to take the property name prop as its only parameter is due to the "single handler allowing" behavior of the watch() method...
Object.prototype.watch() - Archive of obsolete content
w. you can usually use setters and getters or proxies instead. the watch() method watches for a property to be assigned a value and runs a function when that occurs. syntax obj.watch(prop, handler) parameters prop the name of a property of the object on which you wish to monitor changes. handler a function to call when the specified property's value changes. return value undefined.
description watches for assignment to a property named prop in this object, calling handler(prop, oldval, newval) whenever prop is set and storing the return value in that property. a watchpoint can filter (or nullify) the value assignment, by returning a modified newval (or by returning oldval). if you delete a property for which a watchpoint has been set, that watchpoint does not disappear. if you later ...
Reflect.enumerate() - Archive of obsolete content
h the enumerable own and inherited properties of the target object, but has been removed in ecmascript 2016 and is deprecated in browsers. syntax reflect.enumerate(target) parameters target the target object on which to get the property. return value an iterator with the enumerable own and inherited properties of the target object. exceptions a typeerror, if target is not an object.
description the reflect.enumerate method returns an iterator with the enumerable own and inherited properties of the target object. examples using reflect.enumerate() var obj = { x: 1, y: 2 }; for (var name of reflect.enumerate(obj)) { console.log(name); } // logs "x" and "y" specifications not part of any standard. ...
arguments.caller - Archive of obsolete content
function whocalled() { if (whocalled.caller == null) console.log('i was called from the global scope.'); else console.log(whocalled.caller + ' called me!'); } examples the following code was used to check the value of arguments.caller in a function, but doesn't work anymore. ...
for each...in - Archive of obsolete content
ject) { statement } variable variable to iterate over property values, optionally declared with the var keyword. this variable is local to the function, not to the loop. object object for which the properties are iterated. statement a statement to execute for each property. to execute multiple statements within the loop, use a block statement ({ ... }) to group those statements.
description some built-in properties are not iterated over. these include all built-in methods of objects, e.g. string's indexof method. however, all user-defined properties are iterated over. examples using for each...in warning: never use a loop like this on arrays. only use it on objects. see for...in for more details. the following snippet iterates over an object's properties, calculating their sum:...
handler.enumerate() - Archive of obsolete content
e handler.enumerate() method used to be a trap for for...in statements, but has been removed from the ecmascript standard in es2016 and is deprecated in browsers. syntax var p = new proxy(target, { enumerate(target) { } }); parameters the following parameter is passed to the enumerate method. this is bound to the handler. target the target object. return value an iterator object.
description the handler.enumerate method is a trap for for...in statements. interceptions this trap can intercept these operations: property enumeration / for...in: for (var name in proxy) {...} reflect.enumerate() invariants if the following invariants are violated, the proxy will throw a typeerror: the enumerate method must return an object. examples the following code traps for...in statem...
LiveConnect Overview - Archive of obsolete content
rface for invoking javascript methods and examining javascript properties. javascript to java communication when you refer to a java package or class, or work with a java object or array, you use one of the special liveconnect objects. all javascript access to java takes place with these objects, which are summarized in the following table. table 9.1 the liveconnect objects object
description javaarray a wrapped java array, accessed from within javascript code. javaclass a javascript reference to a java class. javaobject a wrapped java object, accessed from within javascript code. javapackage a javascript reference to a java package. note: because java is a strongly typed language and javascript is weakly typed, the javascript ...
JSObject - Archive of obsolete content
jsobject allows java to manipulate javascript objects. when a javascript object is sent to java, the runtime engine creates a java wrapper of type jsobject; when a jsobject is sent from java to javascript, the runtime engine unwraps it to its original javascript object type. the jsobject class provides a way to invoke javascript methods and examine javascript properties. ...
JavaArray - Archive of obsolete content
summary core object a wrapped java array accessed from within javascript code is a member of the type javaarray. created by any java method which returns an array. in addition, you can create a javaarray with an arbitrary data type using the newinstance method of the array class: public static object newinstance(class componenttype, int length) throws negativearraysizeexception
description the javaarray object is an instance of a java array that is created in or passed to javascript. javaarray is a wrapper for the instance; all references to the array instance are made through the javaarray. in javascript 1.4 and later, the componenttype parameter is either a javaclass object representing the type of the array or class object, such as one returned by java.lang.class.forname. in javasc...
JavaClass - Archive of obsolete content
summary core object a javascript reference to a java class. created by a reference to the class name used with the packages object: packages.javaclass javaclassis the fully-specified name of the object's java class. the liveconnect java, sun, and netscape objects provide shortcuts for commonly used java packages and also create javaclass objects.
description a javaclass object is a reference to one of the classes in a java package, such as netscape.javascript.jsobject. a javapackage object is a reference to a java package, such as netscape.javascript. in javascript, the javapackage and javaclass hierarchy reflect the java package and class hierarchy. you can pass a javaclass object to a java method which requires an argument of type java.lang.class. backward compatibility javascript 1.3 ...
JavaObject - Archive of obsolete content
de. created by any java method which returns an object type. in addition, you can explicitly construct a javaobject using the object's java constructor with the packages keyword: new packages.javaclass(parameterlist) javaclassis the fully-specified name of the object's java class. parameters parameterlist an optional list of parameters, specified by the constructor of the java class.
description the javaobject object is an instance of a java class that is created in or passed to javascript. javaobject is a wrapper for the instance; all references to the class instance are made through the javaobject. any java data brought into javascript is converted to javascript data types. when the javaobject is passed back to java, it is unwrapped and can be used by java code. see the core javascri...
JavaPackage - Archive of obsolete content
summary core object a javascript reference to a java package. created by a reference to the package name used with the packages keyword: packages.javapackage javapackageis the name of the object's java package. if the package is in the java, netscape, or sun packages, the packages keyword is optional.
description in java, a package is a collection of java classes or other java packages. for example, the netscape package contains the package netscape.javascript; the netscape.javascript package contains the classes jsobject and jsexception. in javascript, a javapackage is a reference to a java package. for example, a reference to netscape is a javapackage. netscape.javascript is both a javapackage and a property of the netscape javapackage. a javaclass object is a reference to one of the cl...
Packages - Archive of obsolete content
ouraged since it could be removed at any time. try to avoid using it. summary a top-level object used to access java classes from within javascript code. the support for this object was removed in gecko 16, see liveconnect for details. created by the packages object is a top-level, predefined javascript object. you can automatically access it without using a constructor or calling a method.
description the packages object lets you access the public methods and fields of an arbitrary java class from within javascript. the java, netscape, and sun properties represent the packages java.*, netscape.*, and sun.* respectively. use standard java dot notation to access the classes, methods, and fields in these packages. for example, you can access a constructor of the frame class as follows: var thef...
java - Archive of obsolete content
summary core object a top-level object used to access any java class in the package java.*. the support for this object was removed in gecko 16, see liveconnect for details. created by the java object is a top-level, predefined javascript object. you can automatically access it without using a constructor or calling a method.
description the java object is a convenience synonym for the property packages.java. see also packages, packages.java ...
netscape - Archive of obsolete content
summary core object a top-level object used to access any java class in the package netscape.*. created by the netscape object is a top-level, predefined javascript object. you can automatically access it without using a constructor or calling a method.
description the netscape object is a convenient synonym for the property packages.netscape. see also packages, packages.netscape ...
sun - Archive of obsolete content
summary core object a top-level object used to access any java class in the package sun.*. created by the sun object is a top-level, predefined javascript object. you can automatically access it without using a constructor or calling a method.
description the sun object is a convenience synonym for the property packages.sun. see also packages, packages.sun ...
StopIteration - Archive of obsolete content
non-standard. the stopiteration object was a spidermonkey-specific feature and is removed in firefox 58+. for future-facing usages, consider using for..of loops and the iterator protocol. the stopiteration object was used to tell the end of the iteration in the legacy iterator protocol. do not use this ancient feature. syntax stopiteration
description stopiteration is a part of legacy iterator protocol, and it will be removed at the same time as legacy iterator and legacy generator. examples stopiteration is thrown by iterator. var a = { x: 10, y: 20 }; var iter = iterator(a); console.log(iter.next()); // ["x", 10] console.log(iter.next()); // ["y", 20] console.log(iter.next()); // throws stopiteration throwing stopiteration. function f() { yield 1; yield 2; throw stopite...
XForms Label Element - Archive of obsolete content
every form control other than the output and choices elements must contain a label element. it is valid for a form control to have an empty label element. the label text can be specified in instance data, in a remote document, or as inline text. if more than one source of label text is specified for this element, the order of precedence is: single node binding attributes, linking attributes, inline text. ui behavior accesskey support - if the accesskey attribute is specified on labeled xforms controls or on the label element itself then the label text for the control will contain an indicator as to what the access key is in a standard way. ...
XForms Output Element - Archive of obsolete content
aying the data as text is the default presentation. xforms output is most often used when a form author needs to render simple text of an instance node (xhtml/xul). characteristics text is presented to the user when there is no type given for the bound node or a type is specified that is not handled by one of the other widgets (as documented below). analogous widgets are <xhtml:span/> and <xul:
description/> calendar a form author may notice a xforms output element represented by a calendar widget in the mozilla xforms processor if the control meets the following criteria (xhtml/xul). characteristics the bound instance node is of type xsd:date or a type derived from it in addition, the appearance attribute must also contain the value "full" firefox 2.0 doesn't currently have any similar widg...
XForms - Archive of obsolete content
ips for troubleshooting common problems with xforms forms. mozilla xforms specials explains where, and how, mozilla xforms deviates or extends the xforms 1.0 specification. xforms custom controls custom controls lets the form author "skin" each xforms control through xbl, and create f.x. an svg input control. xforms user preferences a
description of the about:config variables that xforms uses. xforms api reference xforms interfaces documentation. xforms ui elements reference xforms user interface elements documentation. view all... community view mozilla forums... mailing list newsgroup rss feed #xforms channel on irc.mozilla.org ...
Window: devicelight event - Archive of obsolete content
the devicelight event is fired when fresh data is available from a light sensor. note: this event has been disabled by default in firefox 62, behind the device.sensors.ambientlight.enabled preference (bug 1462308). bubbles no cancelable no interface sensorcallback target defaultview (window) other properties property type
description value read only double (float) the sensor data for ambient light in lux. min read only double (float) the minimum value in the range the sensor detects (if available, 0 otherwise). max read only double (float) the maximum value in the range the sensor detects (if available, 0 otherwise). examples window.addeventlistener('devicelight', fu...
RDF in Mozilla FAQ - Archive of obsolete content
general where do i start? rdf serves two primary purposes in mozilla. first, it is a simple, cross-platform database for small data stores. second, and more importantly, the rdf model is used along with xul templates as an abstract "api" for displaying information. rdf in fifty words or less is a quick, high-level
description of what rdf does in mozilla. the rdf back-end architecture document describes in more detail how mozilla's rdf implementation works, and gives a quick overview of the interfaces that are involved. where do i find information on open directory ("dmoz")? unfortunately, not here! well, here's a little... start at http://www.dmoz.org/ for more information on the open directory. the open directory dataset is available as a (huge) rdf/xml dump. it describes thousands of we...
The Business Benefits of Web Standards - Archive of obsolete content
arch engines is one of the hardest challenges faced by webmasters. in this case, every bit helps. by using semantic markup we greatly assist the search engines in their indexing process. these things come naturally to standards developers without additional effort, time or thought. all their documents are properly marked up at the outset. the number of sites which do not include proper titles and
descriptions in the meta is surprising. a lot of other sites would greatly increase their seo by simply using proper tags for the content. adding h1, h2, and h3, tags and so on gives proper structure to hypertext documents. search engine agents crawl the web to index it, but for ranking and indexing purposes they can only process text. dynamic effects such as those created by javascript are not taken into a...
Game promotion - Game development
ugh, you will succeed. plus competitions generally require games to follow a mandatory theme, so you can get creative around a theme if you are stuck for ideas. website and blog you should definitely create your own website containing all the information about your games, so people can see what you've worked on. the more information you can include the better — you should include screenshots,
description, trailer, press kit, requirements, available platforms, support details and more. you'll get bonus points for allowing your users to directly play your games online — at least in demo form. also, you should do some work on seo to allow people to find your games more easily. you should also blog about everything related to your gamedev activities. write about your development process, nasty bug...
Building up a basic demo with PlayCanvas editor - Game development
reating a new project start a brand new project by clicking on the new button: the resulting dialog box will show a few different options. there are starter kits available, but we don't want to load models or start a platform game. we want to start small, so we will use the empty project — click on the blank project option and enter a name for it (we are using "mdn games demo".) enter a
description if you want — it is optional. click create to have it created. next you'll see your project's page — there's not much yet. by clicking the editor button we'll launch the online playcanvas editor where we'll create our scene with the shapes. do this now. creating the scene here's how the scene looks initially in the editor. even though it's a blank new project we don't have to start e...
Unconventional controls - Game development
arduino or raspberry pi. connecting the boards and using them may look like this: var cylon = require('cylon'); cylon.robot({ connections: { arduino: { adaptor: 'firmata', port: '/dev/ttyacm0' } }, devices: { makey: { driver: 'makey-button', pin: 2 } }, work: function(my) { my.makey.on('push', function() { console.log("button pushed!"); }); } }).start(); as the
description says: this gpio driver allows you to connect a 10 mohm resistor to a digital pin on your arduino or raspberry pi to control your robots with bananas, clay, or drawable circuitry. summary i hope you liked the experiments — if you have any others that you think might interest other people, feel free to add details of them here. and remember: have fun making games! previous overview: cont...
Accessibility tree (AOM) - MDN Web Docs Glossary: Definitions of Web-related terms
ate an accessibility tree based on the dom tree, which is used by platform-specific accessibility apis for assistive technologies, such as screen readers. there are four things in an accessibility tree object: name how can we refer to this thing? for instance, a link with the text ‘read more’ will have ‘read more’ as its name (more on how names are computed in the accessible name and
description computation spec).
description how do we describe this element, if we want to add anything to the name? the
description of a table could explain what kind of info that table offers. role what kind of thing is it? for example, is it a button, a nav bar, or a list of items? state does it have a state? think checked/unchecked for checkboxes, or collapsed/expanded for the <summary> element. a...
Canonical order - MDN Web Docs Glossary: Definitions of Web-related terms
und-origin background-clip background-color furthermore, its syntax defines, that if a value for the background-size is given, it must be specified after the value for the background-position, separated by a slash. other values may appear in any order. learn more what does “canonical order” mean with respect to css properties? on stack overflow provides useful further discussion. the
description of the formal syntax used for css values on mdn ...
Head - MDN Web Docs Glossary: Definitions of Web-related terms
the head is the part of an html document that contains metadata about that document, such as author,
description, and links to css or javascript files that should be applied to the html. learn more html head <head> element reference on mdn the html <head> on the mdn learning area ...
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
content versus idl attributes in html, most attributes have two faces: the content attribute and the idl (interface definition language) attribute. the content attribute is the attribute as you set it from the content (the html code) and you can set it or get it via element.setattribute() or element.getattribute(). the content attribute is always a string even when the expected value should be an integer. for example, to set an <input> element's maxlength to 42 using the content attribute, you have to call setattribute("maxlength", "42") on that element. the idl attribute is also known as a javascript property. ...
Idempotent - MDN Web Docs Glossary: Definitions of Web-related terms
3rd row delete /idx/delete http/1.1 is idempotent, even if the returned status code may change between requests: delete /idx/delete http/1.1 -> returns 200 if idx exists delete /idx/delete http/1.1 -> returns 404 as it just got deleted delete /idx/delete http/1.1 -> returns 404 learn more general knowledge definition of idempotent in the http specification. technical knowledge
description of common idempotent methods: get, head, put, delete, options, trace
description of common non-idempotent methods: post,patch, connect ...
Normative - MDN Web Docs Glossary: Definitions of Web-related terms
n software specifications to denote sections that are standardized and must be followed as a rule. specifications might also contain sections that are marked as non-normative or informative, which means those are provided there for the purpose of helping the reader understand the specifications better or to showcase an example or best practice, which need not be followed as a rule. learn more
description of normative and informative content in whatwg wiki ...
State machine - MDN Web Docs Glossary: Definitions of Web-related terms
a transition is a set of actions to execute when a condition is fulfilled or an event received. in a state diagram, circles represent each possible state and arrows represent transitions between states. looking at the final state, you can discern something about the series of inputs leading to that state. ...
WebIDL - MDN Web Docs Glossary: Definitions of Web-related terms
it uses a somewhat stylized syntax which is independent of any specific programming language, so that the underlying code which is used to build each api can be written in whatever language is most appropriate, while still being possible to map the api's components to javascript-compatible constructs. ...
WebVTT - MDN Web Docs Glossary: Definitions of Web-related terms
webvtt (web video text tracks) is a w3c specification for a file format marking up text track resources in combination with the html <track> element. webvtt files provide metadata that is time-aligned with audio or video content like captions or subtitles for video content, text video
descriptions, chapters for content navigation, and more. learn more general knowledge webvtt on wikipedia technical reference webvtt on mdn specification ...
XML - MDN Web Docs Glossary: Definitions of Web-related terms
extensible markup language (xml) is a generic markup language specified by the w3c. the information technology (it) industry uses many languages based on xml as data-
description languages. xml tags resemble html tags, but xml is much more flexible because it lets users define their own tags. in this way xml acts like a meta-language—that is, it can be used to define other languages, such as rss. moreover, html is a presentation language, whereas xml is a data-
description language. this means that xml has far broader applications than just the web. for example, web services can use xml to exchange requests and responses. learn more xml introduction ...
non-normative - MDN Web Docs Glossary: Definitions of Web-related terms
ons often contains information marked as non-normative or informative, which means that those are provided there for the purpose of helping the readers to understand the specification better or to show an example or a best practice, and not needed to be followed as a rule. sections that contain official part of the specification that must be followed are often marked as normative. learn more
description of normative and informative content in whatwg wiki ...
About Scriptable Interfaces - Interfaces
his is just a starter document, it should not be considered complete. most of the information of this document is based on http://www.mozilla.org/scriptable/ and creating xpcom components scriptable interfaces interfaces allow xpcom components to expose their functionality to the outside world while hiding the inner details of the component implementation. interfaces are written in an interface
description language. when we label an interface as scriptable, we're saying that components exporting this interface can be referenced (through this interface) from scripts (e.g javascript), and that we can write new components implementing the interface using script languages. xpconnect xpconnect is a technology that allows scriptable interfaces to be used/implemented from/in javascript scripts. no othe...
Test your skills: CSS and JavaScript accessibility - Learn web development
ct the new values and test the code. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. javascript accessibility 1 in our final task here, you have some javascripting to do. we have a simple app that presents a list of animal names. clicking one of the animal names causes a further
description of that animal to appear in a box below the list. but it is not very accessible — in its current state you can only operate it with the mouse. we'd like you to add to the html and javascript to make it keyboard acessible too. download the starting point for this task to work in your own editor or in an online editor. assessment or further help you can practice these examples in the intera...
Test your skills: HTML accessibility - Learn web development
rting point for this task to work in your own editor or in an online editor. html accessibility 2 in the second task, you have a form containing three input fields. you need to: semantically associate the input with their labels. assume that these inputs will be part of a larger form, and wrap them in an element that associates them all together as a single related group. give the group a
description/title that summarises all of the information as personal data. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. html accessibility 3 in this task you are required to turn all the information links in the paragraph into good, accessible links. the first two links just go to re...
WAI-ARIA basics - Learn web development
ng or semantics. as an example, aria-required="true" specifies that a form input needs to be filled in to be valid, whereas aria-labelledby="label" allows you to put an id on an element, then reference it as being the label for anything else on the page, including multiple elements, which is not possible using <label for="input">. as an example, you could use aria-labelledby to specify that a key
description contained in a <div> is the label for multiple table cells, or you could use it as an alternative to image alt text — specify existing information on the page as an image's alt text, rather than having to repeat it inside the alt attribute. you can see an example of this at text alternatives. states — special properties that define the current conditions of elements, such as aria-disabled="t...
Cascade and inheritance - Learn web development
t happens when you make changes. playing with code really is the best way to get to grips with html and css. for example: the second list item has the class my-class-1 applied. this sets the color of the <a> element nested inside to inherit. if you remove the rule how does it change the color of the link? do you understand why the third and fourth links are the color that they are? check the
description of the values above if not. which of the links will change color if you define a new color for the <a> element — for example a { color: red; }? resetting all property values the css shorthand property all can be used to apply one of these inheritance values to (almost) all properties at once. its value can be any one of the inheritance values (inherit, initial, unset, or revert). it's a ...
Debugging CSS - Learn web development
n previous lessons we have discussed the box model, and the fact that we have an alternate box model that changes how the size of elements are calculated based on the size you give them, plus the padding and borders. devtools can really help you to understand how the size of an element is being calculated. the layout view shows you a diagram of the box model on the selected element, along with a
description of the properties and values that change how the element is laid out. this includes a
description of properties that you may not have explicitly used on the element, but which do have initial values set. in this panel, one of the detailed properties is the box-sizing property, which controls what box model the element uses. compare the two boxes with classes box1 and box2. they both have the sa...
CSS values and units - Learn web development
ection lists different types of color value and support for them. let's have a look at some of the types of value and unit you may frequently encounter, with examples so that you can try out different possible values. numbers, lengths, and percentages there are various numeric data types that you might find yourself using in css. the following are all classed as numeric: data type
description <integer> an <integer> is a whole number such as 1024 or -55. <number> a <number> represents a decimal number — it may or may not have a decimal point with a fractional component, for example 0.255, 128, or -1.2. <dimension> a <dimension> is a <number> with a unit attached to it, for example 45deg, 5s, or 10px. <dimension> is an umbrella category that inc...
Practical positioning examples - Learn web development
example, so a fresh start file is required. let's have a look at the html in the file: <label for="toggle">❔</label> <input type="checkbox" id="toggle"> <aside> ... </aside> to start with here we've got a <label> element and an <input> element — <label> elements are normally used to associate a text label with a form element for accessibility purposes (allowing a screen user to see what
description goes with what form element). here it is associated with the <input> checkbox using the for and id attributes. note: we've put a special question mark character into our html to act as our info icon — this represents the button that will be pressed to show/hide the panel. here we are going to use these elements for a slightly different purpose — another useful side effect of <label> eleme...
How can we design for all types of users? - Learn web development
her provide the same content in another form in the same page (e.g., complement a pie chart with a table providing the same data), or resort to a longdesc attribute. this attribute's value is a url pointing towards a resource explicitly describing in detail the image's content. note: the use and even the existence of longdesc has been debated for quite some time. please refer to the w3c's image
description extension (longdesc) for the full explanation and thorough examples. audio/video you must also provide alternatives to multimedia content. subtitling/close-captioning you should include captions in your video to cater to visitors who can't hear the audio. some users have hearing challenges, lack functioning speakers, or work in a noisy environment (like on the train). transcript subtitle...
How do I use GitHub Pages? - Learn web development
mputer to do something in the terminal by typing in a command and hitting enter, as seen above. creating a repo for your code next, you need to create a new repo for your files to go in. click plus (+) in the top right of the github homepage, then choose new repository. on this page, in the repository name box, enter a name for your code repository, for example my-repository. also fill in a
description to say what your repository is going to contain. your screen should look like this: click create repository; this should bring you to the following page: uploading your files to github on the current page, you are interested in the section …or push an existing repository from the command line. you should see two lines of code listed in this section. copy the whole of the first line...
What is accessibility? - Learn web development
er circumstances. let's consider video: hearing impairment how does a hearing-impaired person benefit from a video? you have to provide subtitles —or even better, a full text transcript. also, make sure people can adjust the volume to accommodate their unique needs. visual impairment again, provide a text transcript that a user can consult without needing to play the video, and an audio-
description (an off-screen voice that describes what is happening in the video). pausing capacity users may have trouble understanding someone in a video. let them pause the video to read the subtitles or process the information. keyboard capacity let the user tab into/out of a video, play it, and pause it without being trapped in it. the basics of web accessibility a few necessities for basic web acc...
How to structure a web form - Learn web development
<fieldset> elements to contain radio buttons. active learning: building a form structure let's put these ideas into practice and build a slightly more involved form — a payment form. this form will contain a number of control types that you may not yet understand. don't worry about this for now; you'll find out how they work in the next article (basic native form controls). for now, read the
descriptions carefully as you follow the below instructions, and start to form an appreciation of which wrapper elements we are using to structure the form, and why. to start with, make a local copy of our blank template file and the css for our payment form in a new directory on your computer. apply the css to the html by adding the following line inside the html <head>: <link href="payment-form.css" ...
HTML basics - Learn web development
you need to know for now. <html></html> — the <html> element. this element wraps all the content on the entire page and is sometimes known as the root element. <head></head> — the <head> element. this element acts as a container for all the stuff you want to include on the html page that isn't the content you are showing to your page's viewers. this includes things like keywords and a page
description that you want to appear in search results, css to style our content, character set declarations and more. <meta charset="utf-8"> — this element sets the character set your document should use to utf-8 which includes most characters from the vast majority of written languages. essentially, it can now handle any textual content you might put on it. there is no reason not to set this and it can h...
Creating hyperlinks - Learn web development
label as short as possible — this is helpful because screen readers need to interpret the entire link text. minimize instances where multiple copies of the same text are linked to different places. this can cause problems for screen reader users, if there's a list of links out of context that are labeled "click here", "click here", "click here". use relative links wherever possible from the
description above, you might think that it's a good idea to just use absolute links all the time because they don't break when a page is moved like relative links. however, you should use relative links wherever possible when linking to other locations within the same website. when you link to another website, you'll need to use an absolute link. for a start, it's easier to scan your code — relative url...
Test your skills: Advanced HTML text - Learn web development
ut solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. advanced html text 1 in this task we want you to turn the provided animals and their definitions into a
description list. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. advanced html text 2 in this task we want you to add some semantics to the provided html as follows: turn the second paragraph into a block-level quote, and semantically indicate that the quote is taken from accessibility.
Introduction to HTML - Learn web development
are what makes the web a web. this article shows the syntax required to make a link and discusses best practices for links. advanced text formatting there are many other elements in html for formatting text that we didn't get to in the html text fundamentals article. the elements here are less well-known, but still useful to know about. in this article, you'll learn about marking up quotations,
description lists, computer code and other related text, subscript and superscript, contact information, and more. document and website structure as well as defining individual parts of your page (such as "a paragraph" or "an image"), html is also used to define areas of your website (such as "the header," "the navigation menu," or "the main content column.") this article looks into how to plan a basic web...
Images in HTML - Learn web development
mes referred to as replaced elements. this is because the element's content and size are defined by an external resource (like an image or video file), not by the contents of the element itself. note: you can find the finished example from this section running on github (see the source code too.) alternative text the next attribute we'll look at is alt. its value is supposed to be a textual
description of the image, for use in situations where the image cannot be seen/displayed or takes a long time to render because of a slow internet connection. for example, our above code could be modified like so: <img src="images/dinosaur.jpg" alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"> the easiest way to test your alt text is to purposely mis...
Choosing the right approach - Learn web development
type === 'text') { return response.text(); } }) .catch(e => { console.log(`there has been a problem with your fetch operation for resource "${url}": ` + e.message); }); } // call the fetchanddecode() method to fetch the images and the text, and store their promises in variables let coffee = fetchanddecode('coffee.jpg', 'blob'); let tea = fetchanddecode('tea.jpg', 'blob'); let
description = fetchanddecode('
description.txt', 'text'); // use promise.all() to run code only when all three function calls have resolved promise.all([coffee, tea,
description]).then(values => { console.log(values); // store each value returned from the promises in separate variables; create object urls from the blobs let objecturl1 = url.createobjecturl(values[0]); let objecturl2 = url.createobjec...
Functions — reusable blocks of code - Learn web development
he background browser code, which is written largely in low-level system languages like c++, not web languages like javascript. bear in mind that some built-in browser functions are not part of the core javascript language — some are defined as part of browser apis, which build on top of the default language to provide even more functionality (refer to this early section of our course for more
descriptions). we'll look at using browser apis in more detail in a later module. functions versus methods programmers call functions that are part of objects methods. you don't need to learn about the inner workings of structured javascript objects yet — you can wait until our later module that will teach you all about the inner workings of objects, and how to create your own. for now, we just wanted to...
Introduction to web APIs - Learn web development
the clear communication people, on flickr. in the same way, if you want to say, program some 3d graphics, it is a lot easier to do it using an api written in a higher-level language such as javascript or python, rather than try to directly write low level code (say c or c++) that directly controls the computer's gpu or other graphics functions. note: see also the api glossary entry for further
description. apis in client-side javascript client-side javascript, in particular, has many apis available to it — these are not part of the javascript language itself, rather they are built on top of the core javascript language, providing you with extra superpowers to use in your javascript code. they generally fall into two categories: browser apis are built into your web browser and are able to e...
Third-party APIs - Learn web development
https://developer.nytimes.com/. get a developer key most apis require you to use some kind of developer key, for reasons of security and accountability. to sign up for an nytimes api key, following the instructions at https://developer.nytimes.com/get-started. let's request a key for the article search api — create a new app, selecting this as the api you want to use (fill in a name and
description, toggle the switch under the "article search api" to the on position, and then click "create"). get the api key from the resulting page. now, to start the example off, make copies of nytimes_start.html and nytimes.css in a new directory on your computer. if you've already cloned the examples repository, you'll already have a copy of these files, which you can find in the javascript/ap...
Video and Audio APIs - Learn web development
e loaded depending on the browser viewing the site. the controls html is probably the most interesting: we have four <button>s — play/pause, stop, rewind, and fast forward. each <button> has a class name, a data-icon attribute for defining what icon should be shown on each button (we'll show how this works in the below section), and an aria-label attribute to provide an understandable
description of each button, since we're not providing a human-readable label inside the tags. the contents of aria-label attributes are read out by screenreaders when their users focus on the elements that contain them. there is also a timer <div>, which will report the elapsed time when the video is playing. just for fun, we are providing two reporting mechanisms — a <span> containing the elapsed time ...
A first splash into JavaScript - Learn web development
the same as in other programming languages — functions, loops, etc. the code syntax looks different, but the concepts are still largely the same. thinking like a programmer one of the hardest things to learn in programming is not the syntax you need to learn, but how to apply it to solve real world problems. you need to start thinking like a programmer — this generally involves looking at
descriptions of what your program needs to do, working out what code features are needed to achieve those things, and how to make them work together. this requires a mixture of hard work, experience with the programming syntax, and practice — plus a bit of creativity. the more you code, the better you'll get at it. we can't promise that you'll develop "programmer brain" in five minutes, but we will give y...
Solve common problems in your JavaScript code - Learn web development
oin array items into a string? debugging javascript what are the basic types of error? what are browser developer tools, and how do you access them? how do you log a value to the javascript console? how do you use breakpoints and other javascript debugging features? for more information on javascript debugging, see handling common javascript problems. also, see other common errors for a
description of common errors. making decisions in code how do you execute different blocks of code, depending on a variable's value or other condition? how do you use if ...else statements? how do you nest one decision block inside another? how do you use and, or, and not operators in javascript? how do you conveniently handle a large number of choices for one condition? how do you use a ternary ope...
Server-side web frameworks - Learn web development
able at the time of writing. all of them have everything you need to be productive — they are open source, are under active development, have enthusiastic communities creating documentation and helping users on discussion boards, and are used in large numbers of high-profile websites. there are many other great server-side frameworks that you can discover using a basic internet search. note:
descriptions come (partially) from the framework websites! django (python) django is a high-level python web framework that encourages rapid development and clean, pragmatic design. built by experienced developers, it takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel. it’s free and open source. django follows the "batteries i...
Introduction to automated testing - Learn web development
an just select the defaults for now. once all the questions have been asked, it will ask you if the information entered is ok. type yes and press enter/return and npm will generate a package.json file in your directory. this file is basically a config file for the project. you can customize it later, but for now it'll look something like this: { "name": "node-test", "version": "1.0.0", "
description": "test for npm projects", "main": "index.js", "scripts": { "test": "test" }, "author": "chris mills", "license": "mit" } with this, you are ready to move on. setting up gulp automation let's look at setting up gulp and using it to automate some testing tools. to begin with, create a test npm project using the procedure detailed at the bottom of the previous section. next, yo...
Deploying our app - Learn web development
keep them short, concise, and descriptive, so they clearly describe what the change does. finally the code needs to be pushed to your github hosted repository. let's do that now. over at github, visit https://github.com/new and create your own repository to host this code. give your repository a short, memorable name, without spaces in it (use hyphens to separate words), and a
description, then click create repository at the bottom of the page. you should now have a "remote" url that points to your new github repo. this remote location needs to be added to our local git repository before we can push it up there, otherwise it won't be able to find it. you'll need to run a command with the following structure (use the provided https option for now — especially if you ...
Embedding API for Accessibility
rvice(ns_pref_contractid, &rv)); prefs->setboolpref("bool.pref.name", pr_true /* or pr_false */); prefs->setintpref("int.pref.name", newvalue); prefs->setcharpref("string.pref.name", newcharstarvalue); to manually add a pref to your settings, add a line like the following to your prefs.js: user_pref("accessibility.browsewithcaret", true); accessibility prefs reference the following is a
description of what accessibility prefs give us (or will give us), for accessibility: functionality implementation works as of images setintpref("network.image.imagebehavior", behavior); /* behavior: 0=accept, 1=accept images from originating server only, 2=no images */ ...
Links and Resources
pany "cynthia says™" is a free online webpage accessibility validation service that identifies accessibility errors in webpage related to section 508 standards and/or the wcag guidelines. just like webxact, it can also perform a "complete webpage quality check" for accessibility, privacy, searchability, metadata and even alt text attribute quality. accessibility valet from webthing
description and summary to be written. wave 3.0 (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 3.0 is another powerful, mature, free online webpage accessibility validation service that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines. ...
Index
an appealing add-on listing add-ons, beginner, guide, webextension, publishing there are two essential steps to getting people to use your add-on: they need to discover your add-on and open the listing page, then the listing page needs to encourage them to click the add to firefox button. the content you add to a listing is therefore vital: from making effective use of keywords in your
descriptions, to get visibility in external search engine results, through having an icon that attracts a user’s attention from a category list, to screenshots that show how useful your add-on is. 676 index add-ons, glossary, guide, index found 689 pages: 677 signing and distributing your add-on add-ons, extensions, webextensions, distribution, publication, reviews, sign...
Lightweight themes
eme — pick a unique name for your theme. duplicate names are not allowed, so you may need to try a few times to find a unique name. pick a category and tags — select a category and enter some tags that best describe your theme. keep in mind that a reviewer may reject your theme if it is obvious that your category and/or tags are unrelated to your theme. describe your theme — write a short
description of your theme. keep in mind that a reviewer may reject your theme if your
description is not an accurate representation of your theme. select a license for your theme — decide on a copyright license for your work. read more about the types of creative common licenses. important: please be sure you have the rights to use the image in your theme! upload your image — make sure it is...
Bugzilla
ck if the problem you're reporting has been already tracked. this guide will help you do so. view all... other materials an introduction to bugzilla bugzilla for humans bugzilla quicksearch help page. quicksearch is a quick, easy, and very effective way of quickly querying bugzilla. testopia - test case management extension bugzilla.org - the project site wikipedia:bugzilla - general
description of bugzilla (not specific to mozilla projects) bmo on wiki.mozilla.org - information about mozilla's customized bugzilla installation, including how to contribute to it tools bugzilla todos lists review and flag requests, patches to check in, unfulfilled requests you made of other people, and assigned bugs. bz kanban is a board to visualize the status of bugs within a milestone. ...
Chrome registration
of chrome for a given window type (e.g., for the browser window) is called a chrome provider. the providers work together to supply a complete set of chrome for a particular window, from the images on the toolbar buttons to the files that describe the text, content, and appearance of the window itself. there are three basic types of chrome providers: content the main source file for a window
description comes from the content provider, and it can be any file type viewable from within mozilla. it will typically be a xul file, since xul is designed for describing the contents of windows and dialogs. the javascript files that define the user interface are also contained within the content packages, as well as most xbl binding files. locale localizable applications keep all their localized informa...
Command line options
ommand line options command line options follow the command to start the application. if the option contains arguments, enter the argument after the option. some options have abbreviations, for example, "-editor" can be abbreviated as "-edit" (available abbreviations are described in the text below). in some cases, option arguments must be enclosed in quotation marks (this is noted in the option
descriptions below). multiple command line options can be specified. in general, the syntax is as follows: application -option -option "argument" -option argument examples the following examples show the use of the "-profilemanager" command, which will open the profile manager prior to starting firefox or thunderbird: windows select run from windows start menu. enter the following command: firefox -pr...
Creating a Login Manager storage module
s a javascript component that implements a dummy nsiloginmanagerstorage interface. see how_to_build_an_xpcom_component_in_javascript for more details about javascript components. ...
Makefile - targets
compile firefox, thunderbird, etc check standalone shell unit test invoked directly by make configure launch the configure program to define headers and and attributes for the target build machine. ...
mach
when these modules are loaded, mach looks for specific signatures to detect mach commands. currently, this is implemented through python decorators. here is a minimal mach command module: from __future__ import print_function, unicode_literals from mach.decorators import ( commandargument, commandprovider, command, ) @commandprovider class machcommands(object): @command('doit',
description='run it!') @commandargument('--debug', '-d', action='store_true', help='do it in debug mode.') def doit(self, debug=false): print('i did it!') from mach.decorators we import some python decorators which are used to define what python code corresponds to mach commands. the decorators are: @commandprovider this is a class decorator that tells mach that this class conta...
Experimental features in Firefox
sions of firefox along with information on how to activate them, if necessary. you can test your web sites and applications before these features get released and ensure everything will still work with the latest web technology capabilities. to test these experimental features, you need to download firefox nightly or firefox developer edition. which you need is described alongside each feature's
description below. editor's note: when adding features to these tables, please try to include a link to the relevant bug or bugs using the bug macro: {{bug(bug-number)}}. html element: <dialog> the html <dialog> element and its associated dom apis provide support for html-based modal dialog boxes. the current implementation is a little inelegant but is basically functional. see bug 840640 for more deta...
Performance
delaying the script registration until the session is restored my provide some middle ground for some addons. it does not provide the same memory footprint reductions but it improves application startup. beam down information in advance to avoid synchronous calls to the parent bad: // processscript.js function contentpolicy() { // ... ...
Firefox and the "about" protocol
there is a lot of useful information about firefox hidden away behind the about: url protocol. the most useful is the url about:config, which displays preferences and settings that can be inspected and changed. available about: urls depend on your specific firefox version. ...
mozbrowseractivitydone
returnvalue is false, no mozbrowseractivitydone event will be generated as of the landing of bug 1194525 in firefox os 2.5. postresult and posterror calls made on such an activity will be ignored and have no effect. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowserasyncscroll
user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowserasyncscroll event is fired when the content of a browser <iframe> is scrolled. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowseraudioplaybackchange
lso be large incompatibilities between implementations and the behavior may change in the future. the mozbrowseraudioplaybackchange event is fired when audio starts or stops playing within a browser <iframe>. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only boolean indicates whether audio is playing in the browser. ...
mozbrowsercaretstatechanged
e in the future. the mozbrowsercaretstatechanged event is fired when the user selects content in a page loaded in a browser <iframe>. this is used by the embedder to show a context menu for clipboard actions. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowserclose
ay also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowserclose event is fired when the content of a browser <iframe> calls the window.close() method. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. example var browser = document.queryselector("iframe"); ...
mozbrowsercontextmenu
ehavior may change in the future. the mozbrowsercontextmenu event is fired when the user tried to access a context menu over a browser <iframe>. this event can be used to control what will appear in the menu. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowserdocumentfirstpaint
o be large incompatibilities between implementations and the behavior may change in the future. the mozbrowserdocumentfirstpaint event is fired when a new paint occurs on any document in the browser <iframe>. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. example var browser = document.queryselector("iframe"); ...
mozbrowsererror
so be large incompatibilities between implementations and the behavior may change in the future. the mozbrowsererror event is fired when an error occurs while trying to load content within a browser <iframe>. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. detail the detail property returns...
mozbrowserfindchange
the mozbrowserfindchange event is fired when a search method is invoked in the browser <iframe> content. this includes htmliframeelement.findall(), htmliframeelement.findnext(), and htmliframeelement.clearmatch(). general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowserfirstpaint
mplementations and the behavior may change in the future. the mozbrowserfirstpaint event is fired when the <iframe> paints content for the first time (this doesn't include the initial paint from about:blank). general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. example var browser = document.queryselector("iframe"); ...
mozbrowsericonchange
the mozbrowsericonchange event is sent when a new icon (e.g. <link rel="icon"> or <link rel="apple-touch-icon">) is available in the browser <iframe>'s content. it will be fired once for each icon available. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowserloadend
<iframe> has finished loading all its assets, or has failed to load. this can be used when the embedder wants to stop spinning a loading indicator, or update the ui in some other way to indicate loading is complete. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. detail the detail property returns...
mozbrowserloadstart
event is fired when the browser <iframe> starts to load a new page. this can be used when the embedder wants to start spinning a loading indicator, or update the ui in some other way to indicate loading has started. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. example in this example the mozbrowserloadend and mozbro...
mozbrowserlocationchange
bilities between implementations and the behavior may change in the future. the mozbrowserlocationchange event is fired when a browser <iframe>'s location changes — it is fired every time navigation occurs. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. detail the detail property returns...
mozbrowsermanifestchange
sermanifestchange event is fired when the manifest location of the app loaded in the browser <iframe> changes. by this, we are referring to the href of the manifest, as defined in <link rel="manifest" href=" … ">. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowsermetachange
ntations and the behavior may change in the future. the mozbrowsermetachange event is fired when a <meta> element related to web applications is added, removed or changed. see below for the applicable types. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowseropensearch
n-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowseropensearch event is fired when a link to a search engine is found — i.e. when an instance of <link rel="search" type="application/opensearch
description+xml"> is encountered. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the ...
mozbrowseropentab
the future. the mozbrowseropentab event is fired when a new tab is opened within a browser <iframe> as a result of the user issuing a command to open a link target in a new tab (for example ctrl/cmd + click.) general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowseropenwindow
rame> successfully calls the window.open() method, or the user clicks on a link with an unknown target. the embedder must use the <iframe> passed in the event.details.frameelement property as the new window content. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowserresize
user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowserresize event is fired when a browser <iframe> viewport is resized in some way. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowserscroll
work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowserscroll event is fired when the browser <iframe> content scrolls. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowserscrollareachanged
e future. the mozbrowserscrollareachanged event is fired when the available scrolling area in the browser <iframe> changes. this can occur on resize and when the page size changes (while loading for example.) general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowserscrollviewchange
re may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowserscrollviewchange event is fired when asynchronous scrolling (i.e. apcz) starts or stops. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowsersecuritychange
between implementations and the behavior may change in the future. the mozbrowsersecuritychange event is fired when the browser <iframe> has connected to the server, and when the mixed content state changes. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowserselectionstatechanged
rowserselectionstatechanged event is fired when the text selected inside the browser <iframe> content changes. note that this is deprecated, and current implementations should use mozbrowsercaretstatechanged instead. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowsershowmodalprompt
entations and the behavior may change in the future. the mozbrowsershowmodalprompt event is fired when the content of a browser <iframe> calls the window.alert(), window.confirm(), or window.prompt() methods. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property is an...
mozbrowsertitlechange
tibilities between implementations and the behavior may change in the future. the mozbrowsertitlechange event is fired when the title of a browser <iframe> (i.e. the contents of the <title> element) changes. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. detail read only string the title of the document. example var browser = doc...
mozbrowserusernameandpasswordrequired
requires an http authentification. the embedder is supposed to retrieve the necessary credentials, usually using a dialog or a database of username/passwords, and then call authenticate() or cancel() as appropriate. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
mozbrowservisibilitychange
ns and the behavior may change in the future. the mozbrowservisibilitychange event is fired when the visibility state of the current browser iframe <iframe> changes, for example due to a call to setvisible(). general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type
description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property retur...
MozScrolledAreaChanged
t reflow, which can make them computationally expensive. this event, introduced in gecko 1.9.2, is fired whenever either or both of these values change. specification mozilla specific interface uievent bubbles yes cancelable yes target defaultview, document default action none properties property type
description targetread only eventtarget the event target (the topmost target in the dom tree). typeread only domstring the type of event. bubblesread only boolean whether the event normally bubbles or not. cancelableread only boolean whether the event is cancellable or not. viewread only windowproxy document.defaultview (wind...
smartcard-insert
the smartcard-insert event is fired when the insertion of a smart card has been detected specification mozilla specific interface event bubbles no cancelable no target document default action none properties property type
description targetread only eventtarget the event target (the topmost target in the dom tree). typeread only domstring the type of event. bubblesread only boolean whether the event normally bubbles or not. cancelableread only boolean whether the event is cancellable or not. example document.addeventlistener("smartcard-insert", smartcardchangehandler ); related events smartcard-remove ...
smartcard-remove
the smartcard-remove event is fired when the removal of a smart card has been detected. specification mozilla specific interface event bubbles no cancelable no target document default action none properties property type
description targetread only eventtarget the event target (the topmost target in the dom tree). typeread only domstring the type of event. bubblesread only boolean whether the event normally bubbles or not. cancelableread only boolean whether the event is cancellable or not. example document.addeventlistener("smartcard-remove", smartcardchangehandler ); related events smartcard-insert ...
Embedding Tips
e" preference. how do i display my own message, alert and prompt boxes? you need to implement and register your own prompt service. how do i get the dom document from the web browser object? nscomptr<nsidomdocument> doc; nscomptr<nsidomwindow> window; webbrowser->getcontentdomwindow(getter_addrefs(window)); if (window) { window->getdocument(getter_addrefs(doc)); } what is the docshell? a
description of the docshell may be found here. how do i implement context menus? make your chrome object implement the nsicontextmenulistener or nsicontextmenulistener2. the nsicontextmenulistener::onshowcontextmenu() method will be called with the dom node that the context applies, the dom event plus some flag combinations that assist in determining what menu to display (document, link, image, selected te...
Gecko
o event reference reference to events used within gecko and mozilla applications; for web-standard dom events, see the dom event reference. introduction to layout in mozilla tech talk on layout. embedding mozilla using gecko in your own application. character sets supported by gecko a list of the character sets supported by gecko. html parser threading
description of multithreading in the html parser. gecko home page on mozillawiki home for the active developers. roadmaps and more up-to-date resources. view all… community view mozilla forums: mailing list newsgroup rss feed related topics web standards xul embedding mozilla developing mozilla ...
How Mozilla determines MIME Types
. the "data source" (that is, the list of helper applications) is searched for an entry with the mime type of the uri. the data source is the mimetypes.rdf file in the profile directory. if this fails, the data source is searched via the extension (content-disposition as above). if one of these lookups succeed, this is where the application in the "open with" field comes from, and also where the
description of the type comes from. if this also failed, the extras are searched again, and will supply the extension-list and a
description of the mime type. related information document loading - from load start to finding a handler original document information author(s): christian biesinger last updated date: march 7, 2005 copyright information: copyright (c) christian biesinger ...
AddonAuthor
represents a creator, developer, contributor or translator of an add-on attributes attribute type
description name string the name of the person. url optional string an optional url with details about the person. ...
AddonInstall
ddonmanager. once you have an instance the install() method is used to start automatic download and installation. this can be canceled at any time with the cancel() method. method overview void install() void cancel() void addlistener(in installlistener listener) void removelistener(in installlistener listener) properties attribute type
description name string the name of the add-on being installed. version string the version of the add-on being installed. iconurl string the icon of the add-on being installed. releasenotesuri nsiuri the uri of release notes for this install. type string the type of the add-on being installed. state integer the state of...
AddonScreenshot
thumbnailurl optional string the url of a thumbnail version of the screenshot. caption optional string the caption of the screenshot. width optional string the width of the screenshot. height optional string the height of the screenshot. thumbnailwidth optional string the thumbnailwidth of the screenshot. ...
AddonType
name string the localized name for the type. uipriority integer a number used to determine the order of types displayed in the user interface. the lower the number the higher in the list the type will appear. ...
AddonUpdateChecker
error_download_error there was an error while downloading the update information. error_parse_error the update information was malformed in some way. error_unknown_format the update information was not in any known format. error_security_error the update information was not signed by the update k...
UpdateInfo
updateurl string the updateurl that the update can be downloaded from. updatehash string a hash for the update's file. updateinfourl string a url containing simple release notes for the update. ...
Add-on Repository
issearching boolean true if a search is currently in progress; otherwise false. methods getrecommendedurl() returns the url that can be visited to see recommended add-ons. string getrecommendedurl(); parameters none. return value an url indicating the repository's page of recommended add-ons...
AsyncShutdown.jsm
n of profilebeforechange }); if the promise returned by condition is not resolved/rejected within one minute, the process will crash to avoid blocking system shutdown, preventing the user from restarting firefox or burning through battery. this is by design. it is the caller's responsibility to ensure that the promise is eventually resolved/rejected. properties attribute type
description profilebeforechange read only phase the profile is about to be unmounted. this phase represents the last chance to write data to the profile directory. sendtelemetry read only phase telemetry is being sent. this phase represents the last chance for telemetry to write data. webworkersshutdown read only phase javascript...
Dict.jsm
items iterator returns an iterator over all of the items in the dictionary; each item is returned as a pair (a two-element array) with the first element being the key and the second being the value. note: the order in which items are returned is arbitrary, and may change without notice. in addition, if the...
Download
d object can be created using the downloads.createdownload() function. method overview promise start(); promise launch(); promise showcontainingdirectory(); promise cancel(); promise removepartialdata(); promise whensucceeded(); promise finalize([optional] boolean aremovepartialdata); properties attribute type
description canceled read only boolean indicates that the download has been canceled. this property can become true, then it can be reset to false when a canceled download is restarted. this property becomes true as soon as the cancel() method is called, though the stopped property might remain false until the cancellation request has been processed. temporary files or part files ma...
DownloadError
becausesourcefailed read only boolean indicates an error occurred while reading from the remote location. ...
DownloadSource
isprivate read only boolean indicates whether the download originated from a private window. this determines the context of the network request that is made to retrieve the resource. ...
DownloadSummary
provides an aggregated view on the contents of a downloadlist. a reference to a downloadsummary object can be obtained using the downloads.getsummary() function. method overview promise bindtolist(downloadlist alist); promise addview(object aview); promise removeview(object aview); properties attribute type
description allhavestopped read only boolean indicates whether all the downloads are currently stopped. progresstotalbytes read only number indicates the total number of bytes to be transferred before completing all the downloads that are currently in progress. for downloads that do not have a known final size, the number of bytes cur...
DownloadTarget
this is a dynamic property, which is updated when the download is completed or when the download.refresh() method is called. ...
Downloads.jsm
e module into your javascript scope: components.utils.import("resource://gre/modules/downloads.jsm"); method overview promise<download> createdownload(object aproperties); promise<void> fetch(asource, atarget, [optional] object aoptions); promise<downloadlist> getlist(atype); promise<downloadsummary> getsummary(atype); constants constant
description public work on downloads that were not started from a private browsing window. private work on downloads that were started from a private browsing window. all work on both downloads.private and downloads.public downloads. properties attribute type
description error read only constructor constructor for a downloaderror obje...
FileUtils.jsm
utputstream(nsifile file, int modeflags); nsifileoutputstream openatomicfileoutputstream(nsifile file, int modeflags); nsifileoutputstream opensafefileoutputstream(nsifile file, int modeflags); void closeatomicfileoutputstream(nsifileoutputstream stream); void closesafefileoutputstream(nsifileoutputstream stream); constants constant value
description mode_rdonly 0x01 corresponds to the pr_rdonly parameter to pr_open mode_wronly 0x02 corresponds to the pr_wronly parameter to pr_open mode_create 0x08 corresponds to the pr_create_file parameter to pr_open mode_append 0x10 corresponds to the pr_append parameter to pr_open mode_truncate 0x20 corresponds to the pr_truncate p...
FxAccountsProfileClient.jsm
ile => console.log(profile)); error handling the fxaccountsprofileclient.jsm normalizes request and client errors into fxaccountsprofileclienterror object. fxaccountsprofileclienterror attributes name string name of the error fxaccountsprofileclienterror code number status code of the request errno number error number error string error
description message string error message ...
Following the Android Toasts Tutorial from a JNI Perspective
this article is a work in progress and is based on githubgist :: _ff-addon-tutorial-jniandroidtoast.js this article will follow the android developers :: api guides - toasts tutorial. it will use the jni.jsm module that is available in firefox for android since version 17. this article teaches developers how to port java code to jni by reading the java and android documentation. toast
description a toast provides simple feedback about an operation in a small popup. it only fills the amount of space required for the message, and the current activity remains visible and interactive. for example, navigating away from an email before you send it triggers a "draft saved" toast to let you know that you can continue editing later. toasts automatically disappear after a timeout. toasts do not have to ...
JNI.jsm
nts(number astart, [array, size_is(arr.length > number anynumber > 0)] in cdata avalsarray); parameters astart the position to start setting elements of the array in. avalsarray a javascript array holding the values to set. return value this function has no return value, if you try to store the return value in a variable, it will be undefined. ...
Log.jsm
newoutputstream(); outputstream reset(); structuredformatter(); length: 0 keys of prototype: format(); method overview enumerateinterfaces(); length: 0 enumerateproperties(); length: 2 member fields variable type
description level object contains the following fields: field name value all 0 config 30 debug 20 desc { 0: "all", 10: "trace", 20: "debug", 30: "config", 40: "info", 50: "warn", 60: "error", 70: "fatal" } error 30 ...
PopupNotifications.jsm
: this code module is imported by firefox chrome windows, so you don't have to do it yourself in most extensions. method overview void locationchange(); notification getnotification(id, browser); void remove(notification); notification show(browser, id, message, anchorid, mainaction, secondaryactions, options); properties attribute type
description ispanelopen boolean returns true if the notification panel is currently visible, false if it is not. methods locationchange() the consumer can call this method to let the popup notification module know that the current browser's location has changed. this lets the notification service update the active notifications as appropriate. note: you shouldn't need to call this wh...
Deferred
methods resolve() fulfills the associated promise with the specified value, or propagates the state of an existing promise. if the associated promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing. note: this function is bound to its...
Deferred
methods resolve() fulfills the associated promise with the specified value, or propagates the state of an existing promise. ...
Sqlite.jsm
rs as if nothing happened. the promise is still resolved (not rejected). the return promise will be rejected with an error instance if the statement did not finish execution fully. the error may have an errors property. if defined, it will be an array of objects describing individual errors. each object has the properties result and message. result is a numeric error code and message is a string
description of the problem. if onrow is specified, the returned promise will be resolved with a boolean indicating whether the onrow handler was called. else, the resolved value will be an array of mozistoragerow. executetransaction(func, type) this function is used to execute a database transaction. a transaction is a series of related statements treated as one functional unit. if the transaction succeed...
Task.jsm
, and the yield operator returns the return value of the function. this comes in handy when iterating over function lists where some items have been converted to tasks and some not. if you specify anything else, the yield operator returns exactly what you specified. method overview function async(atask); promise spawn(atask); properties attribute type
description result read only constructor constructs a special exception that, when thrown inside a legacy generator function, allows the associated task to be resolved with a specific value. example: task.spawn( function() { yield ... ; throw new task.result("value"); } note: if you want to exit early from a generator function, without returning a value for the task, you can just us...
Application Translation with Mercurial
ly trusted to change the official translation can review the suggested changes. file a bug ("ticket") in the mozilla localization product and choose as component the localization for which you have translated. choose a meaningful bug summary which will be shown for searches etc. like in this example "firefox 29: aboutprivatebrowsing.dtd" fill any important and additional information into the
description field. click the 'add attachment' button. select the exported patch file with the file picker. the checkbox for 'patch' should get automatically checked. add a meaningful name for the attachment, e.g. aboutprivatebrowsing.dtd, patch, v1 go to the review 'flags' category and set the one for review to ?, meaning that you request review for the patch. in the text field next to it, add the mail ...
Bootstrapping a new locale
rty file. you will need to go through each and every file to in every directory in ab-cd. recommended order of localization for recommended order of localization, refer to the localization "phase list" which provides a very rough guide on where to start and in what order to proceed through translation. the localization phase lists (firefox 3.5: ff35.phaselist, firefox 3.6: ff36.phaselist).
description of phases. land your translated files one by one, making sure it follows the *mozilla-1.9.2* structure. this will familiarize you with our "hg" commands and will get us something that we can import easily when you are done. working with bit bucket before a team becomes official, we like to get the localizers comfortable with the hg commands that allow for cloning, pulling, committing, and p...
Index
loss or corruption. most translation tools support the xliff standard, making localizing the xliff files for firefox for ios easy to do using translation tools. editing the raw xliff file is also rather easy, especially if you're already familiar with xml. this tutorial will walk you through the steps you need to take to translation strings within an xliff file. 21 localizing extension
descriptions add-ons, extensions, guide, internationalization, localization this article provides details on how to go about localizing the
descriptions of mozilla add-ons, as well as for other metadata about your add-on. 22 localizing extension metadata on addons.mozilla.org add-ons, extensions, internationalization, localization amo supports localized metadata for each extens...
Localization and Plurals
the following list of plural rules. list of plural rules this section contains a list of plural rules ordered by their plural rule number. each entry indicates how many plural forms are needed when localizing a word. for each entry, there is a list of families and languages in those families, to help you figure out if it's the rule you should pick for pluralrule. additionally, there is a brief
description of each plural form, followed by some sample numbers that fall into that particular form. for a given plural rule, the order in which the plural forms are listed is the same order you need to localize a word, separated by semi-colons. for example, english uses plural rule 1, and localizing plurals would require a string of "plural;plurals" where the first word is the singular form and the second...
Localizing without a specialized tool
u will need to go through each and every file to in every directory in the x-testing directory. recommended order of localization for recommended order of localization, refer to the localization "phase list" which provides a very rough guide on where to start and in what order to proceed through translation. the localization phase lists (firefox 3.5: ff35.phaselist, firefox 3.6: ff36.phaselist).
description of phases. land your translated files one by one, making sure it follows the *mozilla-1.9.2* structure. this will familiarize you with our "hg" commands and will get us something that we can import easily when you are done. ...
Localization technical reviews
pack_creator. the team can also wrap contributors with <em:contributor> tags just after the moz_langpack_contributors section. make sure that the the text content is wrapped with emptylines. leading comments are ok, but watch out for #filter emptylines #define ... # comment #define ... #unfilter emptylines in toolkit/defines.inc, the native name of the language is specified, which is used as
description for the built language packs. region.properties though locales might like to specify changes from the beginning, the region.properties files will be reverted to en-us. changes will be discussed in productization bugs filed for each locale. search plugins similar to the region.properties files, the list.txt file should be reverted to en-us and amended accordingly as the search plugin produ...
Creating localizable web applications
ot your password?"), $locale_conf->url('/'), $locale_conf->url('/signin'));?> </p> snippet 6. good: <p id="breadcrumbs"> <?printf("<a href=\"%s\">" . _("personas home") . "</a> : <a href=\"%s\">" . _("sign in") . "</a> : " . _("forgot your password?"), $locale_conf->url('/'), $locale_conf->url('/signin'));?> </p> snippet 7. bad: <p class="
description"><?= _("<strong>
description:</strong>");?></p> snippet 8. good: <p class="
description"><strong><?= _("
description:");?></strong></p> snippet 9. good: <h1> <?printf("<a href=\"%s\"><img src=\"/static/img/logo.png\" alt=\"" . _("mozilla labs personas") . "\" /></a>", $locale_conf->url('/'));?> </h1> snippet 10. better: <h1> <a href="<?= $locale_conf->url('/') ?>"> <img s...
Updates
omplete 8,000 word interview. interview to the apc magazine where mitchell baker mentions roger sidje's work on mathml. june 5, 2002 mozilla 1.0 released "by virtue of embedding gecko, mozilla 1.0 and products based on mozilla code support more web standards, more deeply, more consistently across more platforms than any others. ...
MathML Accessibility in Mozilla
sion of orca. we try to keep in sync with webkit/atk/orca developments. at the moment, it is recommended to use a nightly build to ensure that the accessible tree expected by orca is correctly exposed. accessfu: mathml support in android and firefox os is currently being implemented in our accessfu module and a patch is available on bug 1163374. the table gives the output in mode "utterance" and
description spoken last. note that this is still very experimental. mathml windows mac linux accessfu diagonal of a regular pentagon video video video / x+2 __________ x plus 2 __________ x+2 x plus 2 x + y ab __________ a over b __________ fraction start, a over b, end of fr...
Mozilla projects on GitHub
s within the mozilla github organization. this is a great place to start looking for any projects not listed below. projects this listing covers the larger-scale and more important mozilla projects on github. it does not include everything since it's hard to keep track of all the smaller projects. look to github for the most complete list of mozilla projects on github. project name
description pdf.js a portable document format (pdf) reader written entirely in javascript. shumway shumway is a flash vm and runtime written in javascript. addon-sdk the mozilla add-on sdk. asknot the what can i do for mozilla web site, which helps you figure out how you can contribute to mozilla. bugsahoy a web page to help new mozilla contribu...
Investigating leaks using DMD heap scan mode
n edges: 0x7f08975a24c0 [fragmentorelement (xhtml) head https://www.example.com] --[mattrsandchildren[i]]--> 0x7f0882fe3230 0x7f08967e7b20 [js object (htmlscriptelement)] --[unwrapdomobject(obj)]--> 0x7f0882fe3230 the first two lines mean that the script element 0x7f0882fe3230 contains a strong reference to the eventlistenermanager 0x7f0899b4e550. "[via hash] mlistenermanager" is a
description of that strong reference. together, these lines show a chain of strong references from an object the cycle collector thinks needs to be kept alive, 0x7f0899b4e550, to the object 0x7f0897082c00 that you asked about. most of the time, the actual chain is not important, because the cycle collector can only tell us about what went right. let us call the address of the leaking object (0x7f0882fe3230 i...
DMD
oad/memory-reports/unified-memory-report-default-20731.json.gz the path is where the memory reports and dmd reports get dumped to. you can pull them like so: adb pull /sdcard/download/memory-reports/dmd-default-20731.json.gz adb pull /sdcard/download/memory-reports/unified-memory-report-default-20731.json.gz processing the output dmd outputs one gzipped json file per process that contains a
description of that process's heap. you can analyze these files (either gzipped or not) using dmd.py. on nightly firefox, dmd.py is included in the distribution. for instance on os x, it is located in the directory /applications/firefox nightly.app/contents/resources/. for nightly, symbolication will fail, but you can at least get some information. in a local build, dmd.py will be located in the directory $o...
Memory reporting
orter makes one or more memory measurements (a.k.a. reports). each reporter implements a collectreports function which takes a nsimemoryreportercallback argument; for each measurement the reporter must pass in several values, including: a path (which identifies the report); an amount (the most important thing); a unit (most commonly bytes, but sometimes a unitless count or percentage); a
description of what is measured. see the nsimemoryreporter documentation and nsimemoryreporter.idl for full details. making measurements nsimemoryreporter provides the high-level interface for a memory reporter, but the heart of a memory reporter is the measurement of the "amount". two ways to measure memory reporters can be divided into the two following kinds. traversal-based reporters traverse on...
Profiling with the Firefox Profiler
debug long startups. if you'd like a coarser resolution, you can also choose a different interval using moz_profiler_startup_interval, which defaults to 1 (unit is millisecond). you can't go below 1 ms but you can use e.g. 10 ms. if the default threads to be profiled are insufficient, you can choose which threads to profile using moz_profiler_startup_filters, which is a comma separated list.
description of all available environment variables may be printed by starting firefox with moz_profiler_help=1 set. if you want to profile firefox for android, you have to set this environment values by --es option of am command to launch firefox. this example is for firefox nightly (package name is org.mozilla.fennec_aurora), and you have to allow storage access on permission settings before launching it. ...
about:memory
bout:memory?file=/home/username/reports.json.gz this is most useful when loading memory reports files obtained from a firefox os device. memory reports are saved to file as gzipped json. these files can be loaded as is, but they can also be loaded after unzipping. interpreting memory reports almost everything you see in about:memory has an explanatory tool-tip. hover over any button to see a
description of what it does. hover over any measurement to see a
description of what it means. measurement basics most measurements use bytes as their unit, but some are counts or percentages. most measurements are presented within trees. for example: 585 (100.0%) -- preference-service └──585 (100.0%) -- referent ├──493 (84.27%) ── strong └───92 (15.73%) -- weak ...
Profile Manager
art firefox" button: firefox will be launched with that profile, and profile manager will terminate. the version of firefox which will be launched is indicated in the "firefox version" dropdown in the launch options box: there are several additional launch options available for firefox. these cause firefox to be launched with various command-line arguments. see command line options for a
description of these. launch option command line argument run firefox in offline mode -offline run firefox in safe mode -safe-mode start firefox with a console -console start new instance -no-remote note: it isn't possible to start a second instance of firefox without passing it the -no-remote command line argument. for this reason, if ...
AsyncTestUtils extended framework
the asynctestutils extended framework is one mechanism for testing the mailnews component of thunderbird. see mailnews automated testing for a
description of the other testing mechanisms. boilerplate add the following code to the top of your test file to import everything you need: load("../../mailnews/resources/loghelper.js"); load("../../mailnews/resources/asynctestutils.js"); load("../../mailnews/resources/messagegenerator.js"); load("../../mailnews/resources/messagemodifier.js"); load("../../mailnews/resources/messageinjection.js"); if the directory where you are adding the tests does not have a head_*.js file that has the two following lines, add them at the top of your test file (before the lines shown above): load("../../mailnews/resources/maildirservice.js"); load("../../mai...
MailNews
uding: communications protocols - smtp, pop3, imap, nntp message management, including search and filtering message composition address book the mailnews code lives in the mailnews/ directory of comm-central. asynctestutils extended framework the asynctestutils extended framework is one mechanism for testing the mailnews component of thunderbird. see mailnews automated testing for a
description of the other testing mechanisms. leak and bloat tests this page describes how to perform tests that measure memory leaks and bloat for mailnews and its sub-components. mailnews automated testing automated testing is an increasingly significant and important part of mailnews development. it allows reviewers to quickly pick up regressions in patches and helps developers to think about d...
Midas
ent state. document.querycommandindeterm determines whether the current selection is in an indetermined state. document.querycommandstate determines whether the given command has been executed on the current selection. document.querycommandvalue determines the current value of the document, range, or current selection for the given command. supported commands command value
description backcolor a color code. this command will set the background color of the document. bold if there is no selection, the insertion point will set bold for subsequently typed characters. if there is a selection and all of the characters are already bold, the bold will be removed. otherwise, all selected characters will become bold. contentreadonly ...
NSPR Contributor Guide
good candidate for inclusion in nspr; we may give you suggestions on what would make it more generalized, hence a good candidate for inclusion in nspr. use bugzilla to track your work. be verbose. nspr wants you to document your work. if we accept it, we are going to have to answer questions about it and/or maintain it. these are some guidelines for new apis that you may add to nspr. header file
descriptions. provide header file
descriptions that fully document your public typedefs, enums, macros and functions. see: prshm.h as an example of how your header file(s) should be documented. source file
descriptions. provide descriptive documentation in your source (*.c) files. alas, we have no source files documented as we think they should be. the following are some general guidelines to use when implem...
NSPR LOG FILE
if nspr_log_file is not in the environment, then log output is written to stdout or stderr, depending on the platform. set nspr_log_file to the name of the log file you want to use. nspr logging, when enabled, writes to the file named in this environment variable. ...
NSPR LOG MODULES
name specified in a pr_newlogmodule call or one of the handy magic names listed below. level is a numeric value between 0 and 5, with the values having the following meanings: 0 = pr_log_none: nothing should be logged 1 = pr_log_always: important; intended to always be logged 2 = pr_log_error: errors 3 = pr_log_warning: warnings 4 = pr_log_debug: debug messages, notices 5: everything!
description specify a modulename that is associated with the name argument in a call to pr_newlogmodule and a non-zero level value to enable logging for the named modulename. special log module names are provided for controlling nspr's log service at execution time. these controls should be set in the nspr_log_modules environment variable at execution time to affect nspr's log service for your application...
PLHashAllocOps
a pair of functions is used to allocate and tree the table, and another pair of functions is used to allocate and free the table entries. the first argument, pool, for all four functions is a void * pointer that is a piece of data for the memory allocator. typically pool points to a memory pool used by the memo...
PLHashComparator
it returns a nonzero value if the two values are equal, and 0 if the two values are not equal. plhashcomparator defines the meaning of equality for the unspecified type. for convenience, two comparator functions are provided. pl_comparestrings compare two character strings using strcmp. pl_comparevalues compares the values of the arguments v1 and v2 numerically. ...
PLHashEntry
an entry has a key and a value, represented by the following fields in the plhashentry structure. const void *key; void *value; the key field is a pointer to an opaque key. the value field is a pointer to an opaque value. if the key of an entry is an integral value that can fit into a void * pointer, you can just cast the key itself to void * and store it in the key field. similarly, if the value of an entry is an integral value that can fit into a void * pointer, you can cast the value itself to void * and store it in the value field. ...
PLHashEnumerator
when all the table entries are enumerated, each entry is passed to a user-specified function of type plhashenumerator with the hash table entry, an integer index, and an arbitrary piece of user data as argument. remark the meaning of ht_enumerate_unhash is not clear. in the current implementation, it will leave the hash ...
PLHashNumber
plhashnumber is the data type of the return value of a hash function. a hash function maps a key to a hash number, which is then used to compute the index of the bucket. ...
PLHashTable
entries in the table have the type plhashentry and are organized into buckets. the number of buckets in a hash table may be changed by the library functions during the lifetime of the table to optimize speed and space. ...
PL_CompareValues
compares two void * values numerically. syntax #include <plhash.h> printn pl_comparevalues(const void *v1, const void *v2);
description pl_comparevalues compares the two void * values v1 and v2 numerically, i.e., it returns the value of the expression v1 == v2. pl_comparevalues can be used as the comparator function for integer or pointer-valued key or entry value. ...
PL_HashString
a general-purpose hash function for character strings. syntax #include <plhash.h> plhashnumber pl_hashstring(const void *key); parameter the function has the following parameter: key a pointer to a character string. returns the hash number for the specified key.
description pl_hashstring can be used as the key hash function for a hash table if the key is a character string. ...
PL_HashTableAdd
ash table. syntax #include <plhash.h> plhashentry *pl_hashtableadd( plhashtable *ht, const void *key, void *value); parameters the function has the following parameters: ht a pointer to the the hash table to which to add the entry. key a pointer to the key for the entry to be added. value a pointer to the value for the entry to be added. returns a pointer to the new entry.
description add a new entry with the specified key and value to the hash table. if an entry with the same key already exists in the table, the freeentry function is invoked with the ht_free_value flag. you can write your freeentry function to free the value of the specified entry if the old value should be freed. the default freeentry function does not free the value of the entry. pl_hashtableadd returns ...
PL_HashTableDestroy
frees the table and all the entries. syntax #include <plhash.h> void pl_hashtabledestroy(plhashtable *ht); parameter the function has the following parameter: ht a pointer to the hash table to be destroyed.
description pl_hashtabledestroy frees all the entries in the table and the table itself. the entries are freed by the freeentry function (with the ht_free_entry flag) in the allocops structure supplied when the table was created. ...
PL_HashTableEnumerateEntries
cified function on each entry. syntax #include <plhash.h> printn pl_hashtableenumerateentries( plhashtable *ht, plhashenumerator f, void *arg); parameters the function has the following parameters: ht a pointer to the hash table whose entries are to be enumerated. f function to be applied to each entry. arg argument for function f. returns the number of entries enumerated.
description the entries are enumerated in an unspecified order. for each entry, the enumerator function is invoked with the entry, the index (in the sequence of enumeration, starting from 0) of the entry, and arg as arguments. ...
PL_HashTableLookup
return its value. syntax #include <plhash.h> void *pl_hashtablelookup( plhashtable *ht, const void *key); parameters the function has the following parameters: ht a pointer to the hash table in which to look up the entry specified by key. key a pointer to the key for the entry to look up. returns the value of the entry with the specified key, or null if there is no such entry.
description if there is no entry with the specified key, pl_hashtablelookup returns null. this means that one cannot tell whether a null return value means the entry does not exist or the value of the entry is null. keep this ambiguity in mind if you want to store null values in a hash table. ...
PL_HashTableRemove
removes the entry with the specified key from the hash table. syntax #include <plhash.h> prbool pl_hashtableremove( plhashtable *ht, const void *key); parameters the function has the following parameters: ht a pointer to the hash table from which to remove the entry. key a pointer to the key for the entry to be removed.
description if there is no entry in the table with the specified key, pl_hashtableremove returns pr_false. if the entry exists, pl_hashtableremove removes the entry from the table, invokes freeentry with the ht_free_entry flag to frees the entry, and returns pr_true. if the table is underloaded, pl_hashtableremove also shrinks the number of buckets by half. remark this function should return prstatus. ...
PL_NewHashTable
parameters: numbuckets the number of buckets in the hash table. keyhash hash function. keycompare function used to compare keys of entries. valuecompare function used to compare keys of entries. allocops a pointer to a plhashallocops structure that must exist throughout the lifetime of the new hash table. allocpriv passed as the first argument (pool). returns the new hash table.
description pl_newhashtable creates a new hash table. the table has at least 16 buckets. you can pass a value of 0 as numbuckets to create the default number of buckets in the new table. the arguments keycompare and valuecompare are functions of type plhashcomparator that the hash table library functions use to compare the keys and the values of entries. the argument allocops points to a plhashallocops str...
PL_strcpy
o and including the trailing '\0', into a destination buffer. syntax char * pl_strcpy(char *dest, const char *src); parameters the function has these parameters: dest pointer to a buffer. on output, the buffer contains a copy of the string passed in src. src pointer to the string to be copied. returns the function returns a pointer to the buffer specified by the dest parameter.
description if the string specified by src is longer than the buffer specified by dest, the buffer will not be null-terminated. ...
PL_strdup
returns a pointer to a new memory node in the nspr heap containing a copy of a specified string. syntax #include <plstr.h> char *pl_strdup(const char *s); parameter the function has a single parameter: s the string to copy, may be null. returns the function returns one of these values: if successful, a pointer to a copy of the specified string. if the memory allocation fails, null.
description to accommodate the terminator, the size of the allocated memory is one greater than the length of the string being copied. a null argument, like a zero-length argument, results in a pointer to a one-byte block of memory containing the null value. notes the memory allocated by pl_strdup should be freed with pl_strfree. ...
PRBool
use standard c++ bool instead. otherwise, use prbool for variables and parameter types. use pr_false and pr_true for clarity of target type in assignments and actual arguments. ...
PRCList
a circular linked list. syntax #include <prclist.h> typedef struct prcliststr prclist; typedef struct prcliststr { prclist *next; prclist *previous; };
description prclist defines a node in a circular linked list. it can be used as the anchor of a list and can be embedded in data structures that are maintained in a linked list. ...
PRCallOnceFN
defines the signature of the function a client must implement. syntax #include <prinit.h> typedef prstatus (pr_callback *prcalloncefn)(void);
description the function is called to perform the initialization desired. the function is expected to return a prstatus indicating the outcome of the process. ...
PRCallOnceType
rint32 inprogress; prstatus status; } prcalloncetype; fields the structure has these fields: initialized if not zero, the initialization process has been completed. inprogress if not zero, the initialization process is currently being executed. calling threads that observe this status block until inprogress is zero. status an indication of the outcome of the initialization process.
description the client is responsible for initializing the prcalloncetype structure to all zeros. this initialization must be accomplished before any threading issues exist. ...
PRCondVar
structure for a condition variable. syntax #include <prcvar.h> typedef struct prcondvar prcondvar;
description an nspr condition variable is an opaque object identified by a pointer. ...
PRDescIdentity
each layer has it own identity. identities are allocated by the runtime and are to be associated (by the layer implementor) with all file descriptors of that layer. it is then possible to scan the chain of layers and find a layer that one recognizes, then predict that it will implement a desired protocol. ...
PRDir
directory structure used with directory i/o functions. syntax #include <prio.h> typedef struct prdir prdir;
description the opaque structure prdir represents an open directory in the file system. the function pr_opendir opens a specified directory and returns a pointer to a prdir structure, which can be passed to pr_readdir repeatedly to obtain successive entries (files or subdirectories in the open directory). to close the directory, pass the prdir pointer to pr_closedir. ...
PRErrorCode
the error number namespace is not well managed. nspr assumes error numbers starting at -6000 (decimal) and progressing towards zero. at present less than 100 error codes have been defined. ...
PRExplodedTime
a clock/calendar representation of times. syntax #include <prtime.h> typedef struct prexplodedtime { print32 tm_usec; print32 tm_sec; print32 tm_min; print32 tm_hour; print32 tm_mday; print32 tm_month; print16 tm_year; print8 tm_wday; print16 tm_yday; prtimeparameters tm_params; } prexplodedtime;
description the prexplodedtime structure represents clock/calendar time. prexplodedtime has the familiar time components: year, month, day of month, hour, minute, second. it also has a microsecond component, as well as the day of week and the day of year. in addition, prexplodedtime includes a prtimeparameters structure representing the local time zone information, so that the time point is non-ambiguously specified. the essential members of prexpl...
PRFileDesc
dtor)(prfiledesc *fd); prdescidentity identity; }; typedef struct prfiledesc prfiledesc; parameters methods the i/o methods table. see priomethods. secret layer-dependent implementation data. see prfileprivate. lower pointer to lower layer. higher pointer to higher layer. dtor a destructor function for the layer. identity identity of this particular layer. see prdescidentity.
description the fields of this structure are significant only if you are implementing a layer on top of nspr, such as ssl. otherwise, you use functions such as pr_open and pr_newtcpsocket to obtain a file descriptor, which you should treat as an opaque structure. for more details about the use of prfiledesc and related structures, see file descriptor types. ...
PRFileMap
before actually mapping a file to memory, you must create a memory-mapped file object by calling pr_createfilemap, which returns a pointer to prfilemap. ...
PRFilePrivate
layer-dependent implementation data. syntax #include <prio.h> typedef struct prfileprivate prfileprivate;
description a layer implementor should collect all the private data of the layer in the prfileprivate structure. each layer has its own definition of prfileprivate, which is hidden from other layers as well as from the users of the layer. ...
PRHostEnt
for valid nspr usage, this field must have a value indicating either an ipv4 or an ipv6 address. h_length length of internal representation of the address in bytes. all of the addresses in the list are of the same type and therefore of the same length. h_addr_list pointer to a pointer to a list of addresses from name server (in network byte order). the list is terminated with a null entry.
description this structure is used by many of the network address functions. all addresses are passed in host order and returned in network order (suitable for use in system calls). use the network address functions to manipulate the prhostent structure. to make the transition to ip version 6 easier, it's best to treat prhostent as an opaque structure. note winsock.h defines h_addrtype and h_length as a ...
PRIOMethods
ile descriptor to see if it is ready for i/o. acceptread accept and read from a new network file descriptor. transmitfile transmit an entire file to the specified socket. getsockname get network address associated with a file descriptor. getpeername get peer's network address. getsockopt get current setting of specified socket option. setsockopt set value of specified socket option.
description you don't need to know the type declaration for each function listed in the method table unless you are implementing a layer. for information about each function, see the corresponding function
description in this document. for example, the write method in priomethods implements the pr_write function. for type definition details, see prio.h. the i/o methods table provides procedural access to t...
PRIPv6Addr
it is equivalent to struct in6_addr in the berkeley socket interface. ...
PRInt32
guaranteed to be a signed 32-bit integer on all platforms. syntax #include <prtypes.h> typedefdefinition print32;
description may be defined as an int or a long, depending on the platform. for syntax details for each platform, see prtypes.h. ...
PRInt64
guaranteed to be a signed 64-bit integer on all platforms. syntax #include <prtypes.h> typedef definition print64;
description may be defined in several different ways, depending on the platform. for syntax details for each platform, see prtypes.h. ...
PRIntervalTime
a platform-dependent type that represents a monotonically increasing integer--the nspr runtime clock. syntax #include <prinrval.h> typedef pruint32 printervaltime; #define pr_interval_min 1000ul #define pr_interval_max 100000ul #define pr_interval_no_wait 0ul #define pr_interval_no_timeout 0xfffffffful
description the units of printervaltime are platform-dependent. they are chosen to be appropriate for the host os, yet provide sufficient resolution and period to be useful to clients. the increasing interval value represented by printervaltime wraps. it should therefore never be used for intervals greater than approximately 6 hours. interval times are accurate regardless of host processing requirements and are very cheap to acquire. the constants pr_interval_min and pr_interval_max de...
PRLibrary
an opaque structure identifying a library. syntax #include <prlink.h> typedef struct prlibrary prlibrary;
description a prlibrary is an opaque structure. a reference to such a structure can be returned by some of the functions in the runtime and serve to identify a particular instance of a library. ...
PRLinger
the structure has the following fields: polarity polarity of the option's setting: pr_false means the option is off, in which case the value of linger is ignored. pr_true means the option is on, and the value of linger will be used to determine how long pr_close waits before returning. linger time (in printervaltime units) to linger before closing if any data remain in the socket send buffer.
description by default, pr_close returns immediately, but if there are any data remaining in the socket send buffer, the system attempts to deliver the data to the peer. the pr_sockopt_linger socket option, with a value represented by a structure of type prlinger, makes it possible to change this default as follows: if polarity is set to pr_false, pr_close returns immediately, but if there are any data re...
PRLock
a mutual exclusion lock. syntax #include <prlock.h> typedef struct prlock prlock;
description nspr represents a lock as an opaque entity to clients of the functions described in "locks". functions that operate on locks do not have timeouts and are not interruptible. ...
PRMcastRequest
the pr_sockopt_addmember and pr_sockopt_dropmember socket options that define a request to join or leave a multicast group. syntax #include <prio.h> struct prmcastrequest { prnetaddr mcaddr; prnetaddr ifaddr; }; typedef struct prmcastrequest prmcastrequest; fields the structure has the following fields: mcaddr ip multicast address of group. ifaddr local ip address of interface.
description the mcaddr and ifaddr fields are of the type prnetaddr, but their port fields are ignored. only the ip address (inet.ip) fields are used. ...
PRNetAddr
re has the following fields: family address family: pr_af_inet|pr_af_inet6 for raw.family, pr_af_inet for inet.family, pr_af_inet6 for ipv6.family. data raw address data. port port number of tcp or udp, in network byte order. ip the actual 32 (for inet.ip) or 128 (for ipv6.ip) bits of ip address. the inet.ip field is in network byte order. pad unused. flowinfo routing information.
description the union prnetaddr represents a network address. nspr supports only the internet address family. by default, nspr is built to support only ipv4, but it's possible to build the nspr library to support both ipv4 and ipv6. therefore, the family field can be pr_af_inet only for default nspr, and can also be pr_af_inet6 if the binary supports ipv6. prnetaddr is binary-compatible with the socket add...
PRPackedBool
packed boolean value. syntax #include <prtypes.h> typedef pruint8 prpackedbool;
description use prpackedbool within structures. ...
PRProcess
represents a process. syntax #include <prproces.h> typedef struct prprocess prprocess;
description a pointer to the opaque prprocess structure identifies a process. ...
PRProcessAttr
represents the attributes of a new process. syntax #include <prproces.h> typedef struct prprocessattr prprocessattr;
description this opaque structure describes the attributes of a process to be created. pass a pointer to a prprocessattr into pr_createprocess when you create a new process, specifying information such as standard input/output redirection and file descriptor inheritance. ...
PRSockOption
multicast group. pr_sockopt_mcastinterface ip multicast interface address. pr_sockopt_mcasttimetolive ip multicast time-to-live. pr_sockopt_mcastloopback ip multicast loopback. pr_sockopt_nodelay disable nagle algorithm. don't delay send to coalesce packets. pr_sockopt_maxsegment maximum segment size. pr_sockopt_last always one greater than the maximum valid socket option numerator.
description the prsockoption enumeration consists of all the socket options supported by nspr. the option field of prsocketoptiondata should be set to an enumerator of type prsockoption. ...
PRSocketOptionData
ck. no_delay disable nagle algorithm. don't delay send to coalesce packets. max_segment tcp maximum segment size. recv_buffer_size receive buffer size. send_buffer_size send buffer size. linger time to linger on close if data are present in socket send buffer. add_member join an ip multicast group. drop_member leave an ip multicast group. mcast_if ip multicast interface address.
description prsocketoptiondata is a name-value pair for a socket option. the option field (of enumeration type prsockoption) specifies the name of the socket option, and the value field (a union of all possible values) specifies the value of the option. ...
PRThread
this pointer is a required parameter for most of the functions that operate on threads. a prthread* is the successful result of creating a new thread. ...
PRThreadPriority
for threads that are expected to perform intensive computation. pr_priority_normal the most commonly expected priority. pr_priority_high slightly higher priority than pr_priority_normal. this priority is for threads performing work of high urgency but short duration. pr_priority_urgent highest priority. only one thread at a time typically has this priority. pr_priority_last placeholder
description in general, an nspr thread of higher priority has a statistically better chance of running relative to threads of lower priority. however, because of the multiple strategies nspr uses to implement threading on various host platforms, nspr priorities are not precisely defined. at best they are intended to specify a preference in the amount of cpu time that a higher-priority thread might expect re...
PRThreadPrivateDTOR
the destructor function passed to pr_newthreadprivateindex that is associated with the resulting thread private index. syntax #include <prthread.h> typedef void (pr_callback *prthreadprivatedtor)(void *priv);
description until the data associated with an index is actually set with a call to pr_setthreadprivate, the value of the data is null. if the data associated with the index is not null, nspr passes a reference to the data to the destructor function when the thread terminates. ...
PRThreadScope
tthreadscope. syntax #include <prthread.h> typedef enum prthreadscope { pr_local_thread, pr_global_thread pr_global_bound_thread } prthreadscope; enumerators pr_local_thread a local thread, scheduled locally by nspr within the process. pr_global_thread a global thread, scheduled by the host os. pr_global_bound_thread a global bound (kernel) thread, scheduled by the host os
description an enumerator of type prthreadscope specifies how a thread is scheduled: either locally by nspr within the process (a local thread) or globally by the host (a global thread). global threads are scheduled by the host os and compete with all other threads on the host os for resources. they are subject to fairly sophisticated scheduling techniques. local threads are scheduled by nspr within the p...
PRThreadState
me of release of the resources assigned to the thread cannot be determined in advance. threads created with a pr_unjoinable_thread state cannot be used as arguments to pr_jointhread. pr_joinable_thread joinable thread references remain valid after they have returned from their root function until pr_jointhread is called. this approach facilitates management of the process' critical resources.
description a thread is a critical resource and must be managed. the lifetime of a thread extends from the time it is created to the time it returns from its root function. what happens when it returns from its root function depends on the thread state passed to pr_createthread when the thread was created. if a thread is created as a joinable thread, it continues to exist after returning from its root fun...
PRThreadType
hread, specified as a parameter to pr_createthread. syntax #include <prthread.h> typedef enum prthreadtype { pr_user_thread, pr_system_thread } prthreadtype; enumerators pr_user_thread pr_cleanup blocks until the last thread of type pr_user_thread terminates. pr_system_thread nspr ignores threads of type pr_system_thread when determining when a call to pr_cleanup should return.
description threads can be either user threads or system threads. nspr allows the client to synchronize the termination of all user threads and ignores those created as system threads. this arrangement implies that a system thread should not have volatile data that needs to be safely stored away. the applicability of system threads is somewhat dubious; therefore, they should be used with caution. ...
PRTime
a time after the epoch has a positive value, and a time before the epoch has a negative value. in nspr, we use the more familiar term greenwich mean time (gmt) in place of utc. although utc and gmt are not exactly the same in their precise definitions, they can generally be treated as if they were. ...
PRTimeParamFn
this type defines a callback function to calculate and return the time parameter offsets from a calendar time object in gmt. syntax #include <prtime.h> typedef prtimeparameters (pr_callback_decl *prtimeparamfn) (const prexplodedtime *gmt);
description the type prtimeparamfn represents a callback function that, when given a time instant in gmt, returns the time zone information (offset from gmt and dst offset) at that time instant. ...
PRTimeParameters
the prtimeparameters structure represents the local time zone information in terms of the offset (in seconds) from gmt. the overall offset is broken into two components: tp_gmt_offset the offset of the local standard time from gmt. ...
PRUint32
guaranteed to be an unsigned 32-bit integer on all platforms. syntax #include <prtypes.h> typedefdefinition pruint32;
description may be defined as an unsigned int or an unsigned long, depending on the platform. for syntax details for each platform, see prtypes.h. ...
PRUint64
for syntax details for each platform, see prtypes.h. ...
PR_APPEND_LINK
appends an element to the end of a list. syntax #include <prclist.h> pr_append_link ( prclist *elemp, prclist *listp); parameters elemp a pointer to the element to be inserted. listp a pointer to the list.
description pr_append_link adds the specified element to the end of the specified list. ...
PR_ASSERT
terminates execution when a given expression is false. syntax #include <prlog.h> void pr_assert ( expression ); parameters the macro has this parameter: expression any valid c language expression that evaluates to true or false. returns nothing
description this macro evaluates the specified expression. when the result is zero (false) the application terminates; otherwise the application continues. the macro converts the expression to a string and passes it to pr_assert, using file and line parameters from the compile-time environment. this macro compiles to nothing if compile-time options are not specified to enable logging. ...
PR_Abort
aborts the process in a nongraceful manner. syntax #include <prinit.h> void pr_abort(void);
description pr_abort results in a core file and a call to the debugger or equivalent, in addition to causing the entire process to stop. ...
PR_Accept
ecting entity. timeout a value of type printervaltime specifying the time limit for completion of the accept operation. returns the function returns one of the following values: upon successful acceptance of a connection, a pointer to a new prfiledesc structure representing the newly accepted connection. if unsuccessful, null. further information can be obtained by calling pr_geterror.
description the socket fd is a rendezvous socket that has been bound to an address with pr_bind and is listening for connections after a call to pr_listen. pr_accept accepts the first connection from the queue of pending connections and creates a new socket for the newly accepted connection. the rendezvous socket can still be used to accept more connections. if the addr parameter is not null, pr_accept sto...
PR_AcceptRead
peer. timeout the timeout interval only applies to the read portion of the operation. pr_acceptread blocks indefinitely until the connection is accepted; the read will time out after the timeout interval elapses. returns a positive number indicates the number of bytes read from the peer. the value -1 indicates a failure. the reason for the failure can be obtained by calling pr_geterror.
description pr_acceptread accepts a new connection and retrieves the newly created socket's descriptor and the connecting peer's address. also, as its name suggests, pr_acceptread receives the first block of data sent by the peer. ...
PR_Assert
normally an application would not call this function directly; use pr_assert instead. ...
PR_AtomicDecrement
atomically decrements a 32-bit value. syntax #include <pratom.h> print32 pr_atomicdecrement(print32 *val); parameter the function has the following parameter: val a pointer to the value to decrement. returns the function returns the decremented value (i.e., the result).
description pr_atomicdecrement first decrements the referenced variable by one. the value returned is the referenced variable's final value. the modification to memory is unconditional. ...
PR_AtomicIncrement
atomically increments a 32-bit value. syntax #include <pratom.h> print32 pr_atomicincrement(print32 *val); parameter the function has the following parameter: val a pointer to the value to increment. returns the function returns the incremented value (i.e., the result).
description the referenced variable is incremented by one. the result of the function is the value of the memory after the operation. the writing of the memory is unconditional. ...
PR_AtomicSet
atomically sets a 32-bit value and return its previous contents. syntax #include <pratom.h> print32 pr_atomicset( print32 *val, print32 newval); parameters the function has the following parameter: val a pointer to the value to be set. newval the new value to assign to the val parameter. returns the function returns the prior value of the referenced variable.
description pr_atomicset first reads the value of var, then updates it with the supplied value. the returned value is the value that was readbefore memory was updated. the memory modification is unconditional--that is, it isn't a test and set operation. ...
PR_AttachThread
specifies that the thread is either a user thread (pr_user_thread) or a system thread (pr_system_thread). priority the priority to assign to the thread being attached. stack the stack for the thread being attached. returns the function returns one of these values: if successful, a pointer to a prthread object. if unsuccessful, for example if system resources are not available, null.
description you use pr_attachthread when you want to use nss functions on the native thread that was not created with nspr. pr_attachthread informs nspr about the new thread by associating a prthread object with the native thread. the thread object is automatically destroyed when it is no longer needed. you don't need to call pr_attachthread unless you create your own native thread. pr_init calls pr_attac...
PR_Available
r to a prfiledesc object representing a file or socket. returns the function returns one of the following values: if the function completes successfully, it returns the number of bytes that are available for reading. for a normal file, these are the bytes beyond the current file pointer. if the function fails, it returns the value -1. the error code can then be retrieved via pr_geterror.
description pr_available works on normal files and sockets. pr_available does not work with pipes on win32 platforms. see also if the number of bytes available for reading is out of the range of a 32-bit integer, use pr_available64. ...
PR_Available64
r to a prfiledesc object representing a file or socket. returns the function returns one of the following values: if the function completes successfully, it returns the number of bytes that are available for reading. for a normal file, these are the bytes beyond the current file pointer. if the function fails, it returns the value -1. the error code can then be retrieved via pr_geterror.
description pr_available64 works on normal files and sockets. pr_available does not work with pipes on win32 platforms. see also if the number of bytes available for reading is within the range of a 32-bit integer, use pr_available. ...
PR_Bind
lowing parameters: fd a pointer to a prfiledesc object representing a socket. addr a pointer to a prnetaddr object representing the address to which the socket will be bound. returns the function returns one of the following values: upon successful binding of an address to a socket, pr_success. if unsuccessful, pr_failure. further information can be obtained by calling pr_geterror.
description when a new socket is created, it has no address bound to it. pr_bind assigns the specified address (also known as name) to the socket. if you do not care about the exact ip address assigned to the socket, set the inet.ip field of prnetaddr to pr_htonl(pr_inaddr_any). if you do not care about the tcp/udp port assigned to the socket, set the inet.port field of prnetaddr to 0. note that if pr_conn...
PR_CALLBACK
used to define pointers to functions that will be implemented by the client but called from a (different) shared library. syntax #include <prtypes.h>type pr_callbackimplementation
description functions that are implemented in an application (or shared library) that are intended to be called from another shared library (such as nspr) must be declared with the pr_callback attribute. normally such functions are passed by reference (pointer to function). the pr_callback attribute is included as part of the function's definition between its return value type and the function's name. ...
PR_Calloc
given size. syntax #include <prmem.h> void *pr_calloc ( pruint32 nelem, pruint32 elsize); parameters nelem the number of elements of size elsize to be allocated. elsize the size of an individual element. returns an untyped pointer to the allocated memory, or if the allocation attempt fails, null. call pr_geterror() to retrieve the error returned by the libc function malloc().
description this function allocates memory on the heap for the specified number of objects of the specified size. all bytes in the allocated memory are cleared. ...
PR_CEnterMonitor
is reference must remain valid as long as there are monitoring operations being performed. returns the function returns one of the following values: if successful, the function returns a pointer to the prmonitor associated with the value specified in the address parameter. if unsuccessful (the monitor cache needs to be expanded and the system is out of memory), the function returns null.
description pr_centermonitor uses the value specified in the address parameter to find a monitor in the monitor cache, then enters the lock associated with the monitor. if no match is found, an available monitor is associated with the address and the monitor's entry count is incremented (so it has a value of one). if a match is found, then either the calling thread is already in the monitor (and this is a r...
PR_CExitMonitor
ddress); parameters the function has the following parameters: address the address of the protected object--the same address previously passed to pr_centermonitor. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. this may indicate that the address parameter is invalid or that the calling thread is not in the monitor.
description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cexitmonitor decrements the entry count associated with the monitor. if the decremented entry count is zero, the monitor is exited. ...
PR_CLIST_IS_EMPTY
checks for an empty circular list. syntax #include <prclist.h> printn pr_clist_is_empty (prclist *listp); parameter listp a pointer to the linked list.
description pr_clist_is_empty returns a non-zero value if the specified list is an empty list, otherwise returns zero. ...
PR_CNotify
eter the function has the following parameter: address the address of the monitored object. the calling thread must be in the monitor defined by the value of the address. returns pr_success indicates that the calling thread is the holder of the mutex for the monitor referred to by the address parameter. pr_failure indicates that the monitor has not been entered by the calling thread.
description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cnotify notifies single a thread waiting for the monitor's state to change. if a thread is waiting on the monitor (having called pr_cwait), then that thread is made ready. as soon as the thread is scheduled, it attempts to reenter the monitor. ...
PR_CNotifyAll
on has the following parameter: address the address of the monitored object. the calling thread must be in the monitor at the time pr_cnotifyall is called. returns pr_success indicates that the referenced monitor was located and the calling thread was in the monitor. pr_failure indicates that the referenced monitor could not be located or that the calling thread was not in the monitor
description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cnotifyall notifies all threads waiting for the monitor's state to change. all of the threads waiting on the state change are then scheduled to reenter the monitor. ...
PR_CWait
. returns the function returns one of the following values: pr_success indicates either that the monitored object has been notified or that the interval specified in the timeout parameter has been exceeded. pr_failure indicates either that the monitor could not be located in the cache or that the monitor was located and the calling thread was not the thread that held the monitor's mutex.
description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cwait waits for a notification that the monitor's state has changed. while the thread is waiting, it exits the monitor (just as if it had called pr_cexitmonitor as many times as it had called pr_centermonitor). when the wait has finished, the thread regains control of the monitor's lock with the same en...
PR_Cleanup
pr_cleanup attempts to synchronize the natural termination of the process. ...
PR_ClearInterrupt
for example, the target thread may reach the agreed-on control point without providing an opportunity for the runtime to notify the thread of the interrupt request. in this case, the request for interrupt is still pending with the thread and must be explicitly canceled. ...
PR_Close
closes a file descriptor. syntax #include <prio.h> prstatus pr_close(prfiledesc *fd); parameters the function has the following parameters: fd a pointer to a prfiledesc object. returns one of the following values: if file descriptor is closed successfully, pr_success. if the file descriptor is not closed successfully, pr_failure.
description the file descriptor may represent a normal file, a socket, or an end point of a pipe. on successful return, pr_close frees the dynamic memory and other resources identified by the fd parameter. ...
PR_CloseDir
closes the specified directory. syntax #include <prio.h> prstatus pr_closedir(prdir *dir); parameter the function has the following parameter: dir a pointer to a prdir structure representing the directory to be closed. returns if successful, pr_success. if unsuccessful, pr_failure. the reason for the failure can be retrieved via pr_geterror.
description when a prdir object is no longer needed, it must be closed and freed with a call to pr_closedir call. note that after a pr_closedir call, any prdirentry object returned by a previous pr_readdir call on the same prdir object becomes invalid. see also pr_opendir ...
PR_CloseFileMap
tax #include <prio.h> prstatus pr_closefilemap(prfilemap *fmap); parameter the function has the following parameter: fmap the file mapping to be closed. returns the function returns one of the following values: if the memory region is successfully unmapped, pr_success. if the memory region is not successfully unmapped, pr_failure. the error code can be retrieved via pr_geterror.
description when a file mapping created with a call to pr_createfilemap is no longer needed, it should be closed with a call to pr_closefilemap. ...
PR_Connect
pointer to the address of the peer to which the socket is to be connected. timeout a value of type printervaltime specifying the time limit for completion of the connect operation. returns the function returns one of the following values: upon successful completion of connection setup, pr_success. if unsuccessful, pr_failure. further information can be obtained by calling pr_geterror.
description pr_connect is usually invoked on a tcp socket, but it may also be invoked on a udp socket. both cases are discussed here. if the socket is a tcp socket, pr_connect establishes a tcp connection to the peer. if the socket is not bound, it will be bound to an arbitrary local address. pr_connect blocks until either the connection is successfully established or an error occurs. the function uses th...
PR_ConnectContinue
. if pr_connectcontinue() returns pr_failure, call pr_geterror(): - pr_in_progress_error: the nonblocking connect is still in progress and has not completed yet. the caller should poll the file descriptor for the in_flags pr_poll_write|pr_poll_except and retry pr_connectcontinue later when pr_poll() returns. - other errors: the nonblocking connect has failed with this error code.
description continue a nonblocking connect. after a nonblocking connect is initiated with pr_connect() (which fails with pr_in_progress_error), one should call pr_poll() on the socket, with the in_flags pr_poll_write | pr_poll_except. when pr_poll() returns, one calls pr_connectcontinue() on the socket to determine whether the nonblocking connect has completed or is still in progress. repeat the pr_poll(), ...
PR_CreateFileMap
specified by fd. prot protection option for read and write accesses of a file mapping. this parameter consists of one of the following options: pr_prot_readonly. read-only access. pr_prot_readwrite. readable, and write is shared. pr_prot_writecopy. readable, and write is private (copy-on-write). returns if successful, a file mapping of type prfilemap. if unsuccessful, null.
description the prfilemapprotect enumeration used in the prot parameter is defined as follows: typedef enum prfilemapprotect { pr_prot_readonly, pr_prot_readwrite, pr_prot_writecopy } prfilemapprotect; pr_createfilemap only prepares for the mapping a file to memory. the returned file-mapping object must be passed to pr_memmap to actually map a section of the file to memory. the file-mapping object...
PR_CreateIOLayerStub
s a new layer. syntax #include <prio.h> prfiledesc* pr_createiolayerstub( prdescidentity ident priomethods const *methods); parameters the function has the following parameters: ident the identity to be associated with the new layer. methods a pointer to the priomethods structure specifying the functions for the new layer. returns a new file descriptor for the specified layer.
description a new layer may be allocated by calling pr_createiolayerstub. the file descriptor returned contains the pointer to the i/o methods table provided. the runtime neither modifies the table nor tests its correctness. the caller should override appropriate contents of the file descriptor returned before pushing it onto the protocol stack. ...
PR_CreatePipe
ntains the file descriptor for the read end of the pipe. writepipe a pointer to a prfiledesc pointer. on return, this parameter contains the file descriptor for the write end of the pipe. returns the function returns one of these values: if the pipe is successfully created, pr_success. if the pipe is not successfully created, pr_failure. the error code can be retrieved via pr_geterror.
description pr_createpipe creates an anonymous pipe. data written into the write end of the pipe can be read from the read end of the pipe. pipes are useful for interprocess communication between a parent and a child process. when the pipe is no longer needed, both ends should be closed with calls to pr_close. pr_createpipe is currently implemented on unix, linux, mac os x, and win32 only. ...
PR_CreateThread
ith the newly created thread. if you pass zero in this parameter, pr_createthread chooses the most favorable machine-specific stack size. returns the function returns one of the following values: if successful, a pointer to the new thread. this pointer remains valid until the thread returns from its root function. if unsuccessful, (for example, if system resources are unavailable), null.
description if you want the thread to start up waiting for the creator to do something, enter a lock before creating the thread and then have the thread's root function enter and exit the same lock. when you are ready for the thread to run, exit the lock. for more information on locks and thread synchronization, see introduction to nspr. if you want to detect the completion of the created thread, make it j...
PR_CreateThreadPool
ads, pruint32 stacksize ); parameters the function has the following parameters: initial_threads the number of threads to be created within this thread pool. max_threads the limit on the number of threads that will be created to server the thread pool. stacksize size of the stack allocated to each thread in the thread. returns pointer to a prthreadpool structure or null on error.
description ...
PR_DELETE
allocates memory of a specified size from the heap. syntax #include <prmem.h> void pr_delete(_ptr); parameter _ptr the address of memory to be returned to the heap. must be an lvalue (an expression that can appear on the left side of an assignment statement). returns nothing.
description this macro returns allocated memory to the heap from the specified location and sets _ptr to null. ...
PR_Delete
syntax #include <prio.h> prstatus pr_delete(const char *name); parameters the function has the following parameter: name the pathname of the file to be deleted. returns one of the following values: if file is deleted successfully, pr_success. if the file is not deleted, pr_failure.
description pr_delete deletes a file with the specified pathname name. if the function fails, the error code can then be retrieved via pr_geterror. ...
PR_DestroyCondVar
destroys a condition variable. syntax #include <prcvar.h> void pr_destroycondvar(prcondvar *cvar); parameter pr_destroycondvar has one parameter: cvar a pointer to the condition variable object to be destroyed.
description before calling pr_destroycondvar, the caller is responsible for ensuring that the condition variable is no longer in use. ...
PR_DestroyMonitor
destroys a monitor object. syntax #include <prmon.h> void pr_destroymonitor(prmonitor *mon); parameter the function has the following parameter: mon a reference to an existing structure of type prmonitor.
description the caller is responsible for guaranteeing that the monitor is no longer in use before calling pr_destroymonitor. there must be no thread (including the calling thread) in the monitor or waiting on the monitor. ...
PR_DetachThread
the thread object and all related data attached to it are destroyed. the exit process is invoked. the call returns after the nspr thread object is destroyed. this call is needed only if you attached the thread using pr_attachthread. ...
PR_EXTERN
for syntax details for each platform, see prtypes.h. ...
PR_EnterMonitor
attempts to acquire the lock for a monitor that is held by some other thread will result in the caller blocking. the operation is neither timed nor interruptible. ...
PR EnumerateAddrInfo
of the prnetaddr structure. this parameter is not checked for validity. result on input, a pointer to a prnetaddr structure. on output, this structure is filled in by the runtime if the result of the call is not null. returns the function returns the value you should specify in the enumptr parameter for the next call of the enumerator. if the function returns null, the enumeration is ended.
description pr_enumerateaddrinfo is a stateless enumerator. the principle input, the praddrinfo structure, is not modified. ...
PR_EnumerateHostEnt
he result of the call is greater than 0. returns the function returns one of the following values: if successful, the function returns the value you should specify in the enumindex parameter for the next call of the enumerator. if the function returns 0, the enumeration is ended. if unsuccessful, the function returns -1. you can retrieve the reason for the failure by calling pr_geterror.
description pr_enumeratehostent is a stateless enumerator. the principle input, the prhostent structure, is not modified. ...
PR_ExitMonitor
itor *mon); parameter the function has the following parameter: mon a reference to an existing structure of type prmonitor. the monitor object referenced must be one for which the calling thread currently holds the lock. returns the function returns one of the following values: if successful, pr_success. if unsuccessful (the calling thread has not entered the monitor), pr_failure.
description if the decremented entry count is zero, pr_exitmonitor releases the monitor's lock. threads that were blocked trying to enter the monitor will be rescheduled. ...
PR_ExplodeTime
amfn params, prexplodedtime *exploded); parameters the function has these parameters: usecs an absolute time in the prtime format. params a time parameter callback function. exploded a pointer to a location where the converted time can be stored. this location must be preallocated by the caller. returns nothing; the buffer pointed to by exploded is filled with the exploded time.
description this function converts the specified absolute time to a clock/calendar time in the specified time zone. upon return, the location pointed to by the exploded parameter contains the converted time value. ...
PR_ExportFileMapAsString
p. syntax #include <prshma.h> nspr_api( prstatus ) pr_exportfilemapasstring( prfilemap *fm, prsize bufsize, char *buf ); define pr_filemap_string_bufsize 128 parameters the function has the following parameters: fm a pointer to the prfilemap to be represented as a string. bufsize sizeof(buf) buf a pointer to abuffer of length pr_filemap_string_bufsize. returns prstatus
description creates an identifier, as a string, from a prfilemap object previously created with pr_openanonfilemap. ...
PR_FREEIF
conditionally frees allocated memory. syntax #include <prmem.h> void pr_freeif(_ptr); parameter _ptr the address of memory to be returned to the heap. returns nothing.
description this macro returns memory to the heap when _ptr is not null. if _ptr is null, the macro has no effect. ...
PR_FindSymbol
identity of the library and a textual representation of the symbol in question. syntax #include <prlink.h> void* pr_findsymbol ( prlibrary *lib, const char *name); parameters the function has these parameters: lib a valid reference to a loaded library, as returned by pr_loadlibrary, or null. name a textual representation of the symbol to resolve. returns an untyped pointer.
description this function finds and returns an untyped reference to the specified symbol in the specified library. if the lib parameter is null, all libraries known to the runtime and the main program are searched in an unspecified order. use this function to look up functions or data symbols in a shared library. getting a pointer to a symbol in a library does indicate that the library is available when th...
PR_FindSymbolAndLibrary
e symbol to locate. lib a reference to a location at which the runtime will store the library in which the symbol was discovered. this location must be pre-allocated by the caller. returns if successful, returns a non-null pointer to the found symbol, and stores a pointer to the library in which it was found at the location pointed to by lib. if the symbol could not be found, returns null.
description this function finds the specified symbol in one of the currently loaded libraries. it returns the address of the symbol. upon return, the location pointed to by the parameter lib contains a pointer to the library that contains that symbol. the location must be pre-allocated by the caller. the function returns null if no such function can be found. the order in which the known libraries are sear...
PR_Free
frees allocated memory in the heap. syntax #include <prmem.h> void pr_free(void *ptr); parameter ptr a pointer to the memory to be freed. returns nothing.
description this function frees the memory addressed by ptr in the heap. ...
PR_FreeLibraryName
frees memory allocated by nspr for library names and path names. syntax #include <prlink.h> void pr_freelibraryname(char *mem); parameters the function has this parameter: mem a reference to a character array that was previously allocated by the dynamic library runtime. returns nothing.
description this function deletes the storage allocated by the runtime in the functions described previously. it is important to use this function to rather than calling directly into malloc in order to isolate the runtime's semantics regarding storage management. ...
PR_GMTParameters
y use is as "filler" for cases in which you need a do-nothing callback. syntax #include <prtime.h> prtimeparameters pr_gmtparameters ( const prexplodedtime *gmt); parameter gmt a pointer to the clock/calendar time whose offsets are to be determined. this time should be specified in gmt. returns a time parameters structure that expresses the time zone offsets at the specified time.
description this is a frequently-used time parameter callback function. you don't normally call it directly; instead, you pass it as a parameter to pr_explodetime() or pr_normalizetime(). this is a trivial function; for any input, it returns a prtimeparameters structure with both fields set to zero. ...
PR_GetConnectStatus
ld must contain pr_poll_write and pr_poll_except. returns the function returns one of these values: if successful, pr_success. if unsuccessful, pr_failure. the reason for the failure can be retrieved via pr_geterror. if pr_geterror returns pr_in_progress_error, the nonblocking connection is still in progress and has not completed yet.other errors indicate that the connection has failed.
description after pr_connect on a nonblocking socket fails with pr_in_progress_error, you may wait for the connection to complete by calling pr_poll on the socket with the in_flags pr_poll_write | pr_poll_except. when pr_poll returns, call pr_getconnectstatus on the socket to determine whether the nonblocking connect has succeeded or failed. ...
PR_GetCurrentThread
returns the current thread object for the currently running code. syntax #include <prthread.h> prthread* pr_getcurrentthread(void); returns always returns a valid reference to the calling thread--a self-identity.
description the currently running thread may discover its own identity by calling pr_getcurrentthread. note: this is the only safe way to establish the identity of a thread. creation and enumeration are both subject to race conditions. ...
PR_GetDefaultIOMethods
gets the default i/o methods table. syntax #include <prio.h> const priomethods* pr_getdefaultiomethods(void); returns if successful, the function returns a pointer to a priomethods structure.
description after using pr_getdefaultiomethods to identify the default i/o methods table, you can select elements from that table with which to build your own layer's methods table. you may not modify the default i/o methods table directly. you can pass your own layer's methods table to pr_createiolayerstub to create your new layer. ...
PR_GetDescType
describes what type of file is referenced by a specified file descriptor. syntax #include <prio.h> prdesctype pr_getdesctype(prfiledesc *file); parameter the function has the following parameter: file a pointer to a prfiledesc object whose descriptor type is to be returned. returns the function returns a prdesctype enumeration constant that describes the type of file.
description the prdesctype enumeration is defined as follows: typedef enum prdesctype { pr_desc_file = 1, pr_desc_socket_tcp = 2, pr_desc_socket_udp = 3, pr_desc_layered = 4 } prdesctype; the enumeration has the following enumerators: pr_desc_file the prfiledesc object represents a normal file. pr_desc_socket_tcp the prfiledesc object represents a tcp socket. pr_desc_socket_udp the prfiledesc ...
PR_GetFileInfo
ters: fn the pathname of the file to get information about. info a pointer to a file information object (see prfileinfo). on output, pr_getfileinfo writes information about the given file to the file information object. returns one of the following values: if the file information is successfully obtained, pr_success. if the file information is not successfully obtained, pr_failure.
description pr_getfileinfo stores information about the file with the specified pathname in the prfileinfo structure pointed to by info. the file size is returned as an unsigned 32-bit integer. see also for the 64-bit version of this function, see pr_getfileinfo64. to get equivalent information on a file that's already open, use pr_getopenfileinfo. ...
PR_GetFileInfo64
the pathname of the file to get information about. info a pointer to a 64-bit file information object (see prfileinfo64). on output, pr_getfileinfo64 writes information about the given file to the file information object. returns one of the following values: if the file information is successfully obtained, pr_success. if the file information is not successfully obtained, pr_failure.
description pr_getfileinfo64 stores information about the file with the specified pathname in the prfileinfo64 structure pointed to by info. the file size is returned as an unsigned 64-bit integer. see also for the 32-bit version of this function, see pr_getfileinfo. to get equivalent information on a file that's already open, use pr_getopenfileinfo64. ...
PR_GetHostByAddr
parameter. the buffer must be at least pr_netdb_buf_size bytes. hostentry this structure is allocated by the caller. on output, this structure is filled in by the runtime if the function returns pr_success. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. you can retrieve the reason for the failure by calling pr_geterror.
description pr_gethostbyaddr is used to perform reverse lookups of network addresses. that is, given a valid network address (of type prnetaddr), pr_gethostbyaddr discovers the address' primary name, any aliases, and any other network addresses for the same host. ...
PR_GetIdentitiesLayer
ntity id); parameters the function has the following parameters: stack a pointer to a prfiledesc object that is a layer in a stack of layers. id the identity of the specified layer. returns the function returns one of the following values: if successful, a pointer to a file descriptor of the layer with the specified identity in the given stack of layers. if not successful, null.
description the stack of layers to be searched is specified by the fd parameter, which is a layer in the stack. both the layers underneath fd and the layers above fd are searched to find the layer with the specified identity. ...
PR_GetInheritedFileMap
imports a prfilemap previously exported by my parent process via pr_createprocess. syntax #include <prshma.h> nspr_api( prfilemap *) pr_getinheritedfilemap( const char *shmname ); parameter the function has the following parameter: shmname the name provided to pr_processattrsetinheritablefilemap. returns pointer to prfilemap or null on error.
description pr_getinheritedfilemap retrieves a prfilemap object exported from its parent process via pr_createprocess. note: this function is not implemented. ...
PR_GetLibraryName
char* pr_getlibraryname ( const char *dir, const char *lib); parameters the function has these parameters: dir a null-terminated string representing the path name of the library, as returned by pr_getlibrarypath. lib the leaf name of the library of interest. returns if successful, returns a new character string containing a constructed path name. in case of error, returns null.
description this function constructs a full path name from the specified directory name and library name. the constructed path name refers to the actual dynamically loaded library. it is suitable for use in the pr_loadlibrary call. this function does not test for existence of the specified file, it just constructs the full filename. the way the name is constructed is system dependent. if sufficient storag...
PR_GetLibraryPath
retrieves the current default library path. syntax #include <prlink.h> char* pr_getlibrarypath(void); parameters the function has no parameters. returns a copy of the default library pathname string. in case of error, returns null.
description this function retrieves the current default library pathname, copies it, and returns the copy. if sufficient storage cannot be allocated to contain the copy, the function returns null. storage for the result is allocated by the runtime and becomes the responsibility of the caller. when it is no longer used, free it using pr_freelibraryname. ...
PR_GetNameForIdentity
er's unique identity. syntax #include <prio.h> const char* pr_getnameforidentity(prdescidentity ident); parameter the function has the following parameter: ident a layer's identity. returns the function returns one of the following values: if successful, the function returns a pointer to the string associated with the specified layer. if unsuccessful, the function returns null.
description a string may be associated with a layer when the layer is created. the string is copied by the runtime, and pr_getnameforidentity returns a pointer to that copy. ...
PR_GetOSError
returns the current thread's last set os-specific error code. syntax #include <prerror.h> print32 pr_getoserror(void) returns the value returned is a 32-bit signed number. its interpretation is left to the caller.
description used for platform-specific code that requires the underlying os error. for portability, clients should not create dependencies on the values of os-specific error codes. however, this information is preserved, along with a platform neutral error code, on a per thread basis. it is most useful during development. ...
PR_GetOpenFileInfo
he following parameters: fd a pointer to a prfiledesc object for an open file. info a pointer to a prfileinfo object. on output, information about the given file is written into the file information object. returns the function returns one of the following values: if file information is successfully obtained, pr_success. if file information is not successfully obtained, pr_failure.
description pr_getopenfileinfo obtains the file type (normal file, directory, or other), file size (as a 32-bit integer), and the file creation and modification times of the open file represented by the file descriptor. see also for the 64-bit version of this function, see pr_getopenfileinfo64. to get equivalent information on a file that's not already open, use pr_getfileinfo. ...
PR_GetOpenFileInfo64
following parameters: fd a pointer to a prfiledesc object for an open file. info a pointer to a prfileinfo64 object. on output, information about the given file is written into the file information object. returns the function returns one of the following values: if file information is successfully obtained, pr_success. if file information is not successfully obtained, pr_failure.
description pr_getopenfileinfo64 is the 64-bit version of pr_getopenfileinfo. it obtains the file type (normal file, directory, or other), file size (as a 64-bit integer), and the creation and modification times of the open file represented by the file descriptor. see also for the 32-bit version of this function, see pr_getopenfileinfo. to get equivalent information on a file that's not already open, use ...
PR_GetRandomNoise
large as specified in size. size the size, in bytes, of the requested random number. returns prsize value equal to the size of the random number actually generated, or zero. the generated size may be less than the size requested. a return value of zero means that pr_getrandomnoise is not implemented on this platform, or there is no available noise to be returned at the time of the call.
description pr_getrandomnoise provides a random value, depending on platform. the length of the random value is dependent on the platform and its ability to provide a random value at that moment. pr_getrandomnoise is intended to provide a "seed" value for a another random number generator that may be suitable for cryptographic operations. this implies that the random value provided may not be, by itself, c...
PR_GetSpecialFD
wing parameter: id a pointer to an enumerator of type prspecialfd, indicating the type of i/o stream desired: pr_standardinput, pr_standardoutput, or pr_standarderror. returns if the id parameter is valid, pr_getspecialfd returns a file descriptor that represents the corresponding standard i/o stream. otherwise, pr_getspecialfd returns null and sets the error to pr_invalid_argument_error. ...
PR_GetThreadPrivate
recovers the per-thread private data for the current thread. syntax #include <prthread.h> void* pr_getthreadprivate(pruintn index); parameter pr_getthreadprivate has the following parameters: index the index into the per-thread private data table. returns null if the data has not been set.
description pr_getthreadprivate may be called at any time during a thread's execution. a thread can get access only to its own per-thread private data. do not delete the object that the private data refers to without first clearing the thread's value. ...
PR_GetUniqueIdentity
me the string associated with the creation of a layer's identity. returns the function returns one of the following values: if successful, the prdescidentity for the layer associated with the string specified in the layer named layer_name. if the function cannot allocate enough dynamic memory, it fails and returns the value pr_invalid_io_layer with the error code pr_out_of_memory_error.
description a string may be associated with a layer when the layer is created. pr_getuniqueidentity allocates a unique layer identity and associates it with the string. the string can be subsequently passed to pr_createiolayerstub to create a new file descriptor of that layer. call pr_getuniqueidentity only once for any particular layer name. if you're creating a custom i/o layer, cache the result, and the...
PR_IMPLEMENT
used to define implementations of symbols that are to be exported from a shared library. syntax #include <prtypes.h> pr_implement(type)implementation
description pr_implement is used to define implementations of externally visible routines and globals. for syntax details for each platform, see prtypes.h. warning: some platforms do not allow the use of the underscore character (_) as the first character of an exported symbol. ...
PR INIT CLIST
initializes a circular list. syntax #include <prclist.h> pr_init_clist (prclist *listp); parameter listp a pointer to the anchor of the linked list.
description initializes the specified list to be an empty list. ...
PR_INIT_STATIC_CLIST
statically initializes a circular list. syntax #include <prclist.h> pr_init_static_clist (prclist *listp); parameter listp a pointer to the anchor of the linked list.
description pr_init_static_clist statically initializes the specified list to be an empty list. for example, prclist free_object_list = pr_init_static_clist(&free_object_list); ...
PR_INSERT_AFTER
inserts an element after another element in a circular list. syntax #include <prclist.h> pr_insert_after ( prclist *elemp1 prclist *elemp2); parameters elemp1 a pointer to the element to be inserted. elemp2 a pointer to the element after which elemp1 is to be inserted.
description pr_insert_after inserts the element specified by elemp1 into the circular list, after the element specified by elemp2. ...
PR_INSERT_BEFORE
inserts an element before another element in a circular list. syntax #include <prclist.h> pr_insert_before ( prclist *elemp1 prclist *elemp2); parameters elemp1 a pointer to the element to be inserted. elemp2 a pointer to the element before which elemp1 is to be inserted.
description pr_insert_before inserts the element specified by elemp1 into the circular list, before the element specified by elemp2. ...
PR_INSERT_LINK
inserts an element at the head of the list. syntax #include <prclist.h> pr_insert_link ( prclist *elemp, prclist *listp); parameters elemp a pointer to the element to be inserted. listp a pointer to the list.
description pr_insert_link inserts the specified element at the head of the specified list. ...
PR_ImplodeTime
converts a clock/calendar time to an absolute time. syntax #include <prtime.h> prtime pr_implodetime(const prexplodedtime *exploded); parameters the function has these parameters: exploded a pointer to the clock/calendar time to be converted. returns an absolute time value.
description this function converts the specified clock/calendar time to an absolute time and returns the converted time value. ...
PR_ImportFileMapFromString
creates a prfilemap from an identifying string. syntax #include <prshma.h> nspr_api( prfilemap * ) pr_importfilemapfromstring( const char *fmstring ); parameter the function has the following parameter: fmstring a pointer to string created by pr_exportfilemapasstring. returns prfilemap pointer or null on error.
description pr_importfilemapfromstring creates a prfilemap object from a string previously created by pr_exportfilemapasstring. ...
PR ImportTCPSocket
nction has the following parameters: osfd the native file descriptor for the tcp socket to import. on posix systems, this is an int. on windows, this is a socket. returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly imported native tcp socket. if the import of the native tcp socket failed, null.
description a native tcp socket osfd can be imported into nspr with pr_importtcpsocket. the caller gives up control of the native tcp socket osfd and should use the prfiledesc* returned by pr_importtcpsocket instead. although pr_importtcpsocket is a supported function, it is declared in "private/pprio.h" to stress the fact that this function depends on the internals of the nspr implementation. the caller n...
PR_Init
initializes the runtime. syntax #include <prinit.h> void pr_init( prthreadtype type, prthreadpriority priority, pruintn maxptds); parameters pr_init has the following parameters: type this parameter is ignored. priority this parameter is ignored. maxptds this parameter is ignored.
description nspr is now implicitly initialized, usually by the first nspr function called by a program. pr_init is necessary only if a program has specific initialization-sequencing requirements. call pr_init as follows: pr_init(pr_user_thread, pr_priority_normal, 0); ...
PR_Initialize
in from the host's program-launching facility or fabricated by the actual main program. this approach conforms to standard c programming practice. argv the base address of an array of strings that compromise the program's argument vector. this approach conforms to standard c programming practice. maxptds this parameter is ignored. returns the value returned from the root function, prmain.
description pr_initialize initializes the nspr runtime and places nspr between the caller and the runtime library. this allows main to be treated like any other function, signaling its completion by returning and allowing the runtime to coordinate the completion of the other threads of the runtime. pr_initialize does not return to its caller until all user threads have terminated. the priority of the main...
PR_InitializeNetAddr
. the value is specified in host byte order. addr a pointer to the prnetaddr structure to be manipulated. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. this may occur, for example, if the value of val is not within the ranges defined by prnetaddrvalue. you can retrieve the reason for the failure by calling pr_geterror.
description pr_initializenetaddr allows the assignment of special network address values and the port number, while also setting the state that indicates the version of the address being used. the special network address values are identified by the enum prnetaddrvalue: typedef enum prnetaddrvalue{ pr_ipaddrnull, pr_ipaddrany, pr_ipaddrloopback } prnetaddrvalue; the enum has the following enumerat...
PR_Interrupt
sets the interrupt request for a target thread. syntax #include <prthread.h> prstatus pr_interrupt(prthread *thread); parameter pr_interrupt has the following parameter: thread the thread whose interrupt request you want to set. returns the function returns one of the following values: if the specified thread is currently blocked, pr_success. otherwise, pr_failure.
description the purpose of pr_interrupt is to request that a thread performing some task stop what it is doing and return to some control point. it is assumed that a control point has been mutually arranged between the thread doing the interrupting and the thread being interrupted. when the interrupted thread reaches the prearranged point, it can communicate with its peer to discover the real reason behind the change i...
PR_IntervalNow
pr_intervalnow() is both very efficient and nonblocking, so it is appropriate to use (for example) while holding a mutex. the most common use for pr_intervalnow() is to establish an epoch and test for the expiration of intervals. ...
PR_IntervalToMicroseconds
converts platform-dependent intervals to standard clock microseconds. syntax #include <prinrval.h> pruint32 pr_intervaltomicroseconds(printervaltime ticks); parameter ticks the number of platform-dependent intervals to convert. returns equivalent in microseconds of the value passed in the ticks parameter.
description conversion may cause overflow, which is not reported. ...
PR_IntervalToMilliseconds
converts platform-dependent intervals to standard clock milliseconds. syntax #include <prinrval.h> pruint32 pr_intervaltomilliseconds(printervaltime ticks); parameter ticks the number of platform-dependent intervals to convert. returns equivalent in milliseconds of the value passed in the ticks parameter.
description conversion may cause overflow, which is not reported. ...
PR_IntervalToSeconds
converts platform-dependent intervals to standard clock seconds. syntax #include <prinrval.h> pruint32 pr_intervaltoseconds(printervaltime ticks); parameter ticks the number of platform-dependent intervals to convert. returns equivalent in seconds of the value passed in the ticks parameter.
description conversion may cause overflow, which is not reported. ...
PR_JoinThread
prthread *thread); parameter pr_jointhread has the following parameter: thread a valid identifier for the thread that is to be joined. returns the function returns one of the following values: if successful, pr_success if unsuccessful--for example, if no joinable thread can be found that corresponds to the specified target thread, or if the target thread is unjoinable--pr_failure.
description pr_jointhread is used to synchronize the termination of a thread. the function is synchronous in that it blocks the calling thread until the target thread is in a joinable state. pr_jointhread returns to the caller only after the target thread returns from its root function. pr_jointhread must not be called until after pr_createthread has returned. if pr_jointhread is not called on the same th...
PR_LIST_HEAD
returns the head of a circular list. syntax #include <prclist.h> prclist *pr_list_head (prclist *listp); parameter listp a pointer to the linked list. returns a pointer to a list element.
description pr_list_head returns the head of the specified circular list. ...
PR_LIST_TAIL
returns the tail of a circular list. syntax #include <prclist.h> prclist *pr_list_tail (prclist *listp); parameter listp a pointer to the linked list. returns a pointer to a list element.
description pr_list_tail returns the tail of the specified circular list. ...
PR_LOG
_level a level value. possible values are: pr_log_none = 0 pr_log_always = 1 pr_log_error = 2 pr_log_warning = 3 pr_log_debug = 4 pr_log_notice = pr_log_debug pr_log_warn = pr_log_warning pr_log_min = pr_log_debug pr_log_max = pr_log_debug _args a variable length argument list, as if to printf. returns nothing
description this macro formats the specified arguments and writes the output to the log file, if logging is enabled for the specified module and level. for a
description of formatting and format strings, see "formatted printing". for an example of using conditional logging, see use example. this macro compiles to nothing if compile-time options are not specified to enable logging. ...
PR_LOG_TEST
_level a level value. possible values are: pr_log_none = 0 pr_log_always = 1 pr_log_error = 2 pr_log_warning = 3 pr_log_debug = 4 pr_log_notice = pr_log_debug pr_log_warn = pr_log_warning pr_log_min = pr_log_debug pr_log_max = pr_log_debug returns pr_true when logging is enabled for the given module and level, otherwise pr_false.
description this macro tests whether logging is enabled for the specified module and level. use it as an expression in a conditional execution statement to control logging. see also pr_log. ...
PR_Listen
ameters: fd a pointer to a prfiledesc object representing a socket that will be used to listen for new connections. backlog the maximum length of the queue of pending connections. returns the function returns one of the following values: upon successful completion of listen request, pr_success. if unsuccessful, pr_failure. further information can be obtained by calling pr_geterror.
description pr_listen turns the specified socket into a rendezvous socket. it creates a queue for pending connections and starts to listen for connection requests on the socket. the maximum size of the queue for pending connections is specified by the backlog parameter. pending connections may be accepted by calling pr_accept. ...
PR_LoadLibrary
#include <prlink.h> prlibrary* pr_loadlibrary(const char *name); parameters the function has this parameter: name a platform-dependent character array that names the library to be loaded, as returned by pr_getlibraryname. returns if successful, returns a reference to an opaque prlibrary object. if the operation fails, returns null. use pr_geterror to find the reason for the failure.
description this function loads and returns a reference to the specified library. the returned reference becomes the library's identity. the function suppresses duplicate loading if the library is already known by the runtime. each call to pr_loadlibrary must be paired with a corresponding call to pr_unloadlibrary in order to return the runtime to its original state. ...
PR_LocalTimeParameters
information that maps the specified prexplodedtime to local time. syntax #include <prtime.h> prtimeparameters pr_localtimeparameters ( const prexplodedtime *gmt); parameter gmt a pointer to the clock/calendar time whose offsets are to be determined. this time should be specified in gmt. returns a time parameters structure that expresses the time zone offsets at the specified time.
description this is a frequently-used time parameter callback function. you don't normally call it directly; instead, you pass it as a parameter to pr_explodetime() or pr_normalizetime(). ...
PR_Lock
locks a specified lock object. syntax #include <prlock.h> void pr_lock(prlock *lock); parameter pr_lock has one parameter: lock a pointer to a lock object to be locked.
description when pr_lock returns, the calling thread is "in the monitor," also called "holding the monitor's lock." any thread that attempts to acquire the same lock blocks until the holder of the lock exits the monitor. acquiring the lock is not an interruptible operation, nor is there any timeout mechanism. pr_lock is not reentrant. calling it twice on the same thread results in undefined behavior. see also pr_unlock ...
PR_LogFlush
flushes the log buffer to external media. syntax #include <prlog.h> void pr_logflush(void); parameters the function has no parameters. returns nothing
description this function flushes the log buffer to external media. ...
PR_LogPrint
writes an entry to the log. syntax #include <prlog.h> void pr_logprint(const char *fmt, ...); parameters the function has this parameter: fmt the string that is used as the formatting specification. returns nothing
description this function unconditionally writes a message to the log using the specified format string. for a
description of formatting and format strings, see "formatted printing". ...
PR_MALLOC
allocates memory of a specified size from the heap. syntax #include <prmem.h> void * pr_malloc(_bytes); parameter _bytes size of the requested memory block. returns an untyped pointer to the allocated memory, or if the allocation attempt fails, null. call pr_geterror() to retrieve the error returned by the libc function malloc().
description this macro allocates memory of the requested size from the heap. ...
PR_MemMap
has the following parameters: fmap a pointer to the file-mapping object representing the file to be memory-mapped. offset the starting offset of the section of file to be mapped. the offset must be aligned to whole pages. len length of the section of the file to be mapped. returns the starting address of the memory region to which the section of file is mapped. returns null on error.
description pr_memmap maps a section of the file represented by the file mapping fmap to memory. the section of the file starts at offset and has the length len. when the file-mapping memory region is no longer needed, it should be unmapped with a call to pr_memunmap. ...
PR_MkDir
he future. possible values include the following: 00400. read by owner. 00200. write by owner. 00100. search by owner. 00040. read by group. 00020. write by group. 00010. search by group. 00004. read by others. 00002. write by others. 00001. search by others. returns if successful, pr_success. if unsuccessful, pr_failure. the actual reason can be retrieved via pr_geterror.
description pr_mkdir creates a new directory with the pathname name. all the path components up to but not including the leaf component must already exist. for example, if the pathname of the directory to be created is a/b/c/d, the directory a/b/c must already exist. see also pr_rmdir ...
PR_NEW
allocates memory of a specified size from the heap. syntax #include <prmem.h> _type * pr_new(_struct); parameter _struct the name of a type. returns an pointer to a buffer sized to contain the type _struct, or if the allocation attempt fails, null. call pr_geterror() to retrieve the error returned by the libc function.
description this macro allocates memory whose size is sizeof(_struct) and returns a pointer to that memory. ...
PR_NEWZAP
and clears memory from the heap for an instance of a given type. syntax #include <prmem.h> _type * pr_newzap(_struct); parameter _struct the name of a type. returns an pointer to a buffer sized to contain the type _struct, or if the allocation attempt fails, null. the bytes in the buffer are all initialized to 0. call pr_geterror() to retrieve the error returned by the libc function.
description this macro allocates an instance of the specified type from the heap and sets the content of that memory to zero. ...
PR_NEXT_LINK
returns the next element in a list. syntax #include <prclist.h> prclist *pr_next_link (prclist *elemp); parameter elemp a pointer to the element. returns a pointer to a list element.
description pr_next_link returns a pointer to the element following the specified element. it can be used to traverse a list. the following element is not removed from the list. ...
PR_NOT_REACHED
terminates the calling application with a message to the log. syntax #include <prlog.h> void pr_not_reached(const char *_reasonstr); parameters the macro has this parameter: reasonstr a string that describes why you should not have reached this statement. returns nothing
description this macro writes the specified reason string to the log and terminates the application. this macro compiles to nothing if compile-time options are not specified to enable logging. ...
PR_NetAddrToString
unction has the following parameters: addr a pointer to the network address to be converted. string a buffer that will hold the converted string on output. size the size of the result buffer (string). returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. you can retrieve the reason for the failure by calling pr_geterror.
description the network address to be converted (addr) may be either an ipv4 or ipv6 address structure, assuming that the nspr library and the host system are both configured to utilize ipv6 addressing. if addr is an ipv4 address, size needs to be at least 16. if addr is an ipv6 address, size needs to be at least 46. ...
PR_NewLock
creates a new lock. syntax #include <prlock.h> prlock* pr_newlock(void); returns the function returns one of the following values: if successful, a pointer to the new lock object. if unsuccessful (for example, the lock cannot be created because of resource constraints), null.
description pr_newlock creates a new opaque lock. ...
PR_NewLogModule
creates a new log module. syntax #include <prlog.h> prlogmoduleinfo* pr_newlogmodule(const char *name); parameters the function has this parameter: name the name to be assigned to the prlogmoduleinfo structure. returns a pointer to a prlogmoduleinfo structure.
description this function allocates and initializes a new prlogmoduleinfo structure with the specified name. if the environment variable nspr_log_modules contains the specified name, then the associated level value from the variable is associated with the new prlogmoduleinfo structure. ...
PR_NewMonitor
creates a new monitor object. the caller is responsible for the object and is expected to destroy it when appropriate. syntax #include <prmon.h> prmonitor* pr_newmonitor(void); returns the function returns one of the following values: if successful, a pointer to a prmonitor object. if unsuccessful (for example, if some operating system resource is unavailable), null.
description a newly created monitor has an entry count of zero. ...
PR NewProcessAttr
creates a process attributes structure. syntax #include <prlink.h> prprocessattr *pr_newprocessattr(void); parameters the function has no parameters. returns a pointer to the new process attributes structure.
description this function creates a new prprocessattr structure that specifies the attributes of a new process, then returns a pointer to the structure. the new prprocessattr structure is initialized with these default attributes: the standard i/o streams (standard input, standard output, and standard error) are not redirected. no file descriptors are inherited by the new process. ...
PR_NewTCPSocket
creates a new ipv4 tcp socket. syntax #include <prio.h> prfiledesc* pr_newtcpsocket(void); returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened ipv4 tcp socket. if the creation of a new tcp socket failed, null.
description tcp (transmission control protocol) is a connection-oriented, reliable byte-stream protocol of the tcp/ip protocol suite. pr_newtcpsocket creates a new ipv4 tcp socket. a tcp connection is established by a passive socket (the server) accepting a connection setup request from an active socket (the client). typically, the server binds its socket to a well-known port with pr_bind, calls pr_listen to start listening for connection setup requests, and calls pr_accept to accept ...
PR_NewThreadPrivateIndex
all threads in the process. you use this index with pr_setthreadprivate and pr_getthreadprivate. destructor specifies a destructor function prthreadprivatedtor for the private data associated with the index. this function can be specified as null. returns the function returns one of the following values: if successful, pr_success. if the total number of indices exceeds 128, pr_failure.
description if pr_newthreadprivateindex is successful, every thread in the same process is capable of associating private data with the new index. until the data for an index is actually set, the value of the private data at that index is null. you pass this index to pr_setthreadprivate and pr_getthreadprivate to set and retrieve data associated with the index. when you allocate the index, you may also reg...
PR_NewUDPSocket
creates a new udp socket. syntax #include <prio.h> prfiledesc* pr_newudpsocket(void); returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened udp socket. if the creation of a new udp socket failed, null.
description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. udp datagrams may be lost or delivered in duplicates or out of sequence. pr_newudpsocket creates a new udp socket. the socket may be bound to a well-known port number with pr_bind. datagrams can be sent with pr_sendto and received with pr_recvfrom. when the socket is no longer needed, it should be closed with a call to pr_close. see also pr_newudpsocket is deprecated becau...
PR_NormalizeTime
to their proper ranges, using a callback function. syntax #include <prtime.h> void pr_normalizetime ( prexplodedtime *time, prtimeparamfn params); parameters the function has these parameters: time a pointer to a clock/calendar time in the prexplodedtime format. params a time parameter callback function. returns nothing; the time parameter is altered by the callback function.
description this function adjusts the fields of the specified time structure using the specified time parameter callback function, so that they are in the proper range. call this function in these situations: to normalize a time after performing arithmetic operations directly on the field values of the calendar time object. for example, if you have a ] object that represents the date 3 march 1998 and yo...
PR_Notify
ax #include <prmon.h> prstatus pr_notify(prmonitor *mon); parameters the function has the following parameter: mon a reference to an existing structure of type prmonitor. the monitor object referenced must be one for which the calling thread currently holds the lock. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure.
description notification of a monitor signals the change of state of some monitored data. the changing of that data and the notification must all be performed while in the monitor. when the notification occurs, the runtime promotes a thread that is waiting on the monitor to a ready state. if more than one thread is waiting, the selection of which thread gets promoted cannot be determined in advance. this im...
PR_NotifyAll
#include <prmon.h> prstatus pr_notifyall(prmonitor *mon); parameters the function has the following parameter: mon a reference to an existing structure of type prmonitor. the monitor object referenced must be one for which the calling thread currently holds the lock. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure.
description a call to pr_notifyall causes all of the threads waiting on the monitor to be scheduled to be promoted to a ready state. if no threads are waiting, the operation is no-op. pr_notifyall should be used with some care. the expense of scheduling multiple threads increases dramatically as the number of threads increases. ...
PR_NotifyAllCondVar
notifies all of the threads waiting on a specified condition variable. syntax #include <prcvar.h> prstatus pr_notifyallcondvar(prcondvar *cvar); returns the function returns one of the following values: if successful, pr_success. if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable), pr_failure.
description the calling thread must hold the lock that protects the condition, as well as the invariants that are tightly bound to the condition. a call to pr_notifyallcondvar causes all of the threads waiting on the specified condition variable to be promoted to a ready state. if no threads are waiting, the operation is no-op. ...
PR_NotifyCondVar
ed monitored data. syntax #include <prcvar.h> prstatus pr_notifycondvar(prcondvar *cvar); parameter pr_notifycondvar has one parameter: cvar the condition variable to notify. returns the function returns one of the following values: if successful, pr_success. if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable), pr_failure.
description the calling thread must hold the lock that protects the condition, as well as the invariants that are tightly bound to the condition. notification of a condition variable signals a change of state in some monitored data. when the notification occurs, the runtime promotes a thread that is waiting on the condition variable to a ready state. if more than one thread is waiting, the selection of whi...
PR_Now
returns the current time. syntax #include <prtime.h> prtime pr_now(void); parameters none. returns the current time as a prtime value.
description pr_now() returns the current time as number of microseconds since the nspr epoch, which is midnight (00:00:00) 1 january 1970 utc. you cannot assume that the values returned by pr_now() are monotonically increasing because the system clock of the computer may be reset. to obtain monotonically increasing time stamps suitable for measuring elapsed time, use pr_intervalnow(). ...
PR_OpenAnonFileMap
tax #include <prshma.h> nspr_api( prfilemap *) pr_openanonfilemap( const char *dirname, prsize size, prfilemapprotect prot ); parameters the function has the following parameters: dirname a pointer to a directory name that will contain the anonymous file. size the size of the shared memory. prot how the shared memory is mapped. returns pointer to prfilemap or null on error.
description if the shared memory already exists, a handle is returned to that shared memory object. on unix platforms, pr_openanonfilemap uses dirname as a directory name, without the trailing '/', to contain the anonymous file. a filename is generated for the name. on windows platforms, dirname is ignored. ...
PR_OpenDir
h the specified pathname. syntax #include <prio.h> prdir* pr_opendir(const char *name); parameter the function has the following parameter: name the pathname of the directory to be opened. returns if the directory is successfully opened, a prdir object is dynamically allocated and the function returns a pointer to it. if the directory cannot be opened, the function returns null.
description pr_opendir opens the directory specified by the pathname name and returns a pointer to a directory stream (a prdir object) that can be passed to subsequent pr_readdir calls to get the directory entries (files and subdirectories) in the directory. the prdir pointer should eventually be closed by a call to pr_closedir. ...
PR_OpenSemaphore
t char *name, printn flags, printn mode, pruintn value ); parameters the function has the following parameters: name the name to be given the semaphore. flags how to create or open the semaphore. mode unix style file mode to be used when creating the semaphore. value the initial value assigned to the semaphore. returns a pointer to a prsem structure or null/code> on error.
description if the named semaphore doesn't exist and the pr_sem_create flag is specified, the named semaphore is created. the created semaphore needs to be removed from the system with a pr_deletesemaphore call. if pr_sem_create is specified, the third argument is the access permission bits of the new semaphore (same interpretation as the mode argument to pr_open) and the fourth argument is the initial val...
PR_OpenSharedMemory
s */ parameters the function has the following parameters: name the name of the shared memory segment. size the size of the shared memory segment. flags options for creating the shared memory. mode same as passed to pr_open. returns pointer to opaque structure prsharedmemory, or null if an error occurs. retrieve the reason for the failure by calling pr_geterror and pr_getoserror.
description pr_opensharedmemory creates a new shared memory segment or associates a previously created memory segment with the specified name. when parameter create is (pr_shm_excl | pr_shm_create) and the shared memory already exists, the function returns null with the error set to pr_file_exists_error. when parameter create is pr_shm_create and the shared memory already exists, a handle to that memory se...
PR_OpenTCPSocket
ollowing parameters: af the address family of the new tcp socket. can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened tcp socket. if the creation of a new tcp socket failed, null.
description tcp (transmission control protocol) is a connection-oriented, reliable byte-stream protocol of the tcp/ip protocol suite. pr_opentcpsocket creates a new tcp socket of the address family af. a tcp connection is established by a passive socket (the server) accepting a connection setup request from an active socket (the client). typically, the server binds its socket to a well-known port with pr_bi...
PR OpenUDPSocket
ollowing parameters: af the address family of the new udp socket. can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened udp socket. if the creation of a new udp socket failed, null.
description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. udp datagrams may be lost or delivered in duplicates or out of sequence. pr_openudpsocket creates a new udp socket of the address family af. the socket may be bound to a well-known port number with pr_bind. datagrams can be sent with pr_sendto and received with pr_recvfrom. when the sock...
PR_PREV_LINK
returns the preceding element in a list. syntax #include <prclist.h> prclist *pr_prev_link (prclist *elemp); parameter elemp a pointer to the element. returns a pointer to a list element.
description pr_prev_link returns a pointer to the element preceding the specified element. it can be used to traverse a list. the preceding element is not removed from the list. ...
PR_Poll
es without any i/o becoming ready, pr_poll returns zero. returns the function returns one of these values: if successful, the function returns a positive number indicating the number of prpolldesc structures in pds that have events. the value 0 indicates the function timed out. the value -1 indicates the function failed. the reason for the failure can be obtained by calling pr_geterror.
description this function returns as soon as i/o is ready on one or more of the underlying socket objects. a count of the number of ready descriptors is returned unless a timeout occurs, in which case zero is returned. the in_flags field of the prpolldesc data structure should be set to the i/o events (readable, writable, exception, or some combination) that the caller is interested in. on successful retur...
PR_PopIOLayer
yer is to be removed. id identity of the layer to be removed from the stack. returns the function returns one of the following values: if the layer is successfully removed from the stack, a pointer to the removed layer. if the layer is not found in the stack or cannot be popped (for example, the bottommost layer), the function returns null with the error code pr_invalid_argument_error.
description pr_popiolayer pops the specified layer from the stack. if the object to be removed is found, pr_popiolayer returns a pointer to the removed object the object then becomes the responsibility of the caller. even if the identity indicates the top layer of the stack, the reference returned is not the file descriptor for the stack and that file descriptor remains valid. in other words, stack continu...
PR_ProcessAttrSetInheritableFileMap
etinheritablefilemap( prprocessattr *attr, prfilemap *fm, const char *shmname ); parameters the function has the following parameters: attr pointer to a prprocessattr structure used to pass data to pr_createprocess. fm pointer to a prfilemap structure to be passed to the child process. shmname pointer to the name for the prfilemap; used by child. returns prstatus
description pr_processattrsetinheritablefilemap connects the prfilemap to prprocessattr with shmname. a subsequent call to pr_createprocess makes the prfilemap importable by the child process. note: this function is not implemented. ...
PR_PushIOLayer
layer is to be added. layer a pointer to a prfiledesc object representing the new layer to be added to the stack. returns the function returns one of the following values: if the layer is successfully pushed onto the stack, pr_success. if the layer is not successfully pushed onto the stack, pr_failure. use pr_geterror to get additional information regarding the reason for the failure.
description a file descriptor for a layer (possibly allocated using pr_createiolayerstub) may be pushed onto an existing stack of file descriptors at any time. the new layer is inserted into the stack just above the layer with the identity specified by id. even if the id parameter indicates the topmost layer of the stack, the value of the file descriptor describing the original stack will not change. in ot...
PR_Realloc
ed memory on the heap. syntax #include <prmem.h> void *pr_realloc ( void *ptr, pruint32 size); parameters ptr a pointer to the existing memory block being resized. size the size of the new memory block. returns an untyped pointer to the allocated memory, or if the allocation attempt fails, null. call pr_geterror() to retrieve the error returned by the libc function realloc().
description this function attempts to enlarge or shrink the memory block addressed by ptr to a new size. the contents of the specified memory remains the same up to the smaller of its old size and new size, although the new memory block's address can be different from the original address. ...
PR_REMOVE_AND_INIT_LINK
removes an element from a circular list and initializes the linkage. syntax #include <prclist.h> pr_remove_and_init_link (prclist *elemp); parameter elemp a pointer to the element.
description pr_remove_and_init_link removes the specified element from its circular list and initializes the links of the element to point to itself. ...
PR_REMOVE_LINK
removes an element from a circular list. syntax #include <prclist.h> pr_remove_link (prclist *elemp); parameter elemp a pointer to the element.
description pr_remove_link removes the specified element from its circular list. ...
PR_Read
inter to a buffer to hold the data read in. on output, the buffer contains the data. amount the size of buf (in bytes). returns one of the following values: a positive number indicates the number of bytes actually read in. the value 0 means end of file is reached or the network connection is closed. the value -1 indicates a failure. to get the reason for the failure, call pr_geterror.
description the thread invoking pr_read blocks until it encounters an end-of-stream indication, some positive number of bytes (but no more than amount bytes) are read in, or an error occurs. ...
PR_ReadDir
.." pr_skip_hidden. skip hidden files. on windows platforms and the mac os, this value identifies files with the "hidden" attribute set. on unix platform, this value identifies files whose names begin with a period ("."). returns a pointer to the next entry in the directory. if the end of the directory is reached or an error occurs, null. the reason can be retrieved via pr_geterror.
description pr_readdir returns a pointer to a directory entry structure: struct prdirentry { const char *name; }; typedef struct prdirentry prdirentry; the structure has the following field: name name of entry, relative to directory name. the flags parameter is an enum of type prdirflags: typedef enum prdirflags { pr_skip_none = 0x0, pr_skip_dot = 0x1, pr_skip_dot_dot = 0x2, pr_s...
PR_Recv
ek. timeout a value of type printervaltime specifying the time limit for completion of the receive operation. returns the function returns one of the following values: a positive number indicates the number of bytes actually received. the value 0 means the network connection is closed. the value -1 indicates a failure. the reason for the failure can be obtained by calling pr_geterror.
description pr_recv blocks until some positive number of bytes are transferred, a timeout occurs, or an error occurs. no more than amount bytes will be transferred. ...
PR_RecvFrom
rn. timeout a value of type printervaltime specifying the time limit for completion of the receive operation. returns the function returns one of the following values: a positive number indicates the number of bytes actually received. the value 0 means the network connection is closed. the value -1 indicates a failure. the reason for the failure can be obtained by calling pr_geterror.
description pr_recvfrom receives up to a specified number of bytes from socket, which may or may not be connected. the operation blocks until one or more bytes are transferred, a timeout has occurred, or there is an error. no more than amount bytes will be transferred. pr_recvfrom is usually used with a udp socket. ...
PR_Rename
renames a file. syntax #include <prio.h> prstatus pr_rename( const char *from, const char *to); parameters the function has the following parameters: from the old name of the file to be renamed. to the new name of the file. returns one of the following values: if file is successfully renamed, pr_success. if file is not successfully renamed, pr_failure.
description pr_rename renames a file from its old name (from) to a new name (to). if a file with the new name already exists, pr_rename fails with the error code pr_file_exists_error. in this case, pr_rename does not overwrite the existing filename. ...
PR_RmDir
removes a directory with a specified name. syntax #include <prio.h> prstatus pr_rmdir(const char *name); parameter the function has the following parameter: name the name of the directory to be removed. returns if successful, pr_success. if unsuccessful, pr_failure. the actual reason can be retrieved via pr_geterror.
description pr_rmdir removes the directory specified by the pathname name. the directory must be empty. if the directory is not empty, pr_rmdir fails and pr_geterror returns the error code pr_directory_not_empty_error. see also pr_mkdir ...
PR_STATIC_ASSERT
iling when an expression has the value false at compile time. syntax #include <prlog.h> pr_static_assert ( expression ); parameters the macro has this parameter: expression any valid expression which evaluates at compile-time to true or false. an expression which cannot be evaluated at compile time will cause a compiler error; see pr_assert for a runtime alternative. returns nothing
description this macro evaluates the specified expression. when the result is zero (false) program compilation will fail with a compiler error; otherwise compilation completes successfully. the compiler error will include the number of the line for which the compile-time assertion failed. this macro may only be used in locations where an extern function declaration may be used. ...
PR_Seek
the file plus the value of the offset parameter. returns the function returns one of the following values: if the function completes successfully, it returns the resulting file pointer location, measured in bytes from the beginning of the file. if the function fails, the file pointer remains unchanged and the function returns -1. the error code can then be retrieved with pr_geterror.
description here's an idiom for obtaining the current location of the file pointer for the file descriptor fd: pr_seek(fd, 0, pr_seek_cur) see also if you need to move the file pointer by a large offset that's out of the range of a 32-bit integer, use pr_seek64. new code should use pr_seek64 so that it can handle files larger than 2 gb. ...
PR_Seek64
the file plus the value of the offset parameter. returns the function returns one of the following values: if the function completes successfully, it returns the resulting file pointer location, measured in bytes from the beginning of the file. if the function fails, the file pointer remains unchanged and the function returns -1. the error code can then be retrieved with pr_geterror.
description this is the idiom for obtaining the current location (expressed as a 64-bit integer) of the file pointer for the file descriptor fd: pr_seek64(fd, 0, pr_seek_cur) if the operating system can handle only a 32-bit file offset, pr_seek64 may fail with the error code pr_file_too_big_error if the offset parameter is out of the range of a 32-bit integer. see also pr_seek ...
PR_Send
pe printervaltime specifying the time limit for completion of the receive operation. returns the function returns one of the following values: a positive number indicates the number of bytes successfully sent. if the parameter fd is a blocking socket, this number must always equal amount. the value -1 indicates a failure. the reason for the failure can be obtained by calling pr_geterror.
description pr_send blocks until all bytes are sent, a timeout occurs, or an error occurs. ...
PR_SendTo
ero. addr a pointer to the address of the destination. timeout a value of type printervaltime specifying the time limit for completion of the receive operation. returns the function returns one of the following values: a positive number indicates the number of bytes successfully sent. the value -1 indicates a failure. the reason for the failure can be obtained by calling pr_geterror.
description pr_sendto sends a specified number of bytes from a socket to the specified destination address. the calling thread blocks until all bytes are sent, a timeout has occurred, or there is an error. ...
PR_SetConcurrency
the m x n model is not available on all host systems. on those where it is not available, pr_setconcurrency is ignored. ...
PR_SetError
sets error information within a thread context. syntax #include <prerror.h> void pr_seterror(prerrorcode errorcode, print32 oserr) parameters the function has these parameters: errorcode the nspr (platform-independent) translation of the error. oserr the platform-specific error. if there is no appropriate os error number, a zero may be supplied.
description nspr does not validate the value of the error number or os error number being specified. the runtime merely stores the value and returns it when requested. ...
PR_SetErrorText
*text) parameters the function has these parameters: textlength the length of the text in the text. may be null. if not null, and if text is zero, the string is assumed to be a null-terminated c string. otherwise the text is assumed to be the length specified and to possibly include null characters (as might occur in a multilingual string). text the text to associate with the error.
description the text is copied into the thread structure and remains there until the next call to pr_seterror. if there is error text already present in the thread, the previous value is first deleted. the new value is copied into storage allocated and owned by nspr and remains there until the next call to pr_seterror or another call to pr_seterrortext. nspr makes no use of this function. clients may use i...
PR_SetLibraryPath
tains the directory path that the application should use as a default. the syntax of the pathname is not defined, nor whether that pathname should be absolute or relative. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. this may indicate that the function cannot allocate sufficient storage to make a copy of the path string
description this function registers a default library pathname with the runtime. this allows an environment to express policy decisions globally and lazily, rather than hardcoding and distributing the decisions throughout the code. ...
PR_SetLogBuffering
sets the level of buffering for the log file. syntax #include <prlog.h> void pr_setlogbuffering(printn buffer_size); parameters the function has this parameter: buffer_size the size of the buffer to be used for logging. returns nothing
description this function sets the size of the buffer used in nspr logging. ordinarily, a user application need not use this function, as nspr initializes logging at nspr startup. the application can use the model provided in use example to effect application logging. ...
PR_SetLogFile
sets the name of the log file. syntax #include <prlog.h> prbool pr_setlogfile(const char *name); parameters the function has this parameter: name the name of the log file. returns pr_true when successful. otherwise, pr_false.
description creates a log file with the specified file name. subsequent log messages are written to this file. ordinarily, a user application need not use this function, as nspr initializes logging at nspr startup. the application can use the model provided in use example to effect application logging. ...
PR_SetThreadPriority
sets the priority of a specified thread. syntax #include <prthread.h> void pr_setthreadpriority( prthread *thread, prthreadpriority priority); parameters pr_setthreadpriority has the following parameters: thread a valid identifier for the thread whose priority you want to set. priority the priority you want to set.
description modifying the priority of a thread other than the calling thread is risky. it is difficult to ensure that the state of the target thread permits a priority adjustment without ill effects. it is preferable for a thread to specify itself in the thread parameter when it calls pr_setthreadpriority. ...
PR_SetThreadPrivate
<prthread.h> prstatus pr_setthreadprivate(pruintn index, void *priv); parameters pr_setthreadprivate has the following parameters: index an index into the per-thread private data table. priv the per-thread private data, or more likely, a pointer to the data. returns the function returns one of the following values: if successful, pr_success. if the index is invalid, pr_failure.
description if the thread already has non-null private data associated with it, and if the destructor function for the index is known (not null), nspr calls the destructor function associated with the index before setting the new data value. the pointer at the index is swapped with null. if the swapped out value is not null, the destructor function is called. on return, the private data associated with the ...
PR_Shutdown
pr_shutdown_rcv. further receives will be disallowed. pr_shutdown_send. further sends will be disallowed. pr_shutdown_both. further sends and receives will be disallowed. ...
PR_Sleep
the current thread to yield for a specified amount of time. syntax #include <prthread.h> prstatus pr_sleep(printervaltime ticks); parameter pr_sleep has the following parameter: ticks the number of ticks you want the thread to sleep for (see printervaltime). returns calling pr_sleep with a parameter equivalent to pr_interval_no_timeout is an error and results in a pr_failure error.
description pr_sleep simply waits on a condition for the amount of time specified. if you set ticks to pr_interval_no_wait, the thread yields. if ticks is not pr_interval_no_wait, pr_sleep uses an existing lock, but has to create a new condition for this purpose. if you have already created such structures, it is more efficient to use them directly. calling pr_sleep with the value of ticks set to pr_inter...
PR_StringToNetAddr
pr_stringtonetaddr( const char *string, prnetaddr *addr); parameters the function has the following parameters: string the string to be converted. addr on output, the equivalent network address. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. you can retrieve the reason for the failure by calling pr_geterror.
description for ipv4 addresses, the input string represents numbers in the internet standard "." notation. ipv6 addresses are indicated as strings using ":" characters separating octets, with numerous caveats for shortcutting (see rfc #1884). if the nspr library and the host are configured to support ipv6, both formats are supported. otherwise, use of anything other than ipv4 dotted notation results in an e...
PR_Sync
synchronizes any buffered data for a file descriptor to its backing device (disk). syntax #include <prio.h> prstatus pr_sync(prfiledesc *fd); parameter the function has the following parameter: fd pointer to a prfiledesc object representing a file. returns the function returns one of the following values: on successful completion, pr_success. if the function fails, pr_failure.
description pr_sync writes all the in-memory buffered data of the specified file to the disk. ...
PR_TicksPerSecond
returns the number of ticks per second currently used to determine the value of printervaltime. syntax #include <prinrval.h> pruint32 pr_tickspersecond(void); returns an integer between 1000 and 100000 indicating the number of ticks per second counted by printervaltime on the current platform. this value is platform-dependent and does not change after nspr is initialized.
description the value returned by pr_tickspersecond() lies between pr_interval_min and pr_interval_max. the relationship between a printervaltime tick and standard clock units is platform-dependent. pr_pr_tickspersecond() allows you to discover exactly what that relationship is. seconds per tick (the inverse of pr_pr_tickspersecond()) is always between 10 microseconds and 1 millisecond. ...
PR_TransmitFile
of the file. timeout time limit for completion of the transmit operation. returns a positive number indicates the number of bytes successfully written, including both the headers and the file. the value -1 indicates a failure. if an error occurs while sending the file, the pr_transmitfile_close_socket flag is ignored. the reason for the failure can be obtained by calling pr_geterror.
description the pr_transmitfile function sends a complete file (sourcefile) across a connected socket (networksocket). if headers is non-null, pr_transmitfile sends the headers across the socket before sending the file. the enumeration prtransmitfileflags, used in the flags parameter, is defined as follows: typedef enum prtransmitfileflags { pr_transmitfile_keep_open = 0, pr_transmitfile_close_socket ...
PR_UnloadLibrary
loads a library loaded with pr_loadlibrary. syntax #include <prlink.h> prstatus pr_unloadlibrary(prlibrary *lib); parameters the function has this parameter: lib a reference previously returned from pr_loadlibrary. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. use pr_geterror to find the reason for the failure.
description this function undoes the effect of a pr_loadlibrary. after calling this function, future references to the library using its identity as returned by pr_loadlibrary will be invalid. ...
PR_Unmap
the function has the following parameters: addr the starting address of the memory region to be unmapped. len the length, in bytes, of the memory region. returns the function returns one of the following values: if the memory region is successfully unmapped, pr_success. if the memory region is not successfully unmapped, pr_failure. the error code can be retrieved via pr_geterror.
description pr_memunmap removes the file mapping for the memory region (addr, addr + len). the parameter addr is the return value of an earlier call to pr_memmap. ...
PR_VersionCheck
#include <prinit.h> prbool pr_versioncheck(const char *importedversion); parameter pr_versioncheck has one parameter: importedversion the version of the shared library being imported. returns the function returns one of the following values: if the version of the shared library is compatible with that expected by the caller, pr_true. if the versions are not compatible, pr_false.
description pr_versioncheck tests whether the version of the library being imported (importedversion) is compatible with the running version of the shared library. this is a string comparison of sorts, though the details of the comparison will vary over time. see also pr_version ...
PR_Wait
eing rescheduled. returns the function returns one of the following values: pr_success means the thread is being resumed from the pr_wait call either because it was explicitly notified or because the time specified by the parameter ticks has expired. pr_failure means pr_wait encountered a system error (such as an invalid monitor reference) or the thread was interrupted by another thread.
description a call to pr_wait causes the thread to release the monitor's lock, just as if it had called pr_exitmonitor as many times as it had called pr_entermonitor. this has the effect of making the monitor available to other threads. when the wait is over, the thread regains control of the monitor's lock with the same entry count it had before the wait began. a thread waiting on the monitor resumes when...
PR_WaitCondVar
cheduling within the runtime, then immediately attempt to reacquire the lock and resume. returns the function returns one of the following values: if successful, pr_success. if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable or the thread was interrupted with pr_interrupt), pr_failure. the details can be determined with pr_geterror.
description before the call to pr_waitcondvar, the lock associated with the condition variable must be held by the calling thread. after a call to pr_waitcondvar, the lock is released and the thread is blocked in a "waiting on condition" state until another thread notifies the condition or a caller-specified amount of time expires. when the condition variable is notified, a thread waiting on that condition...
PR_WaitSemaphore
returns the value of the environment variable. syntax #include <pripcsem.h> nspr_api(prstatus) pr_waitsemaphore(prsem *sem); parameter the function has the following parameter: sem a pointer to a prsem structure returned from a call to pr_opensemaphore. returns prstatus
description pr_waitsemaphore tests the value of the semaphore. if the value of the semaphore is > 0, the value of the semaphore is decremented and the function returns. if the value of the semaphore is 0, the function blocks until the value becomes > 0, then the semaphore is decremented and the function returns. the "test and decrement" operation is performed atomically. ...
PR_Write
rfiledesc object for a file or socket. buf a pointer to the buffer holding the data to be written. amount the amount of data, in bytes, to be written from the buffer. returns one of the following values: a positive number indicates the number of bytes successfully written. the value -1 indicates that the operation failed. the reason for the failure is obtained by calling pr_geterror.
description the thread invoking pr_write blocks until all the data is written or the write operation fails. therefore, the return value is equal to either amount (success) or -1 (failure). note that if pr_write returns -1, some data (less than amount bytes) may have been written before an error occurred. ...
PR_Writev
nd the error will be set to pr_buffer_overflow_error. timeout a value of type printervaltime describing the time limit for completion of the entire write operation. returns one of the following values: a positive number indicates the number of bytes successfully written. the value -1 indicates that the operation failed. the reason for the failure can be obtained by calling pr_geterror.
description the thread calling pr_writev blocks until all the data is written or the write operation fails. therefore, the return value is equal to either the sum of all the buffer lengths (on success) or -1 (on failure). note that if pr_writev returns -1, part of the data may have been written before an error occurred. if the timeout parameter is not pr_interval_no_timeout and all the data cannot be writte...
PR_cnvtf
tf ( char *buf, printn bufsz, printn prcsn, prfloat64 fval); parameters the function has these parameters: buf the address of the buffer in which to store the result. bufsz the size of the buffer provided to hold the result. prcsn the number of digits of precision to which to generate the floating point value. fval the double-precision floating point number to be converted.
description pr_cnvtf is a simpler interface to convert a floating point number to a string. it conforms to the ecma standard of javascript (ecmascript). on return, the result is written to the buffer pointed to by buf of size bufsz. ...
PR_dtoa
hat the conversion was of a negative value. *rve if not null this location is set to the address of the end of the result. buf the address of the buffer in which to store the result. bufsz the size of the buffer provided to hold the result. results the principle output is the null-terminated string stored in buf. if rve is not null, *rve is set to point to the end of the returned value.
description this function converts the specified floating point number to a string, using the method specified by mode. possible modes are: 0 shortest string that yields d when read in and rounded to nearest. 1 like 0, but with steele & white stopping rule. for example, with ieee 754 arithmetic, mode 0 gives 1e23 whereas mode 1 gives 9.999999999999999e22. 2 max(1, ndigits) significant digits. this g...
PR_strtod
d(const char *s00, char **se); parameters the function has these parameters: s00 the input string to be scanned. se a pointer that, if not null, will be assigned the address of the last character scanned in the input string. returns the result of the conversion is a prfloat64 value equivalent to the input string. if the parameter se is not null the location it references is also set.
description pr_strtod converts the prefix of the input decimal string pointed to by s00 to a nearest double-precision floating point number. ties are broken by the ieee round-even rule. the string is scanned up to the first unrecognized character. if the value of se is not (char **) null, pr_strtod stores a pointer to the character terminating the scan in *se. if the answer would overflow, a properly signed...
CERT_FindCertByDERCert
ches a der-encoded certificate. syntax #include <cert.h> certcertificate *cert_findcertbydercert( certcertdbhandle *handle, secitem *dercert ); parameters handle in pointer to a certcertdbhandle representing the certificate database to look in dercert in pointer to an secitem whose type must be sidercertbuffer and whose data contains a der-encoded certificate
description this function looks in the ?nsscryptocontext? and the ?nsstrustdomain? to find the certificate that matches the der-encoded certificate. a match is found when the issuer and serial number of the der-encoded certificate are found on a certificate in the certificate database. returns a pointer to a certcertificate representing the certificate in the database that matched the dercert, or null if...
CERT_FindCertByIssuerAndSN
er. syntax #include <cert.h> certcertificate *cert_findcertbyissuerandsn ( certcertdbhandle *handle, certissuerandsn *issuerandsn ); parameters handle in pointer to a certcertdbhandle representing the certificate database to look in issuerandsn in pointer to a certissuerandsn that must be properly formed to contain the issuer name and the serial number (see [example])
description this function creates a certificate key using the issuerandsn and it then uses the key to find the matching certificate in the database. returns a pointer to a certcertificate representing the certificate in the database that matched the issuer and serial number, or null if none was found. the certificate is a shallow copy, use cert_destroycertificate to decrement the reference count on the c...
Using JSS
quire the nss shared libraries. the exact library names vary according to the convention for each platform. for example, the nspr library is called nspr4.dll or libnspr4.dll on windows and libnspr4.so on solaris. the following table gives the core names of the libraries, omitting the platform-specific prefix and suffix. ...
NSS Key Log Format
ines. comment lines begin with a sharp character ('#') and are ignored. secrets follow the format <label> <space> <clientrandom> <space> <secret> where: <label> describes the following secret. <clientrandom> is 32 bytes random value from the client hello message, encoded as 64 hexadecimal characters. <secret> depends on the label (see below). ...
NSS_3.12_release_notes.html
a crl fails to be decoded bug 421216: libpkix test nss_thread leaks a test certificate bug 301259: signtool usage message is unhelpful bug 389781: nss should be built size-optimized in browser builds on linux, windows, and mac bug 90426: use of obsolete typedefs in public nss headers bug 113323: the first argument to pk11_findcertfromnickname should be const. ...
NSS 3.35 release notes
or_unsupported_experimental_api code if the selected api is not available. experimental functions will always return this result if they are disabled or removed from a later nss release. if these experimental functions are made permanent in a later nss release, no change to code is necessary. (only apis exported in *.def files are stable apis.) new experimental functionality provided below are
descriptions of experimental functionality, which might not be available in future releases of nss. users of tls are now able to provide implementations of tls extensions, through an experimental custom extension api. see the documentation in sslexp.h for ssl_installextensionhooks for more information on this feature. several experimental apis were added in support of tls 1.3 features: tls servers ...
NSS 3.46 release notes
hangs on windows x64 when building nss since changeset 9162c654d06915f0f15948fbf67d4103a229226f bug 1564875 - improve rebuilding with build.sh bug 1565243 - support tc_owner without email address in nss tas...
NSS API Guidelines
2 and pkcs #5 libraries nss compiles into the libraries described below. the layer indicates the main layer, seen in the previous diagram, in which the library operates. the directory is the location of the library code in the nss source tree. the public headers is a list of header files that contain types, and functions, that are publicly available to higer-level apis. library
description layer directory public headers certdb provides all certificate handling functions and types. the certdb library manipulates the certificate database (add, create, delete certificates and crls). it also provides general certificate-handling routines (create a certificate, verify, add/check certificate extensions). low cert lib/certdb cdbhdl.h, certdb.h, cert.h, certt.
nss tech note4
epresents an algorithm, a mechanism, a piece of information, etc. examples: x500 rsa encryption, certificate basic constraints, pkcs#7 digested data, etc. there is a long list of pre-defined oids, and new ones can be added dynamically by an application. the oid data structure contains an array of identifier bytes (each byte is a "level" in a hierarchical namespace), a text
description, and some other things. critical : indicates whether the extension is critical value : the value of the extension looping through all extensions certcertextension** extensions =cert->extensions; if (extensions) { while (*extensions) { secitem *ext_oid = &(*extensions)->id; secit...
NSS Tools sslstrength
the letter in the first column of the output is used to identify the cipher preferences in the ciphers= command. the second form attempts to connect to the named ssl host. ...
NSS release notes template
x or newer. nss 3.xx source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_xx_rtm/src/ (make a link) new in nss 3.xx new functionality either: no new functionality is introduced in this release. this is a patch release to fix ... or: ... new functions in ___.h function -
description new types in ___.h type -
description. new macros in ___.h macro -
description notable changes in nss 3.xx ... bugs fixed in nss 3.xx this bugzilla query returns all the bugs fixed in nss 3.xx: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.xx (make a link) acknowledgemen...
FC_CancelFunction
name fc_cancelfunction - cancel a function running in parallel syntax ck_rv fc_cancelfunction( ck_session_handle hsession ); parameters hsession [in] session handle.
description parallel functions are not implemented. fc_cancelfunction is a legacy function that simply returns ckr_function_not_parallel. return value fc_cancelfunction always returns ckr_function_not_parallel. examples see also nsc_cancelfunction ...
FC_CloseAllSessions
the nss cryptographic module currently doesn't call the surrender callback function notify. ...
FC_CloseSession
name fc_closesession - close a session opened between an application and a token. syntax ck_rv fc_closesession( ck_session_handle hsession ); parameters hsession [in] the session handle to be closed.
description fc_closesession closes a session between an application and a token. a user may call fc_closesession without logging into the token (to assume the nss user role). return value examples see also fc_opensession ...
FC_CopyObject
ck_rv fc_copyobject( ck_session_handle hsession, ck_object_handle hobject, ck_attribute_ptr ptemplate, ck_ulong uscount, ck_object_handle_ptr phnewobject ); parameters hsession [in] session handle. hobject [in] object handle. ptemplate [in] object template. uscount [in] number of attributes in the template. phnewobject [out] pointer to location to receive the new object's handle.
description fc_copyobject creates a copy of an object using the attributes specified in the template. a user must log into the token (to assume the nss user role) before copying a secret or private key object. return value examples see also fc_destroyobject, nsc_copyobject ...
FC_CreateObject
name fc_createobject - create a new object. syntax ck_rv fc_createobject( ck_session_handle hsession, ck_attribute_ptr ptemplate, ck_ulong ulcount, ck_object_handle_ptr phobject ); parameters hsession [in] session handle. ptemplate [in] object template. ulcount [in] number of attributes in the template. phobject [out] pointer to location to receive the new objects handle.
description fc_createobject creates an object using the attributes specified in the template. a user must log into the token (to assume the nss user role) before calling fc_createobject. return value examples see also fc_destroyobject, nsc_createobject ...
FC_Decrypt
ata, ck_ulong usencrypteddatalen, ck_byte_ptr pdata, ck_ulong_ptr pusdatalen ); parameters hsession [in] session handle. pencrypteddata [in] pointer to encrypted data block. usencrypteddatalen [in] length of the data in bytes. pdata [out] pointer to location where recovered data is to be stored. pusdatalen [in,out] pointer to location where the length of recovered data is to be stored.
description fc_decrypt decrypts a block of data according to the attributes of the previous call to fc_decryptinit. a user must log into the token (to assume the nss user role) before calling fc_decrypt. return value examples see also fc_decryptinit, nsc_decrypt ...
FC_DecryptDigestUpdate
dpart, ck_ulong ulencryptedpartlen, ck_byte_ptr ppart, ck_ulong_ptr pulpartlen ); parameters hsession [in] session handle. pencryptedpart [in] pointer to the encrypted data part. ulencryptedpartlen [in] length of encrypted data in bytes. ppart [in] pointer to the location which receives the recovered data part or null. pulpartlen [in] pointer to the length of the recovered part buffer.
description fc_decryptdigestupdate continues a multi-part decrypt and digest operation. after calling both fc_decryptinit and fc_digestinit to set up the operations this function may be called multiple times. the operation is finished by calls to fc_digestfinal and fc_decryptfinal. a user must log into the token (to assume the nss user role) before calling fc_decryptdigestupdate. return value examples ...
FC_DecryptFinal
decryption operation. syntax ck_rv fc_decryptfinal( ck_session_handle hsession, ck_byte_ptr plastpart, ck_ulong_ptr puslastpartlen ); parameters hsession [in] session handle. plastpart [out] pointer to the location where the last block of recovered data, if any, is to be stored. puslastpartlen [in,out] pointer to location where the number of bytes of recovered data is to be stored.
description fc_decryptfinal returns the last block of data of a multi-part decryption operation. a user must log into the token (to assume the nss user role) before calling fc_decryptfinal. return value examples see also fc_decryptinit, nsc_decryptfinal ...
FC_DecryptInit
name fc_decryptinit - initialize a decryption operation. syntax ck_rv fc_decryptinit( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the subsequent decryption operation. hkey [in] handle of the key to be used.
description fc_decryptinit initializes a decryption operation. a user must log into the token (to assume the nss user role) before calling fc_decryptinit. return value examples see also nsc_decryptinit ...
FC_DecryptUpdate
len, ck_byte_ptr ppart, ck_ulong_ptr puspartlen ); parameters hsession [in] session handle. pencryptedpart [in] pointer to the next block of data to be decrypted. usencryptedpartlen [in] length of data block in bytes. ppart [out] pointer to location where recovered block is to be stored. puspartlen [in,out] pointer the location where the number of bytes of recovered data is to be stored.
description fc_decryptupdate decrypts a block of data according to the attributes of the previous call to fc_decryptinit. the block may be part of a multi-part decryption operation. a user must log into the token (to assume the nss user role) before calling fc_decryptupdate. return value examples see also fc_decryptinit, nsc_decryptupdate ...
FC_DecryptVerifyUpdate
ddata, ck_ulong ulencrypteddatalen, ck_byte_ptr pdata, ck_ulong_ptr puldatalen ); parameters hsession [in] session handle. pencrypteddata [in] pointer to the encrypted data part. ulencrypteddatalen [in] length of encrypted data in bytes. pdata [in] pointer to the location which receives the recovered data part or null. puldatalen [in] pointer to the length of the recovered part buffer.
description fc_decryptverifyupdate continues a multi-part decryption and and signature verification operation. after calling both fc_decryptinit and fc_verifyinit to set up the operations this function may be called multiple times. the operation is finished by calls to fc_decryptfinal and fc_verifyfinal. a user must log into the token (to assume the nss user role) before calling fc_decryptverifyupdate. re...
FC_DeriveKey
t_handle_ptr phkey ); parameters hsession [in] session handle. pmechanism [in] pointer to the mechanism to use. hbasekey [in] handle of the base key. pwrappedkey [in] pointer to the wrapped key. ptemplate [in] pointer to the list of attributes for the new key. usattributecount [in] number of attributes in the template. phkey [out] pointer to the location to receive the handle of the new key.
description fc_derivekey derives (decrypts) a key and creates a new key object. a user must log into the token (to assume the nss user role) before calling fc_derivekey. return value examples see also nsc_derivekey ...
FC_DestroyObject
name fc_destroyobject - destroy an object. syntax ck_rv fc_destroyobject( ck_session_handle hsession, ck_object_handle hobject ); parameters hsession [in] session handle. hobject [in] object handle.
description fc_destroyobject destroys an object. a user must log into the token (to assume the nss user role) before destroying a secret or private key object. return value examples see also nsc_destroyobject ...
FC_Digest
ck_byte_ptr pdigest, ck_ulong_ptr pusdigestlen ); parameters hsession [in] session handle. pdata [in] pointer to data block. usdatalen [in] length of the data in bytes. pdigest [out] pointer to location where recovered data is to be stored. pusdigestlen [in, out] pointer to the maximum size of the output buffer, replaced by the length of the message digest if the operation is successful.
description fc_digest digests a message in a single operation according to the attributes of the previous call to fc_digestinit. a user may call fc_digest without logging into the token (to assume the nss user role). return value examples see also fc_digestinit, nsc_digest ...
FC_DigestEncryptUpdate
tr ppart, ck_ulong ulpartlen, ck_byte_ptr pencryptedpart, ck_ulong_ptr pulencryptedpartlen ); parameters hsession [in] session handle. ppart [in] pointer to the data part. ulpartlen [in] length of data in bytes. pencryptedpart [in] pointer to the location which receives the digested and encrypted part or null. pulencryptedpartlen [in] pointer to the length of the encrypted part buffer.
description fc_digestencryptupdate continues a multi-part digest and encryption operation. after calling both fc_digestinit and fc_encryptinit to set up the operations this function may be called multiple times. the operation is finished by calls to fc_digestfinal and fc_encryptfinal in that order. a user must log into the token (to assume the nss user role) before calling fc_digestencryptupdate. return v...
FC_DigestFinal
name fc_digestfinal - finish a multi-part digest operation. syntax ck_rv fc_digestfinal( ck_session_handle hsession, ck_byte_ptr pdigest, ck_ulong_ptr puldigestlen ); parameters hsession [in] session handle. pdigest [out] pointer to the buffer which will receive the digest or null. puldigestlen [in, out] pointer to location containing the maximum buffer size.
description fc_digestfinal finishes a multi-part digest operation by returning the complete digest and clearing the operation context. if pdigest is null the length of the digest is returned and fc_digestfinal may be called again with pdigest set to retrieve the digest. a user may call fc_digestfinal without logging into the token (to assume the nss user role). return value examples see also fc_digestinit, nsc_...
FC_DigestInit
name fc_digestinit - initialize a message-digest operation. syntax ck_rv fc_digestinit( ck_session_handle hsession, ck_mechanism_ptr pmechanism ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the subsequent digest operation.
description fc_digestinit initializes a message-digest operation. a user may call fc_digestinit without logging into the token (to assume the nss user role). return value examples see also nsc_digestinit ...
FC_DigestKey
name fc_digestkey - add the digest of a key to a multi-part digest operation. syntax ck_rv fc_digestkey( ck_session_handle hsession, ck_object_handle hkey ); parameters hsession [in] session handle. hkey [in] handle of the key to be digested.
description fc_digestkey continues a multi-part digest operation by digesting the value of a secret key. the digest for the entire message is returned by a call to fc_digestfinal. a user must log into the token (to assume the nss user role) before calling fc_digestkey. return value examples see also fc_digestinit, fc_digestfinal, nsc_digestkey ...
FC_DigestUpdate
name fc_digestupdate - process the next block of a multi-part digest operation. syntax ck_rv fc_digestupdate( ck_session_handle hsession, ck_byte_ptr ppart, ck_ulong uspartlen ); parameters hsession [in] session handle. ppart [in] pointer to the next block of data to be digested. uspartlen [in] length of data block in bytes.
description fc_digestupdate starts or continues a multi-part digest operation. one or more blocks may be part of the message digest operation. the digest for the entire message is returned by a call to fc_digestfinal. a user may call fc_digestupdate without logging into the token (to assume the nss user role). return value examples see also fc_digestinit, fc_digestfinal, nsc_digestupdate ...
FC_Encrypt
ck_session_handle hsession, ck_byte_ptr pdata, ck_ulong usdatalen, ck_byte_ptr pencrypteddata, ck_ulong_ptr pusencrypteddatalen ); parameters hsession [in] session handle. pdata [in] pointer to the data buffer usdatalen [in] length of the data buffer in bytes. pencrypteddata [out] pointer to location where encrypted data is to be stored. pusencrypteddatalen [in/out] number of bytes.
description fc_encrypt encrypts a block of data according to the attributes of the previous call to fc_encryptinit. a user must log into the token (to assume the nss user role) before calling fc_encrypt. return value examples see also fc_encryptinit, nsc_encrypt ...
FC_EncryptFinal
rv fc_encryptfinal( ck_session_handle hsession, ck_byte_ptr plastencryptedpart, ck_ulong_ptr puslastencryptedpartlen ); parameters hsession [in] session handle. plastencryptedpart [out] pointer to the location that receives the last encrypted data part, if any puslastencryptedpartlen [in,out] pointer to location where the number of bytes of the last encrypted data part is to be stored.
description fc_encryptfinal returns the last block of data of a multi-part encryption operation. a user must log into the token (to assume the nss user role) before calling fc_encryptfinal. return value examples see also fc_encryptinit, nsc_encryptfinal ...
FC_EncryptInit
name fc_encryptinit - initialize an encryption operation. syntax ck_rv fc_encryptinit( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession[in] handle to the session. pmechanism[in] pointer to the mechanism to be used for subsequent encryption. hkey[in] handle of the encryption key.
description fc_encryptinit initializes an encryption operation with the mechanism and key to be used. a user must log into the token (to assume the nss user role) before calling fc_encryptinit. return value ckr_ok slot information was successfully copied. ckr_slot_id_invalid the specified slot number is out of the defined range of values. examples see also nsc_encryptinit ...
FC_EncryptUpdate
r pencryptedpart, ck_ulong_ptr pusencryptedpartlen ); parameters hsession [in] session handle. ppart [in] pointer to the next block of data to be encrypted. uspartlen [in] length of data block in bytes. pencryptedpart [out] pointer to location where encrypted block is to be stored. pusencryptedpartalen [out] pointer the location where the number of bytes of encrypted data is to be stored.
description fc_encryptupdate encrypts a block of data according to the attributes of the previous call to fc_encryptinit. the block may be part of a multi-part encryption operation. a user must log into the token (to assume the nss user role) before calling fc_encryptupdate. return value examples see also fc_encryptinit, nsc_encryptupdate ...
FC_Finalize
if the library is not initialized, it does nothing. the preserved argument is not used and must be null. return value fc_finalize always returns ckr_ok. fc_finalize should check the preserved argument and return ckr_arguments_bad if preserved is not null. ...
FC_FindObjects
fc_findobjects( ck_session_handle hsession, ck_object_handle_ptr phobject, ck_ulong usmaxobjectcount, ck_ulong_ptr pusobjectcount ); parameters hsession [in] session handle. ptemplate [out] pointer to location to receive the object handles. usmaxobjectcount [in] maximum number of handles to retrieve. pusobjectcount [out] pointer to location to receive the number of returned handles.
description fc_findobjects returns the next set of object handles matching the criteria set up by the previous call to fc_findobjectsinit and sets the object count variable to their number or to zero if there are none. return value examples see also fc_findobjectsinit, nsc_findobjects ...
FC_FindObjectsFinal
name fc_findobjectsfinal - terminate an object search. syntax ck_rv fc_findobjectsfinal( ck_session_handle hsession, ); parameters hsession [in] session handle.
description clears the object search criteria for a session. return value examples see also fc_findobjects, nsc_findobjectsfinal ...
FC_FindObjectsInit
name fc_findobjectsinit - initialize the parameters for an object search. syntax ck_rv fc_findobjectsinit( ck_session_handle hsession, ck_attribute_ptr ptemplate, ck_ulong uscount ); parameters hsession [in] session handle. ptemplate [in] pointer to template. uscount [in] number of attributes in the template.
description fc_findobjectsinit sets the attribute list for an object search. if fc_findobjectsinit is successful fc_findobjects may be called one or more times to retrieve handles of matching objects. a user must log into the token (to assume the nss user role) before searching for secret or private key objects. return value examples see also fc_findobjects, nsc_findobjectsinit ...
FC_GenerateKey
hsession, ck_mechanism_ptr pmechanism, ck_attribute_ptr ptemplate, ck_ulong ulcount, ck_object_handle_ptr phkey ); parameters hsession [in] session handle. pmechanism [in] pointer to the mechanism to use. ptemplate [in] pointer to the template for the new key. ulcount [in] number of attributes in the template. phkey [out] pointer to the location to receive the handle of the new key.
description fc_generatekey generates a secret key, creating a new key object. the handle of new key is returned. a user must log into the token (to assume the nss user role) before calling fc_generatekey. return value examples see also nsc_generatekey ...
FC_GenerateKeyPair
publickeyattributecount [in] number of attributes in the public key template. pprivatekeytemplate [in] pointer to the private key template. usprivatekeyattributecount [in] number of attributes in the private key template. phpublickey [out] pointer to the location to receive the handle of the new public key. phprivatekey [out] pointer to the location to receive the handle of the new private key.
description fc_generatekeypair generates a public/private key pair, creating new key objects. the handles of new keys are returned. a user must log into the token (to assume the nss user role) before calling fc_generatekeypair. return value examples see also nsc_generatekeypair ...
FC_GenerateRandom
name fc_generaterandom - generate a random number. syntax ck_rv fc_generaterandom( ck_session_handle hsession, ck_byte_ptr prandomdata, ck_ulong ulrandomlen ); parameters hsession [in] session handle. prandomdata [out] pointer to the location to receive the random data. ulrandomlen [in] length of the buffer in bytes.
description fc_generaterandom generates random data of the specified length. a user may call fc_generaterandom without logging into the token (to assume the nss user role). return value examples see also nsc_generaterandom ...
FC_GetAttributeValue
name fc_getattributevalue - get the value of attributes of an object. syntax ck_rv fc_getattributevalue( ck_session_handle hsession, ck_object_handle hobject, ck_attribute_ptr ptemplate, ck_ulong uscount ); parameters hsession [in] session handle. hobject [in] object handle. ptemplate [in, out] pointer to template. uscount [in] number of attributes in the template.
description fc_getattributevalue gets the value of one or more attributes of an object. a user must log into the token (to assume the nss user role) before getting the attribute values of a secret or private key object. return value examples see also nsc_getattributevalue ...
FC_GetFunctionList
name fc_getfunctionlist - get a pointer to the list of function pointers in the fips mode of operation. syntax ck_rv fc_getfunctionlist(ck_function_list_ptr *ppfunctionlist); parameters fc_getfunctionlist has one parameter: ppfunctionlist [output] the address of a variable that will receive a pointer to the list of function pointers.
description fc_getfunctionlist stores in *ppfunctionlist a pointer to the nss cryptographic module's list of function pointers in the fips mode of operation. a user may call fc_getfunctionlist without logging into the token (to assume the nss user role). return value fc_getfunctionlist always returns ckr_ok. examples #include <assert.h> ck_function_list_ptr pfunctionlist; ck_rv crv; crv = fc_getfunctionlist(&pfunctionlist); assert(crv == ckr...
FC_GetFunctionStatus
name fc_getfunctionstatus - get the status of a function running in parallel syntax ck_rv fc_getfunctionstatus( ck_session_handle hsession ); parameters hsession [in] session handle.
description fc_getfunctionstatus is a legacy function that simply returns ckr_function_not_parallel. return value fc_getfunctionstatus always returns ckr_function_not_parallel. examples see also nsc_getfunctionstatus ...
FC_GetMechanismInfo
name fc_getmechanisminfo - get information on a particular mechanism. syntax ck_rv fc_getmechanisminfo( ck_slot_id slotid, ck_mechanism_type type, ck_mechanism_info_ptr pinfo ); parameters fc_getmechanisminfo takes three parameters: slotid [input] type [input] . pinfo [output] .
description fc_getmechanisminfo obtains information about a particular mechanism possibly supported by a token. a user may call fc_getmechanisminfo without logging into the token (to assume the nss user role). return value ckr_ok examples see also nsc_getmechanisminfo ...
FC_GetMechanismList
name fc_getmechanismlist - get a list of mechanism types supported by a token. syntax ck_rv fc_getmechanismlist( ck_slot_id slotid, ck_mechanism_type_ptr pmechanismlist, ck_ulong_ptr puscount ); parameters fc_getmechanismlist takes three parameters: slotid [input] pinfo [output] the address of a variable that will receive a pointer to the list of function pointers.
description fc_getmechanismlist obtains a list of mechanism types supported by a token. a user may call fc_getmechanismlist without logging into the token (to assume the nss user role). return value ckr_ok examples see also nsc_getmechanismlist ...
FC_GetObjectSize
name fc_getobjectsize - create a copy of an object. syntax ck_rv fc_getobjectsize( ck_session_handle hsession, ck_object_handle hobject, ck_ulong_ptr pussize ); parameters hsession [in] session handle. hobject [in] object handle. pussize [out] pointer to location to receive the object's size.
description fc_getobjectsize gets the size of an object in bytes. a user must log into the token (to assume the nss user role) before getting the size of a secret or private key object. return value examples see also nsc_getobjectsize ...
FC_GetOperationState
erationstate( ck_session_handle hsession, ck_byte_ptr poperationstate, ck_ulong_ptr puloperationstatelen ); parameters hsession [in] handle of the open session. poperationstate [out] pointer to a byte array of a length sufficient for containing the operation state or null. puloperationstatelen [out] pointer to ck_ulong which receives the total length (in bytes) of the operation state.
description fc_getoperationstate saves the state of the cryptographic operation in a session. this function only works for digest operations for now. therefore, a user may call fc_getoperationstate without logging into the token (to assume the nss user role). return value examples see also fc_setoperationstate, nsc_getoperationstate ...
FC_GetSessionInfo
a user may call fc_getsessioninfo without logging into the token (to assume the nss user role). ...
FC_GetSlotInfo
name fc_getslotinfo - get information about a particular slot in the system. syntax ck_rv fc_getslotinfo( ck_slot_id slotid, ck_slot_info_ptr pinfo ); parameters fc_getslotinfo takes two parameters: slotid [in] pinfo [out] the address of a ck_slot_info structure.
description fc_getslotinfo stores the information about the slot in the ck_slot_info structure that pinfo points to. a user may call fc_getslotinfo without logging into the token (to assume the nss user role). return value ckr_ok slot information was successfully copied. ckr_slot_id_invalid the specified slot number is out of the defined range of values. examples see also nsc_getslotinfo ...
FC_GetSlotList
ck_rv fc_getslotlist( ck_bbool tokenpresent, ck_slot_id_ptr pslotlist, ck_ulong_ptr pulcount ); parameters tokenpresent [in] if true only slots with a token present are included in the list, otherwise all slots are included. pslotlist [out] either null or a pointer to an existing array of ck_slot_id objects. pulcount [out] pointer to a ck_ulong variable which receives the slot count.;
description fc_getslotlist obtains a list of slots in the system. a user may call fc_getslotlist without logging into the token (to assume the nss user role). return value ckr_ok examples see also nsc_getslotlist ...
FC_GetTokenInfo
name fc_gettokeninfo - obtain information about a particular token in the system. syntax ck_rv fc_gettokeninfo(ck_slot_id slotid, ck_token_info_ptr pinfo); parameters fc_gettokeninfo has two parameters: slotid the id of the token's slot pinfo points to a ck_token_info structure
description fc_gettokeninfo returns information about the token in the specified slot. on return, the ck_token_info structure that pinfo points to has the following information: label: the label of the token, assigned during token initialization, padded with spaces to 32 bytes and not null-terminated. manufacturerid: id of the device manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. model: model of the device, "nss 3", padded with spaces to 16 characters ...
FC_InitPIN
name fc_initpin() - initialize the user's pin. syntax ck_rv fc_initpin( ck_session_handle hsession, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters fc_initpin() takes three parameters: hsession[input] session handle. ppin[input] pointer to the pin being set. ulpinlen [input] length of the pin.
description fc_initpin() initializes the normal user's pin. fc_initpin() must be called when the pkcs #11 security officer (so) is logged into the token and the session is read/write, that is, the session must be in the "r/w so functions" state (cks_rw_so_functions). the role of the pkcs #11 so is to initialize a token and to initialize the normal user's pin. in the nss cryptographic module, one uses the empty string password ("") to log in as the pkcs #11 so. the module only allow...
FC_InitToken
specifically, fc_inittoken() initializes or clears the key database, removes the password, and then marks all the user certs in the certificate database as non-user certs. (user certs are the certificates that have their associated private keys in the key database.) a user must be able to call fc_...
FC_Login
name fc_login() - log a user into a token. syntax ck_rv fc_login( ck_session_handle hsession, ck_user_type usertype, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters fc_login() takes four parameters: hsession [in] a session handle usertype [in] the user type (cku_so or cku_user) ppin [in] a pointer that points to the user's pin ulpinlen [in] the length of the pin
description fc_login() logs a user into a token. the security officer (cku_so) only logs in to initialize the normal user's pin. the so pin is the empty string. the nss cryptographic module doesn't allow the so to log in if the normal user's pin is already initialized. return value fc_login() returns the following return codes. ckr_ok: the user logged in successfully. ckr_device_error: the token is in the ...
FC_Logout
name fc_logout - log a user out from a token. syntax ck_rv fc_logout( ck_session_handle hsession ); parameters hsession [in] session handle.
description logs the current user out of a user_functions session. return value examples see also fc_closesession, nsc_logout ...
FC_OpenSession
ck_rv fc_opensession( ck_slot_id slotid, ck_flags flags, ck_void_ptr papplication, ck_notify notify, ck_session_handle_ptr phsession ); parameters fc_opensession has the following parameters: slotid [in] the id of the token's slot. flags [in] papplication notify [in] pointer to a notification callback function. not currently supported. phsession [out] pointer to a session handle.
description fc_opensession opens a session between an application and the token in the slot with the id slotid. the nss cryptographic module currently doesn't call the surrender callback function notify. (see pkcs #11 v2.20 section 11.17.1.) a user may call fc_opensession without logging into the token (to assume the nss user role). return value examples see also fc_closesession, nsc_opensession ...
FC_SeedRandom
name fc_seedrandom() - mix additional seed material into the random number generator. syntax ck_rv fc_seedrandom( ck_session_handle hsession, ck_byte_ptr pseed, ck_ulong usseedlen ); parameters hsession [in] session handle. pseed [in] pointer to the seed material usseedlen [in] length of the seed material in bytes.
description fc_seedrandom() mixes additional seed material into the token's random number generator. note that fc_seedrandom() doesn't provide the initial seed material for the random number generator. the initial seed material is provided by the nss cryptographic module itself. a user may call fc_seedrandom() without logging into the token (to assume the nss user role). return value examples see also nsc_seedrandom ...
FC_SetAttributeValue
name fc_setattributevalue - set the values of attributes of an object. syntax ck_rv fc_setattributevalue( ck_session_handle hsession, ck_object_handle hobject, ck_attribute_ptr ptemplate, ck_ulong uscount ); parameters hsession [in] session handle. hobject [in] object handle. ptemplate [in, out] pointer to template. uscount [in] number of attributes in the template.
description fc_setattributevalue sets the value of one or more attributes of an object. a user must log into the token before setting the attribute values of a secret or private key object. return value examples see also nsc_setattributevalue ...
FC_SetOperationState
onstate [in] pointer to a byte array containing the operation state. uloperationstatelen [in] contains the total length (in bytes) of the operation state. hencryptionkey [in] handle of the encryption or decryption key to be used in in a stored session or zero if no key is needed. hauthenticationkey [in] handle of the authentication key to be used in the stored session or zero if none is needed.
description fc_setoperationstate restores the cryptographic operations state of a session from an array of bytes obtained with fc_getoperationstate. this function only works for digest operations for now. therefore, a user may call fc_setoperationstate without logging into the token (to assume the nss user role). return value examples see also fc_getoperationstate, nsc_setoperationstate ...
FC_SetPIN
the user must log into the token (to assume the nss user role) before calling fc_setpin. return value ckr_ok examples see also nsc_setpin ...
FC_Sign
te_ptr psignature, ck_ulong_ptr pussignaturelen ); parameters hsession [in] session handle. pdata [in] pointer to data block. usdatalen [in] length of the data in bytes. psignature [out] pointer to location where recovered data is to be stored. pussignaturelen [in, out] pointer to the maximum size of the output buffer, replaced by the length of the signature if the operation is successful.
description fc_sign signs a message in a single operation according to the attributes of the previous call to fc_signinit. a user must log into the token (to assume the nss user role) before calling fc_sign. return value examples see also fc_signinit, nsc_sign ...
FC_SignEncryptUpdate
ppart, ck_ulong ulpartlen, ck_byte_ptr pencryptedpart, ck_ulong_ptr pulencryptedpartlen ); parameters hsession [in] session handle. ppart [in] pointer to the data part. ulpartlen [in] length of data in bytes. pencryptedpart [in] pointer to the location which receives the signed and encrypted data part or null. pulencryptedpartlen [in] pointer to the length of the encrypted part buffer.
description fc_signencryptupdate continues a multi-part signature and encryption operation. after calling both fc_signinit and fc_encryptinit to set up the operations this function may be called multiple times. the operation is finished by calls to fc_signfinal and fc_encryptfinal. a user must log into the token (to assume the nss user role) before calling fc_signencryptupdate. return value examples s...
FC_SignFinal
name fc_signfinal - finish a multi-part signing operation. syntax ck_rv fc_signfinal( ck_session_handle hsession, ck_byte_ptr psignature, ck_ulong_ptr pussignaturelen ); parameters hsession [in] session handle. psignature [out] pointer to the buffer which will receive the digest or null. pussignaturelen [in, out] pointer to location containing the maximum buffer size.
description fc_signfinal finishes a multi-part signing operation by returning the complete signature and clearing the operation context. if psignature is null the length of the signature is returned and fc_signfinal may be called again with psignature set to retrieve the signature. a user must log into the token (to assume the nss user role) before calling fc_signfinal. return value examples see also f...
FC_SignInit
name fc_signinit - initialize a signing operation. syntax ck_rv fc_signinit( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the subsequent signing operation. hkey [in] handle of the key to be used .
description fc_signinit initializes a signature operation. a user must log into the token (to assume the nss user role) before calling fc_signinit. return value examples see also nsc_signinit fc_sign fc_signupdate fc_signfinal ...
FC_SignRecover
ck_byte_ptr psignature, ck_ulong_ptr pussignaturelen ); parameters hsession [in] session handle. pdata [in] mechanism to be used for the signing operation. usdatalen [in] handle of the key to be usedn. psignature [out] pointer to the buffer or null. pussignaturelen [in, out] pointer to the size of the output buffer, replaced by the length of the signature if the operation is successful.
description fc_signrecover signs data in a single operation where the (digest) data can be recovered from the signature. if psignature is null only the length of the signature is returned in *pussignaturelen. a user must log into the token (to assume the nss user role) before calling fc_signrecover. return value examples see also nsc_signrecover ...
FC_SignRecoverInit
name fc_signrecoverinit - initialize a sign recover operation. syntax ck_rv fc_signrecoverinit( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the signing operation. hkey [in] handle of the key to be used.
description fc_signrecoverinit initializes a initializes a signature operation where the (digest) data can be recovered from the signature. a user must log into the token (to assume the nss user role) before calling fc_signrecoverinit. return value examples see also nsc_signrecoverinit ...
FC_SignUpdate
name fc_signupdate - process the next block of a multi-part signing operation. syntax ck_rv fc_signupdate( ck_session_handle hsession, ck_byte_ptr ppart, ck_ulong uspartlen ); parameters hsession [in] session handle. ppart [in] pointer to the next block of the data to be signed. uspartlen [in] length of data block in bytes.
description fc_signupdate starts or continues a multi-part signature operation. one or more blocks may be part of the signature. the signature for the entire message is returned by a call to fc_signfinal. a user must log into the token (to assume the nss user role) before calling fc_signupdate. return value examples see also fc_signinit, fc_signfinal, nsc_signupdate ...
FC_UnwrapKey
ointer to the mechanism to use. hunwrappingkey [in] handle of the ket to use for unwrapping. pwrappedkey [in] pointer to the wrapped key. uswrappedkeylen [in] length of the wrapped key. ptemplate [in] pointer to the list of attributes for the unwrapped key. usattributecount [in] number of attributes in the template. phkey [out] pointer to the location to receive the handle of the unwrapped key.
description fc_unwrapkey unwraps (decrypts) a key and creates a new key opbject. if pwrappedkey is null the length of the wrapped key is returned in puswrappedkeylen and fc_unwrapkey may be called again with pwrappedkey set to retrieve the wrapped key. a user must log into the token (to assume the nss user role) before calling fc_unwrapkey. return value examples see also nsc_unwrapkey ...
FC_Verify
- sign a block of data. syntax ck_rv fc_verify( ck_session_handle hsession, ck_byte_ptr pdata, ck_ulong usdatalen, ck_byte_ptr psignature, ck_ulong ussignaturelen ); parameters hsession [in] session handle. pdata [in] pointer to data block. usdatalen [in] length of the data in bytes. psignature [in] pointer to the signature. ussignaturelen [in] length of the signature in bytes.
description fc_verify verifies a signature in a single-part operation, where the signature is an appendix to the data. a user must log into the token (to assume the nss user role) before calling fc_verify. return value ckr_ok is returned on success. ckr_signature_invalid is returned for signature mismatch. examples see also fc_verifyinit, nsc_verify ...
FC_VerifyFinal
name fc_verifyfinal - finish a multi-part verify operation. syntax ck_rv fc_verifyfinal( ck_session_handle hsession, ck_byte_ptr psignature, ck_ulong ussignaturelen ); parameters hsession [in] session handle. psignature [in] pointer to the buffer which will receive the digest or null. ussignaturelen [in] length of the signature in bytes.
description fc_verifyfinal finishes a multi-part signature verification operation. a user must log into the token (to assume the nss user role) before calling fc_verifyfinal. return value examples see also fc_verifyupdate, nsc_verifyfinal ...
FC_VerifyInit
name fc_verifyinit - initialize a verification operation. syntax ck_rv fc_verifyinit( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the verification operation. hkey [in] handle of the key to be used.
description fc_verifyinit initializes a verification operation where the signature is an appendix to the data. a user must log into the token (to assume the nss user role) before calling fc_verifyinit. return value examples see also nsc_verifyinit ...
FC_VerifyRecover
naturelen, ck_byte_ptr pdata, ck_ulong_ptr pusdatalen ); parameters hsession [in] session handle. psignature [in] mechanism to be used for the signing operation. ussignaturelen [in] handle of the key to be usedn. pdata [out] pointer to the buffer or null. pusdatalen [in, out] pointer to the size of the output buffer, replaced by the length of the signature if the operation is successful.
description fc_verifyrecover verifies data in a single operation where the (digest) data can be recovered from the signature. if psignature is null only the length of the signature is returned in *pussignaturelen. a user must log into the token (to assume the nss user role) before calling fc_verifyrecover. return value examples see also nsc_verifyrecover ...
FC_VerifyRecoverInit
name fc_verifyrecoverinit - initialize a verification operation where data is recoverable. syntax ck_rv fc_verifyrecoverinit( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for verification. hkey [in] handle of the key to be used.
description fc_verifyrecoverinit initializes a signature verification operation where the (digest) data can be recovered from the signature. a user must log into the token (to assume the nss user role) before calling fc_verifyrecoverinit. return value examples see also nsc_verifyrecoverinit ...
FC_VerifyUpdate
name fc_verifyupdate - process the next block of a multi-part verify operation. syntax ck_rv fc_verifyupdate( ck_session_handle hsession, ck_byte_ptr ppart, ck_ulong uspartlen ); parameters hsession [in] session handle. ppart [in] pointer to the next block of the data to be verified. uspartlen [in] length of data block in bytes.
description fc_verifyupdate starts or continues a multi-part signature verification operation where the signature is an appendix to the data. one or more blocks may be part of the signature. the result for the entire message is returned by a call to fc_verifyfinal. a user must log into the token (to assume the nss user role) before calling fc_verifyupdate. return value examples see also fc_verifyfinal, nsc_verifyupdate ...
FC_WaitForSlotEvent
name fc_waitforslotevent - waits for a slot event, such as token insertion or token removal, to occur. syntax ck_rv fc_waitforslotevent(ck_flags flags, ck_slot_id_ptr pslot ck_void_ptr preserved); parameters fc_waitforslotevent takes three parameters: [input] flags [input] pslot. preserved.
description this function is not supported by the nss cryptographic module. return value fc_waitforslotevent always returns ckr_function_not_supported. examples see also fc_waitforslotevent ...
FC_WrapKey
rappedkey, ck_ulong_ptr puswrappedkeylen ); parameters hsession [in] session handle. pmechanism [in] pointer to the mechanism to use. hwrappingkey [in] pointer to the public key template. hkey [in] number of attributes in the public key template. pwrappedkey [out] pointer to the location to receive the wrapped key or null. puswrappedkeylen [in, out] pointer to length of wrapped key buffer.
description fc_wrapkey wraps (encrypts) a key. if pwrappedkey is null the length of the wrapped key is returned in puswrappedkeylen and fc_wrapkey may be called again with pwrappedkey set to retrieve the wrapped key. a user must log into the token (to assume the nss user role) before calling fc_wrapkey. return value examples see also nsc_wrapkey ...
NSC_InitToken
specifically, nsc_inittoken() initializes or clears the key database, removes the password, and then marks all the user certs in the certificate database as non-user certs. (user certs are the certificates that have their associated private keys in the key database.) note: the so password shoul...
NSC_Login
name nsc_login() - log a user into a token. syntax ck_rv nsc_login( ck_session_handle hsession, ck_user_type usertype, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters nsc_login() takes four parameters: hsession [in] a session handle usertype [in] the user type (cku_so or cku_user) ppin [in] a pointer that points to the user's pin ulpinlen [in] the length of the pin
description nsc_login() logs a user into a token. the security officer (cku_so) only logs in to initialize the normal user's pin. the so pin is the empty string. the nss cryptographic module doesn't allow the so to log in if the normal user's pin is already initialized. return value nsc_login() returns the following return codes. ckr_ok: the user logged in successfully. ckr_device_error: the token is i...
NSS_Initialize
dule databases live. to-do: document the "sql:" prefix. certprefix [in] prefix added to the beginning of the certificate database, for example, "https-server1-". keyprefix [in] prefix added to the beginning of the key database, for example, "https-server1-". secmodname [in] name of the security module database, usually "secmod.db". flags [in] bit flags that specify how nss should be initialized.
description nss_initialize initializes nss. it is more flexible than nss_init, nss_initreadwrite, and nss_nodb_init. if any of those simpler nss initialization functions suffices for your needs, call that instead. the flags parameter is a bitwise or of the following flags: nss_init_readonly - open the databases read only. nss_init_nocertdb - don't open the cert db and key db's, just initialize the volatile ...
NSS functions
hmid mxr 3.2 and later secoid_copyalgorithmid mxr 3.2 and later secoid_destroyalgorithmid mxr 3.2 and later secoid_findoid mxr 3.2 and later secoid_findoidbytag mxr 3.2 and later secoid_findoidtag mxr 3.2 and later secoid_findoidtag
description mxr 3.2 and later secoid_getalgorithmtag mxr 3.2 and later secoid_setalgorithmid mxr 3.2 and later sgn_begin mxr 3.2 and later sgn_comparedigestinfo mxr 3.2 and later sgn_copydigestinfo mxr 3.2 and later sgn_createdigestinfo ...
NSS tools : certutil
it can specifically list, generate, modify, or delete certificates, create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key database. ...
NSS tools : cmsutil
to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each command takes one option. each option may take zero or more arguments. ...
NSS tools : crlutil
name crlutil — list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. synopsis crlutil [options] [[arguments]] status this documentation is still work in progress. please contribute to the initial review in mozilla nss bug 836477[1]
description the certificate revocation list (crl) management tool, crlutil, is a command-line utility that can list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil ...
NSS tools : pk12util
nss tools : pk12util name pk12util — export and import keys and certificate to or from a pkcs #12 file and the nss database synopsis pk12util [-i p12file|-l p12file|-o p12file] [-d [sql:]directory] [-h tokenname] [-p dbprefix] [-r] [-v] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword]
description the pkcs #12 utility, pk12util, enables sharing certificates among any server that supports pkcs#12. the tool can import certificates and keys from pkcs#12 files into security databases, export certificates, and list certificates and keys. options and arguments options -i p12file import keys and certificates from a pkcs#12 file into a security database. -l p12file list the keys and certificates in pkcs#12 file. -o p12file export keys and certifica...
NSS tools : ssltab
it watches tcp connections and displays the data going by. if a connection is ssl, the data display includes interpreted ssl records and handshaking options -v print a version string for the tool. -h turn on hex/ascii printing. instead of outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ascii characters. the two parts are separated by a vertical bar. ...
NSS tools : ssltap
it watches tcp connections and displays the data going by. if a connection is ssl, the data display includes interpreted ssl records and handshaking options -v print a version string for the tool. -h turn on hex/ascii printing. instead of outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ascii characters. the two parts are separated by a vertical bar. ...
NSS tools : vfychain
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases. ...
NSS tools : vfyserv
the nss site relates directly to nss code changes and releases. mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape, red hat, and sun. authors: elio maldonado <emaldona@redhat.com>, deon lackey <dlackey@redhat.com>. copyright (c) 2010, red hat, inc. licensed under the gnu public license version 2. references visible links 1. ...
NSS Tools
yzing and repairing certificate databases (dbck). migrate tools from secutil.h interface to pkcs #11 interface. eliminate redundant functionality in tools. many tools implement private versions of pkcs11init(), opencertdb(), etc. eliminate use of getopt() and replace with nspr calls to get command options (to eliminate platform dependencies with getopt()). tools information tool
description links certutil 2.0 manage certificate and key databases (cert7.db and key3.db). source, documentation, tasks/plans cmsutil 1.0 performs basic cms operations such as encrypting, decrypting, and signing messages. source, documentation crlutil manage certificate revocation lists (crls). source, documentation, dbck 1.0 analyze and repair ...
Utility functions
hmid mxr 3.2 and later secoid_copyalgorithmid mxr 3.2 and later secoid_destroyalgorithmid mxr 3.2 and later secoid_findoid mxr 3.2 and later secoid_findoidbytag mxr 3.2 and later secoid_findoidtag mxr 3.2 and later secoid_findoidtag
description mxr 3.2 and later secoid_getalgorithmtag mxr 3.2 and later secoid_setalgorithmid mxr 3.2 and later sgn_begin mxr 3.2 and later sgn_comparedigestinfo mxr 3.2 and later sgn_copydigestinfo mxr 3.2 and later sgn_createdigestinfo ...
NSS_3.12.3_release_notes.html
or through the use of environment variables. here is a table of the new environment variables introduced in nss 3.12.3 and information about how they affect these new behaviors. the information in this table is excerpted from https://developer.mozilla.org/en/nss_reference/nss_environment_variables environment variable value type
description nsrandcount integer (byte count) sets the maximum number of bytes to read from the file named in the environment variable nsrandfile (see below). makes nsrandfile usable with /dev/urandom. nss_allow_weak_signature_alg boolean (any non-empty value to enable) enables the use of md...
NSS Tools modutil
nformation about the specified module: modutil -list "netscape internal pkcs #11 module" -dbdir c:\databases the security module database tool displays information similar to this: using database directory c:\databases...--------------------------------------------------------name: netscape internal pkcs #11 modulelibrary file: **internal only module**manufacturer: netscape communications corp
description: communicator internal crypto svcpkcs #11 version 2.0library version: 4.0cipher enable flags: nonedefault mechanism flags: rsa:dsa:rc2:rc4:des:sha1:md5:md2slot: communicator internal cryptographic services version 4.0manufacturer: netscape communications corp type: softwareversion number: 4.1firmware version: 0.0status: enabledtoken name: communicator generic crypto svcstoken manufacturer: netsca...
NSS Tools sslstrength
the letter in the first column of the output is used to identify the cipher preferences in the ciphers= command. the second form attempts to connect to the named ssl host. ...
NSS Tools ssltap
using the ssl debugging tool (ssltap) newsgroup: mozilla.dev.tech.crypto the ssl debugging tool is an ssl-aware command-line proxy. it watches tcp connections and displays the data going by. if a connection is ssl, the data display includes interpreted ssl records and handshaking. availability this tool is known to build on solaris 2.5.1 (sunos 5.5.1) and windows nt 4.0.
description the ssltap command opens a socket on a rendezvous port and waits for an incoming connection from the client side. once this connection arrives, the tool makes another connection to the specified host name and port on the server side. it passes any data sent by the client to the server and vice versa. the tool also displays the data to the shell window from which it was called. it can do this for pla...
certutil
it can also list, generate, modify, or delete certificates within the database, create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key database. ...
NSS tools : cmsutil
to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each command takes one option. ...
NSS tools : crlutil
name crlutil — list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. synopsis crlutil [options] arguments
description the certificate revocation list (crl) management tool, crlutil, is a command-line utility that can list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. this document discusses certifi...
NSS tools : pk12util
the tool can import certificates and keys from pkcs#12 files into security databases, export certificates, and list certificates and keys. options and arguments options -i p12file import keys and certificates from a pkcs#12 file into a security database...
NSS tools : signver
the signature verification tool can also display the contents of the signed object. options -a displays all of the information in the pkcs#7 signature. ...
NSS tools : ssltap
it watches tcp connections and displays the data going by. if a connection is ssl, the data display includes interpreted ssl records and handshaking options -v print a version string for the tool. -h turn on hex/ascii printing. instead of outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ascii characters. ...
NSS tools : vfychain
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. ...
Pork
link below for a more up-to-date toolchain. pork is based on the elsa (and oink) tool chain, and the mcpp preprocessor. as of october 2009 oink incorporates the pork functionality into its standard distribution; look for files and tests having the prefix "xform". documentation installing pork download, installation and dependency info for pork pork tools
description of rewriting tools pork tool development in progress page... old pork page pork details that haven't been moved to mdc renaming with pork sample pork application todos pork 1.0 release tracking bug pork releases download pork here community view pork forums... mailing list newsgroup rss feed #static on ir...
Rhino and BSF
open source as a project at the apache software foundation. it provides a framework for using a number of scripting languages with java. rhino is one of the supported languages. this framework has been embedded in a number of open source projects, including the xsl processor xalan and the xml/java build tool ant. see xalan-java extensions for more information on adding javascript to xsl and the
description of the optional script task in the apache ant manual for using scripting in ant build files. using bsf with rhino now that the apache jakarta bean scripting framework (bsf), version 2.4.0, has been officially released, you can use rhino easily with bsf. see http://commons.apache.org/proper/commons-bsf/index.html. ...
Rhino documentation
nto your application. api javadoc reference (link broken? try this at jarvana.) an annotated outline of the programming interface to rhino (tip only). scopes and contexts describes how to use scopes and contexts for the best performance and flexibility, with an eye toward multithreaded environments. serialization how to serialize javascript objects and functions in rhino. runtime a brief
description of the javascript runtime. small footprint hints for those interested in small-footprint embeddings. examples a set of examples showing how to control the javascript engine and build javascript host objects. using rhino with bean scripting framework (bsf) how to use rhino with apps that support bsf (bean scripting framework) from the apache jakarta project. external references scriptin...
SpiderMonkey Build Documentation
and other memory-related problems. see js_setgczeal() for details. for a list of other available build options, type (assuming the current working directory is one of the above-created build directories): /bin/sh ../configure.in --help generating a compilation database some tools (like ides, static analyzers and refactoring tools) consume a file called compile_commands.json which contains a
description of all the pieces required to build a piece of software so that tools don't have to also understand a build system. to generate a compile_commands.json with the spidermonkey configure script, enable the compiledb backend, like this: /bin/sh ../configure.in <options> --enable-build-backends=compiledb,recursivemake (recursivemake is there as you'd likely also want to be able to build!) windows...
Bytecodes
this and the callee / return value. there is always a "top of stack" (tos) that corresponds to the latest value pushed onto the expression stack. all bytecodes implicitly operate in terms of this location. bytecode listing all opcodes are annotated with a [-popcount, +pushcount] to represent the overall stack-effects their execution. bytecode listing was moved to spidermonkey internals: bytecode
descriptions page. ...
SpiderMonkey Internals
f tag and 47 bits of payload. only jit code really depends on the layout--everything else in the engine interacts with values through functions like val.isdouble(). most parts of the jit also avoid depending directly on the layout: the files punboxassembler.h and nunboxassembler.h are used to generate native code that depends on the value layout. objects consist of a possibly shared structural
description, called the map or scope; and unshared property values in a vector, called the slots. each property has an id, either a nonnegative integer or an atom (unique string), with the same tagged-pointer encoding as a jsval. the atom manager consists of a hash table associating strings uniquely with scanner/parser information such as keyword type, index in script or function literal pool, etc. atoms pl...
Introduction to the JavaScript shell
oad(filename1 [filename]) loads the javascript files with the specified names. note: for loading non-javascript files, use read(). options([option ...]) lets you set or get options. if you specified options on the command line, the results of calling options will indicate which options you requested. you can also pass in new options to set. the available options are: option name
description strict strict mode is enabled. werror warnings should be treated as errors. atline when atline is enabled, comments of the form //@line num set the number of the following line to num. pc2line(function, [pc]) returns the line number of the javascript code that corresponds to the first line of the specified function. if you specify a program counter offs...
BOOLEAN_TO_JSVAL
ure is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. cast a c integer to a boolean js::value without any type checking or error handling. please use js::booleanvalue/js::truevalue/js::falsevalue instead in spidermonkey 45 or later. syntax jsval boolean_to_jsval(bool b); name type
description b bool c integer value to be converted to a boolean jsval.
description boolean_to_jsval converts a bool argument, b, to a boolean jsval. if b is false, the result is jsval_false. if b is true, the result is jsval_true. see also mxr id search for boolean_to_jsval js::booleanvalue bug 1177892 -- removed ...
DOUBLE_TO_JSVAL
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. casts a pointer to a gc-allocated jsdouble to type jsval. please use js::doublevalue instead in spidermonkey 45 or later. syntax jsval double_to_jsval(double d); name type
description d double c double to convert to a jsval.
description double_to_jsval is the inverse of js::tonumber. to convert a c float, double to type js::value, use js_numbervalue instead. see also mxr id search for double_to_jsval js::tonumber js_numbervalue js::doublevalue bug 1177892 -- removed ...
INT_FITS_IN_JSVAL
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determines if a specified c integer is safe to pass to int_to_jsval. syntax #define int_fits_in_jsval(i) /* ... */ name type
description i jsint the c integer value to check.
description determines if a specified c integer value, i, lies within the range allowed for integer jsvals. if so, int_fits_in_jsval returns true, and i can be cast to jsval by calling int_to_jsval(i). otherwise, int_fits_in_jsval returns false. in this case, the application can still convert i to a jsval using js_newnumbervalue. warning: the type of the argument i must be jsint, but the c/c++ co...
INT_TO_JSVAL
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. converts a specified integer value to a js integer value. please use js::int32value instead in spidermonkey 45 or later. syntax jsval int_to_jsval(int32_t i); name type
description i any integer type c integer to convert to a jsval.
description int_to_jsval converts a c integer, i, to a jsval. before spidermonkey 1.8.5, not all integers can be stored in a jsval; use int_fits_in_jsval to test. starting in spidermonkey 1.8.5, jsval can store a full 32-bit integer, so this check isn't needed any longer for 32-bit integers.") }} if i does not fit into a jsval (see int_fits_in...
JS::AutoSaveExceptionState
this article covers features introduced in spidermonkey 31 save and later restore the current exception state of a given jscontext. syntax js::autosaveexceptionstate(jscontext *cx); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description js::autosaveexceptionstate saves and later restores the current exception state of a given jscontext. this is useful for implementing behavior in c++ that's like try/catch or try/finally in js. example // typical usage: bool ok = js::evaluate(cx, ...); autosaveexceptionstate savedexc(cx); ... cleanup that might re-enter js ... return ok; see also mxr id s...
JS::BooleanValue
this article covers features introduced in spidermonkey 24 convert a c boolean of type bool to a js::value. syntax js::value js::booleanvalue(bool boo) name type
description boo bool c bool to convert.
description js::booleanvalue converts a c boolean of type bool to js::value, the type of javascript values. see also mxr id search for js::booleanvalue js::value js::truevalue js::falsevalue ...
JS::CloneFunctionObject
this article covers features introduced in spidermonkey 38 create a new function object from an existing jsfunction. syntax jsobject * js::clonefunctionobject(jscontext *cx, js::handleobject funobj); jsobject * js::clonefunctionobject(jscontext *cx, js::handleobject funobj, js::autoobjectvector &scopechain); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. funobj js::handleobject the function to clone. scopechain js::autoobjectvector the new function's scope chain.
description js::clonefunctionobject creates a new function object from funobj. the ne...
JS::CurrentGlobalOrNull
this article covers features introduced in spidermonkey 31 return the global object for the active function on the context. syntax jsobject * js::currentglobalornull(jscontext *cx); name type
description cx jscontext * the context for which to return the global object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description js::currentglobalornull() returns the global object for whatever function is currently running on the context. in other words, it returns the global object on the current scope chain. if there is no javascript running on the context, this returns the context's global, i.e., js_getglobalobject(cx). note that js_getglobalobject() and context globals are becoming obsolete.
JS::DoubleNaNValue
this article covers features introduced in spidermonkey 24 create a not-a-number (nan) floating-point number as a value of type js::value. syntax js::value js::doublenanvalue()
description js::doublenanvalue returns a value of type js::value that represents an ieee floating-point quiet not-a-number (nan). the result is an floating-point js::value. see also mxr id search for js::doublenanvalue js::value js_getnanvalue ...
JS::DoubleValue
this article covers features introduced in spidermonkey 24 convert a c floating-point number of type double to a js::value. syntax js::value js::doublevalue(double dbl) name type
description dbl double c double to convert.
description js::doublevalue converts a c floating-point number of type double to js::value, the type of javascript values. the result is an floating-point js::value. see also mxr id search for js::doublevalue js::value js::int32value js::float32value js::numbervalue js_numbervalue ...
JS::FalseValue
this article covers features introduced in spidermonkey 24 create a js::value that represents the javascript value false. syntax js::value js::falsevalue()
description js::falsevalue creates a js::value that represents the javascript value false. see also mxr id search for js::falsevalue js::value js::booleanvalue js::truevalue ...
JS::Float32Value
this article covers features introduced in spidermonkey 24 convert a c floating-point number of type float to a js::value. syntax js::value js::float32value(float f) name type
description f float c float to convert.
description js::float32value converts a c floating-point number of type float to js::value, the type of javascript values. the result is an floating-point js::value. see also mxr id search for js::float32value js::value js::int32value js::doublevalue js::numbervalue js_numbervalue ...
JS::GetDeflatedUTF8StringLength
this article covers features introduced in spidermonkey 38 returns the length of the char buffer required to encode given string as utf8. syntax size_t getdeflatedutf8stringlength(jsflatstring* s); name type
description s jsflatstring * the pointer to the string to calculate the length.
description js::getdeflatedutf8stringlength returns the length of the char buffer required to encode s as utf8. the returned length does not include the null-terminator. see also js::deflatestringtoutf8buffer bug 1034627 ...
JS::GetFirstArgumentAsTypeHint
convert first argument of @@toprimitive method to jstype. syntax bool js::getfirstargumentastypehint(jscontext* cx, callargs args, jstype *result); name type
description cx jscontext * the context in which to define functions. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. fs callargs the arguments of the function call. behavior jstype * receives the result of conversion. see below.
description js::getfirstargumentastypehint converts first argument of @@toprimitive method to jstype. if args.get(0) is one of the strings "string", "number", or "default", set *result to jstype_string, jstype_number, or jstype_void accordingly and return true. otherwise, return false with a typeer...
JS::Handle
this article covers features introduced in spidermonkey 17 reference to a t that has been rooted elsewhere. this is most useful as a parameter type, which guarantees that the t value is properly rooted. syntax bool somefunction(jscontext *cx, js::handle<t> var) { ... } methods here, ptr represents the private member of js::handle<t>, typed with t. method
description const t *address() const returns a pointer to ptr. const t &get() const returns ptr. operator const t&() const t operator->() const bool operator!=(const t &other) const compares ptr and other. bool operator==(const t &other) const
description js::handle<t> is a const reference to a js::rooted<t>. functions which take gc things or valu...
JS::IdentifyStandardInstance
determine if the given object is an instance/prototype/constructor for a standard class. syntax jsprotokey js::identifystandardinstance(jsobject *obj); jsprotokey js::identifystandardprototype(jsobject *obj); jsprotokey js::identifystandardinstanceorprototype(jsobject *obj); jsprotokey js::identifystandardconstructor(jsobject *obj); // added in spidermonkey 38 name type
description obj jsobject * pointer to the instance/prototype/constructor object to determine.
description js::identifystandardinstance determines if the given object is an instance for a standard class. if so, return the associated jsprotokey. if not, return jsproto_null. js::identifystandardprototype determines if the given object is a prototype for a standard class. if so, return th...
JS::Int32Value
this article covers features introduced in spidermonkey 24 convert a c signed 32-bit integer of type int32_t to a js::value. syntax js::value js::int32value(int32_t i32) name type
description i32 int32_t c integer to convert.
description js::int32value converts a c signed 32-bit integer of type int32_t to js::value, the type of javascript values. the result is an integer js::value. see also mxr id search for js::int32value js::value js::float32value js::doublevalue js::numbervalue js_numbervalue ...
JS::IsCallable
this article covers features introduced in spidermonkey 38 return whether the given function object is callable/a valid constructor. syntax bool js::iscallable(jsobject *obj); bool js::isconstructor(jsobject *obj); name type
description obj jsobject * pointer to the function.
description js::iscallable returns whether the given function object is callable. js::isconstructor returns whether the given function object is a valid constructor. see also mxr id search for js::iscallable mxr id search for js::isconstructor js_isconstructor js_isnativefunction bug 1065811 ...
JS::MutableHandle
this article covers features introduced in spidermonkey 17 reference to a t that has been rooted elsewhere. the underlying storage can be changed. this is useful for outparams. syntax bool somefunction(jscontext *cx, js::mutablehandle<t> outparam) { ... } methods here, ptr represents the private member of js::mutablehandle<t>, typed with t *. method
description const t &get() const returns *ptr. operator const t&() const t operator->() const t *address() returns ptr. void set(t v) sets the value of *ptr to v.
description js::mutablehandle<t> is a non-const reference to js::rooted<t>. it is used in the same way as js::handle<t> and includes a |set(const t &v)| method to allow updating the value of the...
JS::NewFunctionFromSpec
create a new function based on the given jsfunctionspec. syntax jsfunction* js::newfunctionfromspec(jscontext* cx, const jsfunctionspec* fs, handleid id); name type
description cx jscontext * the context in which to define functions. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. fs const jsfunctionspec * a pointer to function specification. behavior handleid the result of a successful call to propertyspecnametopermanentid(cx, fs->name, &id).
description js::newfunctionfromspec creates a new function based on the given jsfunctionspec, *fs. id is the result of a successful call to propertyspecnametopermanentid(cx, fs->name, &id). unlike js_definefunctions, this does not treat fs...
JS::NullHandleValue
this article covers features introduced in spidermonkey 24 the js::value that represents the javascript value null. syntax const js::handlevalue js::nullhandlevalue;
description js::nullhandlevalue is a js::handlevalue constant that represents the javascript value null. see also mxr id search for js::nullhandlevalue js::undefinedhandlevalue js::truehandlevalue js::falsehandlevalue bug 865969 ...
JS::NullValue
this article covers features introduced in spidermonkey 24 create a js::value that represents the javascript value null. syntax js::value js::nullvalue();
description js::nullvalue creates a js::value that represents the javascript value null. see also mxr id search for js::nullvalue js::value js::nullhandlevalue ...
JS::NumberValue
convert a c integer or floating-point value to a js::value. syntax js::value js::numbervalue(float f) js::value js::numbervalue(double dbl) js::value js::numbervalue(int8_t i) js::value js::numbervalue(uint8_t i) js::value js::numbervalue(int16_t i) js::value js::numbervalue(uint16_t i) js::value js::numbervalue(int32_t i) js::value js::numbervalue(uint32_t i) name type
description f or dbl or i any c integer or floating-point value to convert.
description js::numbervalue converts a c integer or floating-point value to js::value, the type of javascript values. see also mxr id search for js::numbervalue js::value js::int32value js::float32value js::doublevalue js_numbervalue ...
JS::ObjectOrNullValue
this article covers features introduced in spidermonkey 24 convert a jsobject or null pointer to a js::value. syntax js::value js::objectornullvalue(jsobject* obj) name type
description str jsobject* a pointer to a jsobject or null to convert.
description js::objectvalue converts a given jsobject to js::value. if the pointer is null, it returns javascript null. the conversion always succeeds. see also mxr id search for js::objectornullvalue js::value js::objectvalue ...
JS::ObjectValue
this article covers features introduced in spidermonkey 24 convert a jsobject to a js::value. syntax js::value js::objectvalue(jsobject& obj) name type
description str jsobject& a reference to a jsobject to convert.
description js::objectvalue converts a given jsobject to js::value. the conversion always succeeds. see also mxr id search for js::objectvalue js::value js::objectornullvalue ...
JS::PropertySpecNameEqualsId
this article covers features introduced in spidermonkey 38 determine if the given jspropertyspec::name or jsfunctionspec::name value equals the given jsid. syntax bool js::propertyspecnameequalsid(const char *name, js::handleid id); name type
description name const char * jspropertyspec::name or jsfunctionspec::name. id js::handleid a jsid to compare with.
description js::propertyspecnameequalsid determines if the given jspropertyspec::name or jsfunctionspec::name value equals the given jsid, and returns true if so. see also mxr id search for js::propertyspecnameequalsid js::propertyspecnameissymbol js::propertyspecnametopermanentid jspropertyspec jsfunctionspec bug 1082672 ...
JS::PropertySpecNameIsSymbol
this article covers features introduced in spidermonkey 38 determine if the given jspropertyspec::name or jsfunctionspec::name value is actually a symbol code and not a string. syntax bool js::propertyspecnameissymbol(const char *name); name type
description name const char * the pointer of the name, actually the uintptr_t type, and not a pointer to any string.
description js::propertyspecnameissymbol determines if the given jspropertyspec::name or jsfunctionspec::name value is actually a symbol code and not a string, and returns true if so. see also mxr id search for js::propertyspecnameissymbol js::propertyspecnameequalsid js::propertyspecnametopermanentid jspropertyspec jsfunctionspec bug 1082672 ...
JS::PropertySpecNameToPermanentId
this article covers features introduced in spidermonkey 38 create a jsid that does not need to be marked for gc. syntax bool js::propertyspecnametopermanentid(jscontext *cx, const char *name, jsid *idp); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. name const char * jspropertyspec::name or jsfunctionspec::name. idp jsid * out parameter. receives the created id.
description js::propertyspecnametopermanentid creates a jsid that does not need to be marked for gc from jspropertyspec::name or jsfunctionspec::name. the resulting jsid, on success, is either an interned string ...
JS::ProtoKeyToId
this article covers features introduced in spidermonkey 38 convert a jsprotokey to js id. syntax void js::protokeytoid(jscontext *cx, jsprotokey key, js::mutablehandleid idp); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. key jsprotokey the prototype key to convert. vp js::mutablehandleid out parameter. *idp receives the converted id.
description js::protokeytoid converts a specified js prototype key key, to a js id. js::protokeytoid stores a jsid to *idp. see also mxr id search for js::protokeytoid js_idtoprotokey bug 987669 ...
JS::SourceBufferHolder
this article covers features introduced in spidermonkey 31 container class for passing in script source buffers to the js engine. constructor enum ownership { noownership, giveownership }; js::sourcebufferholder(const char16_t *data, size_t datalength, ownership ownership); name type
description data const char16_t * source buffer containing the script to compile. datalength size_t the length of data, in characters. ownership ownership see
description.
description js::sourcebufferholder is the container class for passing in script source buffers to the js engine. this not only groups the buffer and length values, it also provides a way to optionally pass ownership of the buffer to the ...
JS::StringValue
this article covers features introduced in spidermonkey 24 convert a jsstring to a js::value. syntax js::value js::stringvalue(jsstring* str) name type
description str jsstring* a pointer to a jsstring to convert.
description js::stringvalue converts a given jsstring to js::value. the conversion always succeeds. see also mxr id search for js::stringvalue js::value ...
JS::SymbolValue
this article covers features introduced in spidermonkey 38 convert a js::symbol to a js::value. syntax js::value js::symbolvalue(js::symbol* sym) name type
description sym js::symbol* a pointer to a js::symbol to convert.
description js::symbolvalue converts a given js::symbol to js::value. the conversion always succeeds. see also mxr id search for js::symbolvalue js::value bug 645416) ...
JS::ToBoolean
this article covers features introduced in spidermonkey 17 convert any javascript value to a boolean. syntax bool js::toboolean(js::handlevalue v) name type
description v js::handlevalue the value to convert.
description js::toboolean converts a javascript value to a boolean. it implements the toboolean operation described in ecma 262 §7.1.2.this function can not fail and the return value is always the boolean conversion of the argument. mxr id search for js::toboolean bug 749536 ...
JS::ToInt32
this article covers features introduced in spidermonkey 17 convert any javascript value to a signed 32bit integer. syntax bool js::toint32(jscontext *cx, js::handlevalue v, int32_t *out); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. out int32_t * out parameter. on success, *out receives the converted floating-point value.
description js::toint32 converts a javascript value to a signed 32bit integer. it implements the toint32 operator described in ecma 262-3 §9.5. on success, js::toint32 stores the converted value in *out and returns true. on erro...
JS::ToInt64
this article covers features introduced in spidermonkey 17 convert any javascript value to a signed 64bit integer. syntax bool js::toint64(jscontext *cx, js::handlevalue v, int64_t *out); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. out int64_t * out parameter. on success, *out receives the converted floating-point value.
description js::toint64 converts a javascript value to a signed 64bit integer. on success, js::toint64 stores the converted value in *out and returns true. on error or exception, it returns false, and the value left in *out is un...
JS::ToNumber
this article covers features introduced in spidermonkey 17 convert any javascript value to a double. syntax bool js::tonumber(jscontext *cx, js::handlevalue v, double *out); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. out double * out parameter. on success, *out receives the converted floating-point value.
description js::tonumber converts a javascript value to a number. it implements the tonumber operator described in ecma 262-3 §9.3. on success, js::tonumber stores the converted value in *out and returns true. on error or exception, it returns...
JS::ToString
this article covers features introduced in spidermonkey 31 convert any javascript value to a string. syntax #include "js/conversions.h" // as of spidermonkey 38; previously in jsapi.h jsstring* js::tostring(jscontext *cx, js::handlevalue v) name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert.
description js::tostring returns a string representation of a javascript value. if v.isstring() is true, it calls v.tostring(). otherwise, it converts the value to string. on success, js::tostring returns a jsstring instance. on error or exception, it returns nullptr. see also ...
JS::ToUint16
this article covers features introduced in spidermonkey 17 convert any javascript value to an unsigned 16bit integer. syntax bool js::touint16(jscontext *cx, js::handlevalue v, uint16_t *out); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. out uint16_t * out parameter. on success, *out receives the converted floating-point value.
description js::toint16 converts a javascript value to an unsigned 16bit integer. it implements the toint16 operator described in ecma 262-3 §9.7. on success, js::toint16 stores the converted value in *out and returns true...
JS::ToUint32
this article covers features introduced in spidermonkey 17 convert any javascript value to an unsigned 32bit integer. syntax bool js::touint32(jscontext *cx, js::handlevalue v, int32_t *out); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. out int32_t * out parameter. on success, *out receives the converted floating-point value.
description js::touint32 converts a javascript value to an unsigned 32bit integer. it implements the touint32 operator described in ecma 262-3 §9.5. on success, js::touint32 stores the converted value in *out and returns tru...
JS::ToUint64
this article covers features introduced in spidermonkey 17 convert any javascript value to an unsigned 64bit integer. syntax bool js::touint64(jscontext *cx, js::handlevalue v, uint64_t *out); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. out uint64_t * out parameter. on success, *out receives the converted floating-point value.
description js::toint64 converts a javascript value to an unsigned 64bit integer. on success, js::toint64 stores the converted value in *out and returns true. on error or exception, it returns false, and the value left in *...
JS::TrueHandleValue
this article covers features introduced in spidermonkey 38 the js::value that represents the javascript value true. syntax const js::handlevalue js::truehandlevalue; const js::handlevalue js::falsehandlevalue;
description js::truehandlevalue and js::falsehandlevalue are js::handlevalue constants that represent the javascript values true and false. see also mxr id search for js::truehandlevalue mxr id search for js::falsehandlevalue js::nullhandlevalue js::undefinedhandlevalue bug 959787 ...
JS::TrueValue
this article covers features introduced in spidermonkey 24 create a js::value that represents the javascript value true. syntax js::value js::truevalue()
description js::truevalue creates a js::value that represents the javascript value true. see also mxr id search for js::truevalue js::value js::booleanvalue js::falsevalue ...
JS::UndefinedHandleValue
this article covers features introduced in spidermonkey 24 the js::value that represents the javascript value undefined. syntax const js::handlevalue js::undefinedhandlevalue;
description js::undefinedhandlevalue is a js::handlevalue constant that represents the javascript value undefined. see also mxr id search for js::undefinedhandlevalue js::nullhandlevalue js::truehandlevalue js::falsehandlevalue bug 865969 ...
JS::UndefinedValue
this article covers features introduced in spidermonkey 24 create a js::value that represents the javascript value undefined. syntax js::value js::undefinedvalue();
description js::undefinedvalue creates a js::value that represents the javascript value undefined. see also mxr id search for js::undefinedvalue js::value js::undefinedhandlevalue ...
JSAutoCompartment
this article covers features introduced in spidermonkey 24 raii helper to enter a different compartment on the given context and automatically leave it once the jsautocompartment instance gets out of scope. syntax jsautocompartment(jscontext *cx, jsobject *target); jsautocompartment(jscontext *cx, jsscript *target); name type
description cx jscontext * the context on which a cross-compartment call is needed. target jsobject * / jsscript * the object in a different compartment to be accessed. this implicitly identifies the compartment to be entered.
description every jscontext has a current compartment. only objects in the current compartment can be accessed, so to access an object in a different compartment, this cont...
JSErrorFormatString
this article covers features introduced in spidermonkey 17 represent error message and type. syntax typedef struct jserrorformatstring { const char *format; uint16_t argcount; int16_t exntype; } jserrorformatstring; name type
description format const char * the error format string in ascii. argcount uint16_t the number of arguments to expand in the formatted error message. exntype int16_t one of the jsexntype constants.
description jserrorformatstring is a struct to represent error message and type, returned by js_reporterrornumber function. see also mxr id search for jserrorformatstring jsexntype js_reporterrornumber bug 684526 ...
JSExceptionState
the fields of this structure are private/opaque. this is used to save and restore exception states. syntax struct jsexceptionstate;
description a jsexceptionstate object is returned by the js_saveexceptionstate function, and is passed to functions js_restoreexceptionstate and js_dropexceptionstate. see also mxr id search for jsexceptionstate js_saveexceptionstate js_restoreexceptionstate js_dropexceptionstate ...
JSExnType
jsexn_none an unthrowable error. (lower bound) jsexn_err error jsexn_internalerr internalerror jsexn_evalerr evalerror jsexn_rangeerr rangeerror jsexn_referenceerr referenceerror jsexn_syntaxerr syntaxerror jsexn_typeerr typeerror jsexn_urierr urierror jsexn_limit (upper bound)
description these types are part of a jserrorformatstring structure. they define which error to throw in case of a runtime error. jsexn_none marks an unthrowable error. see also mxr id search for jsexntype jserrorformatstring bug 684526 ...
JSExtendedClass.outerObject
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. jsextendedclass.outerobject and .innerobject are callbacks for split objects. callback syntax typedef jsobject * (*jsobjectop)(jscontext *cx, jsobject *obj); name type
description cx jscontext * a context. obj jsobject * the object being queried.
description see split objects. ...
JSExtendedClass.wrappedObject
olete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8 callback for objects that wrap other objects. syntax typedef jsobject * (*jsobjectop)(jscontext *cx, jsobject *obj); name type
description cx jscontext * the context in which the object is being unwrapped. obj jsobject * the object to unwrap.
description if a class has the jsclass_is_extended bit set in its jsclass.flags and has a non-null jsextendedclass.wrappedobject, then objects of that class may be wrappers. in a few cases the javascript engine will pretend the wrapper isn't there, instead ...
JSFUN_BOUND_METHOD
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. flag that indicates a function nominally associated with an object is bound, instead, to that object's parent. syntax jsfun_bound_method
description this macro exists only for backward compatibility with existing applications. its use is deprecated. future versions of the javascript engine may not support or recognize this macro. jsfun_bound_method is a flag that indicates a method associated with an object is bound to the method's parent, the object on which the method is called. see also jsfun_global_parent bug 429507 ...
JSFreeOp
this article covers features introduced in spidermonkey 17 structure used during finalization instead of jscontext. syntax jsfreeop(jsruntime *rt); name type
description rt jsruntime * a runtime to store in this structure. methods method
description jsruntime *runtime() const returns a pointer to jsruntime passed to constructor.
description various finalization api takes not jscontext * but rather either jsfreeop structure or its library-private counterpart freeop. these structures wrap parameters that are passed to the finalizers removing most of explicit dependencies on jscontext in the finalization code. see also mxr id search for jsfreeop js_freeop js_getdefaultfreeop jsfinalizecallback jsdestroycompartmen...
JSGetObjectOps
obsolete since jsapi 17this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. jsgetobjectops is the type for jsclass.getobjectops callback syntax typedef jsobjectops * (* jsgetobjectops)(jscontext *cx, jsclass *clasp); name type
description cx jscontext * the js context in which the new object is being created. cls jsclass * the class of the new object.
description jsobjectops is used by js_newobject's internals to discover the set of high-level object operations to use for new objects of the given class. all native objects have a jsclass, which is stored as a private (int-tagged) pointer in object slots. in contrast, all native and ...
JSHasInstanceOp
jshasinstanceop is the type of jsclass.hasinstance. syntax typedef bool (* jshasinstanceop)(jscontext *cx, js::handleobject obj, js::mutablehandlevalue vp, bool *bp); name type
description cx jscontext * the js context in which the type check is occurring. obj js::handleobject the "type" in the type check. v js::mutablehandlevalue the value whose type is being checked. bp bool * out parameter. on success, the callback stores the result of the type check in *bp.
description jshasinstanceop is called to check whether v is an instance of obj. return false on error or exception, true on success with true in *bp if v is an instance of obj, false in *bp otherwise. jsclass hooks jsclass offers the...
JSID_EMPTY
internal jsid value which is used in type inference. syntax const jsid jsid_empty; const js::handleid jsid_emptyhandle; // added in spidermonkey 31
description jsid_empty is an internal jsid value which is used in type inference code. jsid_emptyhandle is the handle to the jsid with the value of jsid_empty. see also mxr id search for jsid_empty mxr id search for jsid_emptyhandle bug 912411 ...
JSID_IS_EMPTY
test whether a js id is jsid_empty. syntax bool jsid_is_empty(jsid id); name type
description id jsid the property identifier to test.
description jsid_is_empty tests whether a specified js id, id, is jsid_empty. see also mxr id search for jsid_is_empty jsid_empty ...
JSID_IS_GCTHING
testing and conversion functions between a js id and a gc thing. syntax bool jsid_is_gcthing(jsid id); js::gccellptr jsid_to_gcthing(jsid id); name type
description id jsid the property identifier to test or convert.
description jsid_is_gcthing tests whether a specified js id, id, is a gc thing, and returns true if it's a gc thing. jsid_to_gcthing converts a specified js id, id to a gc thing. see also mxr id search for jsid_is_gcthing mxr id search for jsid_to_gcthing ...
JSID_IS_STRING
testing and conversion functions between a js id and a js string. syntax bool jsid_is_string(jsid id); jsstring * jsid_to_string(jsid id); jsid interned_string_to_jsid(jscontext *cx, jsstring *str); // added in spidermonkey 38 jsflatstring * jsid_to_flat_string(jsid id); // added in spidermonkey 17 name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. id jsid the property identifier to test or convert. str jsstring * an interned string to convert to an id.
description jsid_is_string tests whether a specified js id, id, is a string, and returns true if it's a string. jsid_to_string ...
JSID_IS_SYMBOL
this article covers features introduced in spidermonkey 38 testing and conversion functions between a js id and a js symbol. syntax bool jsid_is_symbol(jsid id); js::symbol * jsid_to_symbol(jsid id); jsid symbol_to_jsid(js::symbol *sym); name type
description id jsid the property identifier to test or convert. sym js::symbol a js symbol to test or convert.
description jsid_is_symbol tests whether a specified js id, id, is a js symbol, and returns true if it's a js symbol. jsid_to_symbol converts a specified js id, id to a js symbol. symbol_to_jsid converts a specified js symbol, i to a jsid. see also mxr id search for jsid_is_symbol mxr id search for jsid_to_symbol mxr id search for symbol_to_jsid bug 645416 ...
JSID_IS_VOID
test whether a js id is jsid_void. syntax bool jsid_is_void(jsid id); name type
description id jsid the property identifier to test.
description jsid_is_void tests whether a specified js id, id, is jsid_void. see also mxr id search for jsid_is_void jsid_void ...
JSID_IS_ZERO
test whether a js id is a zero id. syntax bool jsid_is_zero(jsid id); name type
description id jsid the property identifier to test.
description jsid_is_zero tests whether a specified js id, id, is zero (0 in its integer representation). see also mxr id search for jsid_is_zero bug 601457 ...
JSID_VOID
a void jsid is not a valid id and only arises as an exceptional api return value, such as in js_nextproperty. embeddings must not pass jsid_void into jsapi entry points expecting a jsid and do not need to handle jsid_void in hooks receiving a jsid except when explicitly noted in the api contract. ...
JSIdArray
use js_idarraylength and js_idarrayget to access the property, and js_destroyidarray to free, or use js::autoidarray as a local variable. ...
JSMarkOp
t any time. try to avoid using it. jsmarkop is the type of the jsclass.mark callback in spidermonkey 1.7 and earlier. in spidermonkey 1.8, jsmarkop will be deprecated. all new code using spidermonkey 1.8 or later should use a jstraceop instead to ensure that the tracing apis work properly. syntax typedef uint32 (* jsmarkop)(jscontext *cx, jsobject *obj, void *arg); name type
description cx jscontext * the js context in which the mark phase of garbage collection is occurring. obj jsobject * the object to be marked. arg void * opaque data which the mark hook must pass through to js_markgcthing.
description call js_markgcthing for each gc thing directly reachable from obj. use jsval_is_gcthing to check whether a value needs to be...
JSObjectOps.destroyObjectMap
of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.destroyobjectmap callback is called to destroy a jsobjectmap when its reference count goes to zero. syntax typedef void (*jsobjectmapop)(jscontext *cx, jsobjectmap *map); name type
description cx jscontext * pointer to the js context in which garbage collection is happening. map jsobjectmap * the map to destroy. ...
JSObjectOps.getRequiredSlot
ocumentation. see bug 408416 for details. the jsobjectops.getrequiredslot and setrequiredslot callbacks get and set a required slot—one that should already have been allocated. syntax typedef jsval (*jsgetrequiredslotop)(jscontext *cx, jsobject *obj, uint32 slot); typedef jsbool (*jssetrequiredslotop)(jscontext *cx, jsobject *obj, uint32 slot, jsval v); name type
description cx jscontext * the js context in which we access the slot. obj jsobject * the object whose slot we access. slot uint32 the index of the slot to access. see note below. v jsval the value to store in the slot, for jssetrequiredslotop.
description get and set a required slot, one that should already have been allocated. these operat...
JSObjectPrincipalsFinder
raged since it could be removed at any time. try to avoid using it. jsobjectprincipalsfinder is the type of a security callback that can be configured using js_setobjectprincipalsfinderjsapi 1.8 and earlier or js_setruntimesecuritycallbacksadded in spidermonkey 1.8.1. callback syntax typedef jsprincipals * (* jsobjectprincipalsfinder)(jscontext *cx, jsobject *obj); name type
description cx jscontext * the context in which to find principals. obj jsobject * the object whose principals are needed.
description the javascript engine calls this callback to obtain principals for a jsprincipals.subsume check. for example, when a watchpoint triggers, the engine calls the callback, passing the watchpoint handler, to ensure that watchpoint handlers a...
JSPRINCIPALS_HOLD
obsolete since jsapi 13this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. increment or decrement the reference count of a jsprincipals object. syntax jsprincipals_hold(cx, principals) jsprincipals_drop(cx, principals) name type
description cx jscontext * a context. principals jsprincipals * pointer to the jsprincipals object to hold or drop. this argument must not be null.
description jsprincipals_hold and jsprincipals_drop are used to manage memory for jsprincipals objects. principals are used by the spidermonkey security system. jsprincipals objects are not jsobjects. they are reference counted, not garbage collected. applicatio...
JSProperty
internal use only. the type of javascript object properties, used by the jsobjectops layer. syntax struct jsproperty { jsid id; };
description jsproperty is the abstract base class of all object properties. it is used internally in jsobjectops.lookupproperty, getattributes, setattributes, and dropproperty. see also bug 483473 ...
JSProtoKey
some of them are nightly only (depends on each option). see also bug 789635 bug 645416 - added jsproto_symbol bug 769872 - added jsproto_intl bug 792439 - added jsproto_weakset bug 896116 - added jsproto_typedarray bug 904701 - added jsproto_generatorfunction bug 914220 - added jsproto_typedobject bug 933001 - added js...
JSReserveSlotsOp
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. jsreserveslotsop is the type of the jsclass.reserveslots. syntax typedef uint32 (* jsreserveslotsop)(jscontext *cx, jsobject *obj); name type
description cx jscontext * the js context in which the new object is being created. obj jsobject * the new object.
description warning: jsapi applications should not use this hook. a class cannot freely use a reserveslots hook to reserve a different number of slots for each object. rather, within a jsruntime, every call to the same reserveslots hook must return the same value (excepting a few internal classes such ...
JSSecurityCallbacks.contentSecurityPolicyAllows
the jssecuritycallbacks.contentsecuritypolicyallows callback is called when a script attempts to access an object property. the callback can deny the script access to the property. jscheckaccessop is the type of the callback. (it is also the type of the callback set by js_setcheckobjectaccesscallback.) syntax typedef jsbool (*jscspevalchecker)(jscontext *cx); name type
description cx jscontext * the js context in which the property access attempt is occurring.
description check whether runtime code generation is allowed for the current global. jssecuritycallbacks.contentsecuritypolicyallows is invoked once per global object upon the first attempt to evaluate js code from a string (either through eval or the function constructor). ...
JSStringFinalizer
this article covers features introduced in spidermonkey 17 finalize external strings created by js_newexternalstring. syntax struct jsstringfinalizer { void (*finalize)(const jsstringfinalizer *fin, char16_t *chars); }; name type
description fin jsstringfinalizer the finalizer itself. chars char16_t * buffer of the external string to be finalized.
description jsstringfinalizer::finalize finalizes external strings created by js_newexternalstring. see also mxr id search for jsstringfinalizer js_newexternalstring bug 724810 ...
JSType
jstype_object javascript objects. jstype_function functions. jstype_string strings. jstype_number numbers. jstype_boolean boolean values, true and false. ...
JSVAL_IS_BOOLEAN
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determines if a given jsval is a javascript boolean. syntax jsval_is_boolean(v)
description jsval_is_boolean(v) is true if the given javascript value, v, is a boolean value (that is, it is either jsval_true or jsval_false). to convert between javascript boolean values (jsval) and c boolean values, use jsval_to_boolean and boolean_to_jsval. see also bug 952650 ...
JSVAL_IS_DOUBLE
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determines if a given jsval is a number represented as a jsdouble. syntax jsval_is_double(v)
description jsval_is_double(v) is true if v is a number represented in memory as a jsdouble. to check whether v is a number, regardless of implementation details, use jsval_is_number instead. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js double data type. if (jsval_is_double(myitem)) { . . . } see also bug 952650 ...
JSVAL_IS_GCTHING
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. indicates whether a js value has a type that is subject to garbage collection. syntax jsval_is_gcthing(v)
description jsval_is_gcthing(v) is true if the jsval v is either jsval_null or a reference to a value that is subject to garbage collection. javascript performs automatic garbage collection of objects, strings, and doubles. this macro exposes javascript engine implementation details and usually isn't what the application really means. see jsval for alternatives. see also bug 952650 ...
JSVAL_IS_INT
to test whether a value is a number, regardless of how it is represented in memory, use jsval_is_number instead. ...
JSVAL_IS_NULL
(note: jsval_is_object(jsval_null) is also true.) example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it contains a null value. ...
JSVAL_IS_NUMBER
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determine if a given jsval is a javascript number. syntax jsval_is_number(v)
description jsval_is_number(v) is true if v is a javascript number. to convert a numeric jsval to a c floating-point number, use js_valuetonumber. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js integer or double value. if (jsval_is_number(myitem)) { ... } see also bug 952650 ...
JSVAL_IS_OBJECT
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determine whether a given jsval is an object or null. syntax jsbool jsval_is_object(jsval v);
description jsval_is_object(v) returns true if v is either an object or jsval_null. this indicates that it is safe to call jsval_to_object(v) to convert v to type jsobject *. if v is a string, number, boolean, or undefined, the result is false. this function is obsolete and has been removed. instead use !jsval_is_primitive(v) to detect objects and jsval_is_null(v) to detect null. see also bug 952650 ...
JSVAL_IS_PRIMITIVE
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determine if a given jsval is of a primitive type. syntax jsval_is_primitive(v)
description jsval_is_primitive(v) is true if v is undefined, null, a boolean, a number, or a string. otherwise it is false, and v is an object. see also bug 952650 ...
JSVAL_IS_STRING
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determines if a given jsval is a string. syntax jsval_is_string(v)
description jsval_is_string(v) is true if v is a string. to access the content of a string jsval, use jsval_to_string, js_getstringchars, and js_getstringlength. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a string. if (jsval_is_string(myitem)) { ... } see also bug 952650 ...
JSVAL_IS_VOID
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determines if a given jsval is the javascript value undefined. syntax jsval_is_void(v)
description jsval_is_void(v) is true if v is jsval_void, which represents the javascript value undefined. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is void. if (jsval_is_void(myitem)) { ... } see also bug 952650 ...
JSVAL_LOCK
to lock a value, use local roots with js_addroot. jsval_lock locks a js value, v, to prevent the value from being garbage collected. ...
JSVAL_NULL
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the jsval that represents the javascript value null. syntax jsval_null
description jsval_null is a jsval constant that represents the javascript value null. it is equivalent to object_to_jsval(null). see also mxr id search for jsval_null jsval_void jsval_true jsval_false jsval_zero jsval_one bug 1177825 -- removed ...
JSVAL_ONE
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the jsval that represents the javascript number 1. syntax jsval_one
description jsval_one is equivalent to int_to_jsval(1). see also mxr id search for jsval_one int_to_jsval js_newcontext jsval_null jsval_void jsval_true jsval_false jsval_zero bug 1177825 -- removed ...
JSVAL_TO_BOOLEAN
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. cast a boolean javascript value to a c integer, either 0 or 1, without any type checking or error handling. syntax jsbool jsval_to_boolean(jsval v);
description jsval_to_boolean casts the value v to a c integer, either 0 or 1. as a precondition, jsval_is_boolean(v) must be true. that is, v must be either jsval_true or jsval_false. otherwise the behavior is undefined. the result is js_true or js_false respectively. these are constants of type jsbool, which is an integer type, the spidermonkey version of bool. js_false is 0; js_true is 1. to convert any value to a boolean, use js_valuetoboolean instead. that ...
JSVAL_TO_DOUBLE
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. casts a given jsval to a jsdouble without any type checking or error handling. syntax jsdouble jsval_to_double(jsval v);
description jsval_to_double casts a specified js value, v, to a c floating-point number of type jsdouble. as a precondition, jsval_is_double(v) must be true. this function is not type-safe: if v is an integer, string, null, or anything else, the behavior is undefined. to convert any value to a number, use js_valuetonumber instead. see also bug 952650 ...
JSVAL_TO_GCTHING
the type of the result is void *. v must be either jsval_null or a reference to a gc thing. otherwise the resulting pointer is undefined. jsval_is_gcthing may be used to check this. ...
JSVAL_TO_INT
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. converts an integer jsval to a c integer without any type checking or error handling. syntax jsval_to_int(v)
description jsval_to_int converts a specified integer jsval, v, to the corresponding c integer value. if v is any other type of value, the result is unspecified. note that although jsval is an integer type, it must be treated as opaque. the jsval encoding of the integer 4, for instance, is not ((jsval) 4) but some other pattern of bits. to convert an integer to jsval, use int_fits_in_jsval and int_to_jsval. see also bug 952650 ...
JSVAL_TO_OBJECT
as a precondition, jsval_is_object(v) must be true. that is, v must be either a reference to an object or jsval_null. ...
JSVAL_TO_STRING
as a precondition, jsval_is_string(v) must be true. this function is not type-safe: if v is not a string, the behavior is undefined. ...
JSVAL_TRUE
they are equivalent to boolean_to_jsval(true) and boolean_to_jsval(false), respectively. ...
JSVAL_UNLOCK
to unlock a value, use local roots with js_removeroot. jsval_unlock unlocks a previously locked js value, v, so it can be garbage collected. ...
JSVAL_VOID
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the jsval that represents the javascript value undefined. syntax jsval_void
description jsval_void is a jsval constant that represents the javascript value undefined. see also mxr id search for jsval_void jsval_null jsval_true jsval_false jsval_zero jsval_one bug 1177825 -- removed ...
JSVAL_ZERO
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the jsval that represents the javascript number 0. syntax jsval_zero
description jsval_zero is equivalent to int_to_jsval(0). see also mxr id search for jsval_zero int_to_jsval js_newcontext jsval_null jsval_void jsval_true jsval_false jsval_one bug 1177825 -- removed ...
JSVersion
each version has a name, which is a string used by js_stringtoversion and js_versiontostring. ...
JSXDRObjectOp
obsolete since jsapi 13this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. jsxdrobjectop is the type for jsclass.xdrobject. syntax typedef jsbool (* jsxdrobjectop)(jsxdrstate *xdr, jsobject **objp); name type
description xdr jsxdrstate * the xdr reader or writer. objp jsobject ** the object to be serialized or deserialized.
description serialize or deserialize an object, given an xdr state record representing external data. see jsxdrapi.h. jsclass hooks jsclass offers the following hook: jsxdr calls the jsclass.xdrobject callback to serialize and deserialize objects. see also jsclass bug 726944 ...
JS_ASSERT_STRING_IS_FLAT
this article covers features introduced in spidermonkey 1.8.5 assert a string is flattened. syntax static moz_always_inline jsflatstring * js_assert_string_is_flat(jsstring *str) { moz_assert(js_stringisflat(str)); return (jsflatstring *)str; } name type
description str jsstring * string to examine.
description js_assert_string_is_flat asserts the string is flattened, and returns a pointer to jsflatstring. see also mxr id search for js_assert_string_is_flat js_stringisflat bug 609440 ...
JS_BindCallable
this article covers features introduced in spidermonkey 17 bind the given callable to use the given object as this. syntax jsobject* js_bindcallable(jscontext *cx, js::handle<jsobject*> callable, js::handle<jsobject*> newthis); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. callable js::handle<jsobject*> pointer to the function object to bind new this. newthis js::handle<jsobject*> pointer to the new this value for callable.
description js_bindcallable binds the given callable to use the given object as this. if callable is not callable, will ...
JS_BufferIsCompilableUnit
determine whether a buffer is compilable unit. syntax bool js_bufferiscompilableunit(jscontext *cx, js::handle<jsobject*> obj, const char *utf8, size_t length); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the global object, or null. utf8 const char * string containing the script to compile. length size_t the length of utf8 in characters.
description given a buffer, return false if the buffer might become a valid javascript statement with the addition of more lines. otherwise return true. the intent is to supp...
JS_CStringsAreUTF8
ged since it could be removed at any time. try to avoid using it. these functions have been removed in spidermonkey 19. api users should switch to functions which take utf-8 explicitly or handle their own string encoding and decoding. option to have the jsapi treat char strings as utf-8. syntax jsbool js_cstringsareutf8(void); void js_setcstringsareutf8(void); // added in spidermonkey 1.8
description by default, all c/c++ strings passed into the jsapi are treated as iso/iec 8859-1, also known as iso-latin-1. that is, each byte is treated as a unicode character, and there is no way to pass in a string containing characters beyond u+00ff. however, spidermonkey can optionally interpret these strings as utf-8. there are two ways to enable this: at compile time, by building spidermonkey with js_c_...
JS_CheckForInterrupt
this article covers features introduced in spidermonkey 45 check for and handle interrupt. syntax bool js_checkforinterrupt(jscontext* cx); name type
description cx </code>jscontext *<code> the context.
description js_checkforinterrupt checks for the interrupt, and handle it if it's pending. js_checkforinterrupt returns false if interrupt callback returns false. see also mxr id search for js_checkforinterrupt js_setinterruptcallback js_getinterruptcallback js_requestinterruptcallback bug 1058695 ...
JS_ClearContextThread
obsolete since jsapi 8this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. transfer a jscontext from one thread to another. syntax jsword js_clearcontextthread(jscontext *cx); jsword js_setcontextthread(jscontext *cx); name type
description cx jscontext * the context to transfer from one thread to another. there must not be any active or suspended requests using this context.
description an application that creates or uses a jscontext in one thread, then uses or destroys it in another thread, must use js_clearcontextthread and js_setcontextthread to transfer the jscontext safely from one thread to the other. the rules for using jscontexts in mul...
JS_ClearDateCaches
this article covers features introduced in spidermonkey 17 clear the cache of calculated local time from each date object. syntax void js_cleardatecaches(jscontext *cx); name type
description cx jscontext * pointer to a javascript context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description js_cleardatecaches clears the cache of calculated local time from each date object. call to propagate a system timezone change. see also mxr id search for js_cleardatecaches js_newdateobject js_newdateobjectmsec js_objectisdate bug 285615 replaced by js::resettimezone ...
JS_ClearNewbornRoots
obsolete since jsapi 5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. clear a context's newborn roots, which temporarily protect newly allocated values from garbage collection. syntax void js_clearnewbornroots(jscontext *cx); name type
description cx jscontext * the context to clear.
description the last gc thing of each type (object, string, double, external string types) created on a given context is kept alive until another thing of the same type is created, using a newborn root in the context. these newborn roots help native code protect newly-created gc-things from gc invocations activated before those things can be rooted using local or global roo...
JS_ClearNonGlobalObject
obsolete since jsapi 34this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 24 remove all properties associated with an object. syntax void js_clearnonglobalobject(jscontext *cx, jsobject *obj); name type
description cx jscontext * the context in which to clear the object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object from which to delete all properties.
description js_clearnonglobalobject removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. ...
JS_ClearPendingException
clear the currently pending exception in a context. syntax void js_clearpendingexception(jscontext *cx); name type
description cx jscontext * the context in which the exception was thrown. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description js_clearpendingexception cancels the currently pending exception in cx, if any. (there is a pending exception if the most recently thrown exception in cx has not yet been caught or cleared.) when any jsapi call fails with an exception, the caller must either use js_clearpendingexception to catch the exception; or return false to allow the exception to propagate to the caller. note that a jsapi failure does not necessarily indicate that an exception is pending. many jsapi...
JS_ClearScope
obsolete since jsapi 18this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. remove all properties associated with an object. syntax void js_clearscope(jscontext *cx, jsobject *obj); name type
description cx jscontext * the context in which to clear the object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object from which to delete all properties.
description js_clearscope removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. properties belonging to objects on obj's prototype chain are not affected. to remove a single ...
JS_CloneFunctionObject
obsolete since jsapi 36this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. create a new function object from an existing jsfunction. syntax jsobject * js_clonefunctionobject(jscontext *cx, jsobject *funobj, jsobject *parent); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. funobj jsobject * the function to clone. parent jsobject * the new function's parent.
description js_clonefunctionobject creates a new function object from funobj. the new object has the same code and ...
JS_CompileFileHandleForPrincipals
this article covers features introduced in spidermonkey 1.8.5 please provide a
description of this function. syntax jsobject * js_compilefilehandleforprincipals(jscontext *cx, jsobject *obj, const char *filename, file *fh, jsprincipals *principals); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * filename const char fh file * principals jsprincipals *
description please provide a
description. see also js_compilefilehandleforprincipalsversion ...
JS_CompileFileHandleForPrincipalsVersion
this article covers features introduced in spidermonkey 1.8.5 please provide a
description for this function. syntax jsobject * js_compilefilehandleforprincipalsversion(jscontext *cx, jsobject *obj, const char *filename, file *fh, jsprincipals *principals, jsversion version); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * filename const char fh file * principals jsprincipals * version jsversion
description please provide a
description. see also js_compilefilehandleforprincipals ...
JS_ConcatStrings
concatenate two js strings. syntax jsstring * js_concatstrings(jscontext *cx, js::handlestring left, js::handlestring right); name type
description cx jscontext * the context in which both the strings have been created. left js::handlestring first string to concatenate. right js::handlestring second string to concatenate.
description js_concatstrings concatenates two js strings, str1 and str2, and returns the result. the result could be the same as one of the input strings, if the other string is zero length. when the string concatenation fails null is returned. see also mxr id search for js_concatstrings ...
JS_ContextIterator
obsolete since jsapi 52this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. cycles through the js contexts associated with a particular jsruntime. syntax jscontext * js_contextiterator(jsruntime *rt, jscontext **iterp); name type
description rt jsruntime * the runtime to walk. iterp jscontext * in-out parameter. on input, *iterp must be null or point to a context in rt. on success, the value of *iterp is modified so that repeated calls cycle through all the contexts in rt.
description js_contextiterator steps through the set of contexts associated with the runtime rt. each call to js_contextiterator returns the next context in the cycle.
JS_DecompileFunction
generates the complete source code of a function declaration from a compiled function. syntax jsstring * js_decompilefunction(jscontext *cx, js::handle<jsfunction*> fun); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. fun js::handle<jsfunction*> function to decompile.
description js_decompilefunction generates the complete source code of a function declaration from a function's compiled form, fun. if successful, js_decompilefunction returns a string containing the text of the function. otherwise, it returns null. if you decompile a function that does not make a native c call, then the ...
JS_DecompileScriptObject
this article covers features introduced in spidermonkey 1.8.5 fixme: please provide a
description for this function. syntax jsstring * js_decompilescriptobject(jscontext *cx, jsobject *scriptobj, const char *name, unsigned int indent); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. scriptobj jsobject * name const char * indent unsigned int
description fixme: please provide a
description. see also fixme: ...
JS_DeepFreezeObject
this article covers features introduced in spidermonkey 1.8.5 freeze obj, and all objects it refers to, recursively. syntax bool js_deepfreezeobject(jscontext *cx, js::handle<jsobject*> obj); name type
description cx jsruntime * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> an object to freeze.
description js_deepfreezeobject freezes obj, and all objects it refers to, recursively. this will not recurse through non-extensible objects, on the assumption that those are already deep-frozen. see also mxr id search for js_deepfreezeobject js_freezeobject bug 492849 ...
JS_DestroyIdArray
free a jsidarray. syntax void js_destroyidarray(jscontext *cx, jsidarray *ida); name type
description cx jscontext * a context. ida jsidarray * the jsidarray to free.
description js_destroyidarray frees the id array pointed to by ida. id arrays are primarily the result of js_enumerate. see also mxr id search for js_destroyidarray jsidarray js_enumerate ...
JS_DoubleIsInt32
this article covers features introduced in spidermonkey 17 compare double value and int32_t value. syntax bool js_doubleisint32(double d, int32_t *ip); name type
description d double a double value to compare ip int32_t * a pointer to int32_t value to compare
description js_doubleisint32 returns true if d i sequal to *ip. (comment from mozilla::numberequalsint32) casting a floating-point value that doesn't truncate to int32_t, to int32_t, induces undefined behavior. we ...
JS_DoubleToInt32
ny time. try to avoid using it. this article covers features introduced in spidermonkey 17 convert a c floating-point number of type double to 32-bit integer per ecma spec. syntax int32_t js_doubletoint32(double d); uint32_t js_doubletouint32(double d); name type
description d double the numeric value to convert.
description js_doubletoint32 converts a c floating-point number of type double to int32, a signed 32-bit integer. js_doubletouint32 converts a c floating-point number of type double to uint32, an unsigned 32-bit integer. ...
JS_DropExceptionState
destroys a jsexceptionstate object previously created using js_saveexceptionstate. syntax void js_dropexceptionstate(jscontext *cx, jsexceptionstate *state); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. state jsexceptionstate * pointer to the jsexceptionstate object to destroy.
description this function destroys the specified jsexceptionstate object, unrooting as necessary any attached exception object and freeing the memory resources associated with the jsexceptionstate object. this object should previously have been created using js_saveexceptionstate. see also mxr id search for js_dropstateex...
JS_EncodeString
this article covers features introduced in spidermonkey 1.8 convert a javascript string to a c string. syntax char * js_encodestring(jscontext *cx, jsstring *str); char * js_encodestringtoutf8(jscontext *cx, js::handlestring str); // added in spidermonkey 24 name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.. str jsstring * / js::handlestring a string to encode.
description js_encodestring and js_encodestringtoutf8 convert the specified javascript str to a c string (an array of 8-bit chars). if js_cstringsareutf8 is true, then the returned string of js_encodestring is utf-8, and the conversion is lossless. otherwise the high byte is simply dr...
JS_EncodeStringToBuffer
this article covers features introduced in spidermonkey 1.8.5 convert a javascript string to a c string. syntax size_t js_encodestringtobuffer(jscontext *cx, jsstring *str, char *buffer, size_t length); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * a string to encode. buffer char * a character buffer to receive encoded string. length size_t the size of buffer in bytes.
description js_encodestringtobuffer converts the specified javascript str to a c string (an array of 8-bit chars) and fills the specified buffer with up to length bytes of the string. it returns the length of the whole string enco...
JS_EnterCompartment
this article covers features introduced in spidermonkey 24 note: the preferred way of changing a context's current compartment is using jsautocompartment. enter a different compartment on the given context, so that objects in that compartment can be accessed. syntax jscompartment * js_entercompartment(jscontext *cx, jsobject *target); name type
description cx jscontext * the context on which a cross-compartment call is needed. target jsobject * the object in a different compartment to be accessed. this implicitly identifies the compartment to be entered.
description every jscontext has a current compartment. any access to an object in a different compartment must be bracketed by calling js_entercompartment and js_...
JS_EnterCrossCompartmentCall
t. this article covers features introduced in spidermonkey 1.8.1 js_entercrosscompartmentcall has been removed in bug 786068. use js_entercompartment instead. enter a different compartment on the given context, so that objects in that compartment can be accessed. syntax jscrosscompartmentcall * js_entercrosscompartmentcall(jscontext *cx, jsobject *target); name type
description cx jscontext * the context on which a cross-compartment call is needed. target jsobject * the object in a different compartment to be accessed. this implicitly identifies the compartment to be entered.
description every jscontext has a current compartment. any access to an object in a different compartment must be bracketed by calling js_entercrossco...
JS_EnterLocalRootScope
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. enter a local root scope. syntax jsbool js_enterlocalrootscope(jscontext *cx); name type
description cx jscontext * pointer to the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description scoped local root management allows native functions, getter/setters, etc. to avoid calling js_addroot and js_removeroot to manage global roots temporarily. js_addroot roots a variable, ensuring that whatever the variable points to at any given moment is protected from gc. by contrast, local root scopes protect newly-created objects,...
JS_Enumerate
get an array of the enumerable properties of a given object. syntax jsidarray * js_enumerate(jscontext *cx, js::handleobject obj); name type
description cx jscontext * the context in which to enumerate object properties. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object whose properties are to be enumerated.
description js_enumerate gets the ids of all own properties of the specified object, obj, that have the jsprop_enumerate attribute. (the term own property refers to a property that is not inherited from the object's prototype.) this is not quite the same behavior as a javascript for...in loop, which converts all property ids to strings and also enumerates inherited p...
JS_EnumerateDiagnosticMemoryRegions
this article covers features introduced in spidermonkey 17 enumerate memory regions that contain diagnostic information.. syntax void js_enumeratediagnosticmemoryregions(jsenumeratediagnosticmemorycallback callback); name type
description callback jsenumeratediagnosticmemorycallback pointer to the new callback function to use. callback syntax typedef bool (* jsenumeratediagnosticmemorycallback)(void *ptr, size_t length); name type
description ptr void * pointer to the allocated memory. length size_t length of the allocated memory.
description js_enumeratediagnosticmemoryregions enumerates memory regions that contain diagnostic information intended to be included in crash report minidumps. see a...
JS_EnumerateResolvedStandardClasses
solete since jsapi 24this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. enumerate any already-resolved standard class ids. syntax jsidarray * js_enumerateresolvedstandardclasses(jscontext *cx, jsobject *obj, jsidarray *ida); name type
description description js_enumerateresolvedstandardclasses enumerates any already-resolved standard class ids into ida, or into a new jsidarray if ida is null. return the augmented array on success, null on failure with ida (if it was non-null on entry) destroyed. see also js_enumerateresolvedstandardclasses bug 884410 ...
JS_EnumerateStandardClasses
enumerate standard class in an object. syntax bool js_enumeratestandardclasses(jscontext *cx, js::handleobject obj); name type
description cx jscontext * pointer to the executable script context for which to initialize js function and object classes. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject an object to enumerate standard classes.
description the global object's class's enumerate op should call js_enumeratestandardclasses(cx, obj), to define eagerly during for...in loops any classes not yet resolved lazily. see also mxr id search for js_enumeratestandardclasses js_resolvestandardclass ...
JS_ErrorFromException
get or create jserrorreport from an exception object. syntax jserrorreport * js_errorfromexception(jscontext *cx, js::handleobject obj); name type
description cx jscontext * pointer to a js context whose errors should be reported via your function. other contexts in the same runtime can have their own error reporting functions. obj js::handleobject an exception object.
description if obj is an exception object, the exception will have (or be able to lazily create) an error report struct, and js_errorfromexception will return the address of that struct. otherwise, it returns nullptr. the lifetime of the error report struct that might be returned is the same as the lifetime of the exception object. see also mxr id search for js_errorfromex...
JS_FORGET_STRING_FLATNESS
this article covers features introduced in spidermonkey 1.8.5 convert jsflatstring to jsstring. syntax static moz_always_inline jsstring * js_forget_string_flatness(jsflatstring *fstr) { return (jsstring *)fstr; } name type
description fstr jsflatstring * a string to convert
description js_forget_string_flatness converts jsflatstring * to jsstring *. see also mxr id search for js_forget_string_flatness jsflatstring jsstring bug 609440 ...
JS_FileEscapedString
this article covers features introduced in spidermonkey 1.8.5 write string into file with escaping. syntax bool js_fileescapedstring(file *fp, jsstring *str, char quote); name type
description fp file * a file pointer to write into. str jsstring * a string to write into the file. quote char one of 0, single quote, and double quote.
description js_fileescapedstring writes str into file fp escaping any non-printable or non-ascii character. if quote is not 0, it must be a single or double quote character that will quote the output. if successful, js_fileescapedstring returns true, otherwise false. see also mxr id search for js_fileescapedstring bug 609440 ...
JS_Finish
obsolete since jsapi 19this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. same function as js_destroyruntime. syntax void js_finish(jsruntime *rt); name type
description rt jsruntime * pointer to a js runtime to destroy.
description js_finish is obsolete. use js_destroyruntime instead. see also js_destroyruntime bug 805080 ...
JS_FlattenString
this article covers features introduced in spidermonkey 1.8.5 flattens a string. this makes getting the characters of the string infallible. syntax jsflatstring * js_flattenstring(jscontext *cx, jsstring *str); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * the string to flatten.
description js_flattenstring flattens a string str and returns a pointer to jsflatstring. to catch errors, an opaque jsflatstring type is returned. note: the input and output of js_flattenstring() are the same actual gc-thing so only one needs to be rooted. if a jsstring is known to be flat, you can use js_assert_string_is_flat to make a d...
JS_FlushCaches
me browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 flushes the code cache for the current thread. the operation might be delayed if the cache cannot be flushed currently because native code is currently executing. syntax void js_flushcaches(jscontext *cx); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description . see also bug 737364 ...
JS_ForgetLocalRoot
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. remove a value from the innermost current local root scope. syntax void js_forgetlocalroot(jscontext *cx, void *thing); name type
description cx jscontext * pointer to the context in which the caller is running. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. thing void * pointer to the value to be unrooted. this must point to a jsobject, jsstring, jsfunction, or jsdouble. it must not be null.
description this function is used to interact with scoped local root management. see js_enterlocalrootscope for more on thi...
JS_GC
performs garbage collection in the js memory pool. syntax void js_gc(jscontext *cx); // added in spidermonkey 52 void js_gc(jsruntime *rt); // obsolete since jsapi 50 void js_gc(jscontext *cx); // obsolete since jsapi 14 name type
description cx jscontext * the context to for which to perform garbage collection. added in spidermonkey 52 rt jsruntime * the runtime to for which to perform garbage collection. obsolete since jsapi 50
description js_gc performs garbage collection of js objects, strings and other internal data structures that are no longer reachable in the specified context or runtime. garbage collection frees memory so that it can be reused by the system. when your scripts create many objects, you may want to call js_gc direct...
JS_GetArrayLength
retrieve the number of elements in an array object. syntax bool js_getarraylength(jscontext *cx, js::handle<jsobject*> obj, uint32_t *lengthp); name type
description cx jscontext * the context in which to look up the array's length. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> the object to examine. lengthp uint32_t * out parameter. on success, *lengthp receives the length of the array.
description js_getarraylength gets the .length property of obj as though by calling js_getproperty and converts it to a 32-bit unsigned integer. if obj is an array (see js_isarrayobject), this is guaranteed to succeed, because the .length pr...
JS_GetArrayPrototype
this article covers features introduced in spidermonkey 24 retrieves the original, canonical array.prototype for an object's global object. syntax jsobject * js_getarrayprototype(jscontext *cx, js::handleobject forobj); name type
description cx jscontext * pointer to a javascript context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. forobj js::handleobject an object from the global whose array.prototype is being retrieved.
description js_getarrayprototype() retrieves the original array.prototype of a specified object, obj. if an error occurs, it returns null. note: this expression might have different values over time if the global array property i...
JS_GetClass
retrieves the class associated with an object. syntax const jsclass * js_getclass(jsobject *obj); name type
description cx jscontext * any context associated with the runtime in which obj exists. obj jsobject * object to get the class from. in spidermonkey versions prior to spidermonkey 1.8.8, js_getclass took both a jscontext* and a jsobject* as arguments in thread-safe builds, and in non-thread-safe builds it took only a jsobject*. the js_get_class(cx, obj) macro abstracted away this detail. newer versions have removed the context argument, so that the same signature is used regardless whether or not the build is thread-safe.
description js_getclass returns a pointer to the jsclass associated with a specified js object, obj. the ...
JS_GetClassObject
get the builtin class constructor. syntax bool js_getclassobject(jscontext *cx, jsprotokey key, js::mutablehandle<jsobject*> objp); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. key jsprotokey the key of the prototype. objp js::mutablehandle<jsobject*> out parameter. if successful, receive the class constructor.
description js_getclassobject gets the builtin class costructor for the specified prototype key. if successful, js_getclassobject stores the class constructor to *objp and returns true, otherwise returns false and the value of *objp is undefined. see also mxr id search for js_getclassobject js_...
JS_GetClassPrototype
get the builtin class prototype object. syntax bool js_getclassprototype(jscontext *cx, jsprotokey key, js::mutablehandle<jsobject*> objp); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. key jsprotokey the key of the prototype. objp js::mutablehandle<jsobject*> out parameter. if successful, receive the class prototype object.
description js_getclassprototype gets the builtin class costructor for the specified prototype key. if successful, js_getclassprototype stores the class prototype object to *objp and returns true, otherwise returns false and the value of *objp is undefined. see also mxr id search...
JS_GetContextPrivate
access a jscontext field for application-specific data. syntax void * js_getcontextprivate(jscontext *cx); void js_setcontextprivate(jscontext *cx, void *data); void * js_getsecondcontextprivate(jscontext *cx); // added in spidermonkey 17 void js_setsecondcontextprivate(jscontext *cx, void *data); // added in spidermonkey 17 name type
description cx jscontext * any context. data void * (in js_setcontextprivate or js_setsecondcontextprivate) pointer to application-defined data to be associated with the context cx.
description each jscontext has two fields of type void * which the application may use for any purpose. they are especially useful for storing data needed by callbacks. js_getcontextprivate and js_getsecondcontextprivate get this fiel...
JS_GetContextThread
obsolete since jsapi 8this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. returns the id of the associated thread for a context. syntax int js_getcontextthread(jscontext *cx); name type
description cx jscontext * the context to examine.
description js_getcontextthread returns the id of the thread currently associated with this context. if the context is not currently associated with any thread, the return value is 0. see js_setcontextthread. js_getcontextthread is available only if the engine is built with js_threadsafe. mxr id search for js_getcontextthread ...
JS_GetDefaultFreeOp
this article covers features introduced in spidermonkey 17 return default jsfreeop for the runtime. syntax jsfreeop * js_getdefaultfreeop(jsruntime *rt); name type
description rt jsruntime * a pointer to the runtime.
description js_getdefaultfreeop returns default jsfreeop for the runtime. see also mxr id search for js_getdefaultfreeop js_freeop jsfreeop bug 737365 ...
JS_GetEmptyString
this article covers features introduced in spidermonkey 1.8.5 returns the empty string as a jsstring object. syntax jsstring * js_getemptystring(jsruntime *rt); name type
description rt jsruntime * the runtime for which to return the empty string.
description the returned empty string has the length 0. see also mxr id search for js_getemptystring js_getstringlength js_getemptystringvalue bug 612150 ...
JS_GetEmptyStringValue
get the empty string as a value of type js::value. syntax // added in spidermonkey 42 js::value js_getemptystringvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getemptystringvalue(jscontext *cx); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description js_getemptystringvalue returns the empty string as a js::value. see also mxr id search for js_getemptystringvalue bug 1184564 -- changed jsval to js::value ...
JS_GetErrorPrototype
this article covers features introduced in spidermonkey 38 return the original value of error.prototype. syntax jsobject * js_geterrorprototype(jscontext *cx); name type
description cx jscontext * pointer to a js context whose errors should be reported via your function. other contexts in the same runtime can have their own error reporting functions.
description js_geterrorprototype returns the original value of error.prototype from the global object of the current compartment of cx. see also mxr id search for js_geterrorprototype bug 997285 ...
JS_GetExternalStringFinalizer
this article covers features introduced in spidermonkey 17 get the string finalizer of an external string. syntax const jsstringfinalizer * js_getexternalstringfinalizer(jsstring *str); name type
description str jsstring * a string to get finalizer.
description js_getexternalstringfinalizer returns the fin parameter passed to js_newexternalstring. see also mxr id search for js_ js_newexternalstring bug 724810 ...
JS_GetFunctionArity
this is the same as the function object's arity property, if that property has not been overwritten. specifically, if fun is a native function, the result is the value that was passed to the nargs parameter of js_definefunction. otherwise fun is implemented in javascript, and the result is the number of identifiers in its formal parameter list (see ecma 262-3 §13). ...
JS_GetFunctionCallback
me. try to avoid using it. returns the callback currently configured to be called when javascript functions are invoked or exited, as established by a prior call to js_setfunctioncallback. note: this method is only available if moz_trace_jscalls was defined at compile time using --enable-trace-jscalls. syntax jsfunctioncallback js_getfunctioncallback(jscontext *cx); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description js_getfunctioncallback returns the current function invocation callback, or null if there isn't one set up. see also mxr id search for js_getfunctioncallback js_setfunctioncallback j...
JS_GetFunctionFlags
obsolete since jsapi 19this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. retrieve the function flags of a given javascript function. syntax unsigned int js_getfunctionflags(jsfunction *fun); name type
description fun jsfunction * the function to examine.
description js_getfunctionflags retrieves the function flags of a given javascript function, fun. these flags are for the javascript engine’s internal use. most applications can’t do anything useful with them. function flags are a value of type unsigned int, the bitwise or of zero or more of the jsfun flags described below. once a function is created, its flags cannot be modified. jsfun_gene...
JS_GetFunctionPrototype
this article covers features introduced in spidermonkey 17 retrieves the original, canonical function.prototype for an object's global object. syntax jsobject * js_getfunctionprototype(jscontext *cx, js::handleobject forobj); name type
description cx jscontext * pointer to a javascript context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. forobj js::handleobject an object from the global whose function.prototype is being retrieved.
description js_getfunctionprototype() retrieves the original function.prototype of a specified object, obj. if an error occurs, it returns null. note: this expression might have different values over time if t...
JS_GetFunctionScript
this article covers features introduced in spidermonkey 38 retrieves a jsscript for a specified function. syntax jsscript * js_getfunctionscript(jscontext *cx, js::handlefunction fun); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. fun js::handlefunction pointer to a js function.
description js_getfunctionscript returns a pointer to jsscript for the specified function, fun. if fun is a native function, it returns null. see also mxr id search for js_getfunctionscript bug 1069694 ...
JS_GetGlobalForCompartmentOrNull
this article covers features introduced in spidermonkey 17 return the global object for the specified compartment. syntax jsobject * js_getglobalforcompartmentornull(jscontext *cx, jscompartment *c); name type
description cx jscontext * the context for which to return the global object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. c jscompartment * the compartment for which to return the global object.
description js_getglobalforcompartmentornull() returns the global object for the context and the compartment. this may return null if c never had a global (e.g., the atoms compartment), or if c's global has been collected. see also mxr id search for js_getglobalforcompartmen...
JS_GetGlobalForScopeChain
solete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 returns the global object for the active function on the context. renamed to js::currentglobalornull. syntax jsobject * js_getglobalforscopechain(jscontext *cx); name type
description cx jscontext * the context for which to return the global object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description js_getglobalforscopechain() returns the global object for whatever function is currently running on the context. in other words, it returns the global object on the current scope chain. if there is no java...
JS_GetGlobalObject
obsolete since jsapi 24this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. retrieves a context's global object. (in javascript, global variables are stored as properties of the global object.) syntax jsobject * js_getglobalobject(jscontext *cx); name type
description cx jscontext * the context from which to retrieve the global object.
description this function is obsolete: use js_getglobalforobject or js_getglobalforscopechain instead. the concept of a global object belonging to a context will likely be phased out in future versions of spidermonkey. js_getglobalobject retrieves the global object for a specified jscontext *, cx. this returns null ...
JS_GetImplementationVersion
get the version number of the js engine. syntax const char * js_getimplementationversion(void);
description js_getimplementationversion returns a hard-coded, english language string that specifies the version number of the js engine currently in use, and its release date. see also mxr id search for js_getimplementationversion js_getversion js_setversionforcompartment ...
JS_GetInternedStringChars
may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 get the chars of an interned string. syntax const jschar * js_getinternedstringchars(jsstring *str); const jschar * js_getinternedstringcharsandlength(jsstring *str, size_t *length); name type
description str jsstring * the interned string. length size_t * out parameter. receives the length of the string.
description js_getinternedstringchars returns a pointer to the interned string. js_getinternedstringcharsandlength returns a pointer to the interned string and stores the length of it to *length. see also bug 1037869 bug 609440 ...
JS_GetLatin1FlatStringChars
this article covers features introduced in spidermonkey 38 get the chars of a flat string. syntax const js::latin1char * js_getlatin1flatstringchars(const js::autocheckcannotgc &nogc, jsflatstring *str); const char16_t * js_gettwobyteflatstringchars(const js::autocheckcannotgc &nogc, jsflatstring *str); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.. nogc js::autocheckcannotgc & a reference to js::autocheckcannotgc. str jsflatstring * a string to get characters.
description js_getlatin1flatstringchars and js_gettwobyteflatstringchars return a pointer to the string. ...
JS_GetNaNValue
get the not-a-number (nan) floating-point number as a value of type js::value. syntax // added in spidermonkey 42 js::value js_getnanvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getnanvalue(jscontext *cx); name type
description cx jscontext * a context.
description js_getnanvalue returns a value of type js::value that represents an ieee floating-point quiet not-a-number (nan). nan is typically used in javascript as the return value of a numeric operation when an argument is invalid or conversion fails. for example, 0/0 and math.sqrt(-1) both return nan. so do number("xyzzy") and math.sin("frank"). while the ieee standard defines many nan bit-patterns, they are indistinguishable in javascript, so in effect there's only one nan. nan is...
JS_GetObjectPrototype
this article covers features introduced in spidermonkey 17 retrieves the original, canonical object.prototype for an object's global object. syntax jsobject * js_getobjectprototype(jscontext *cx, js::handleobject forobj); name type
description cx jscontext * pointer to a javascript context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. forobj js::handleobject an object from the global whose object.prototype is being retrieved.
description js_getobjectprototype() retrieves the original object.prototype of a specified object, obj. if an error occurs, it returns null. note: this expression might have different values over time if the global object prop...
JS_GetObjectRuntime
this article covers features introduced in spidermonkey 17 retrieve a pointer to the jsruntime of a specified object. syntax jsruntime * js_getobjectruntime(jsobject *obj); name type
description obj jsobject * the object to query.
description js_getobjectruntime retrieves a pointer to the jsruntime for a specified jsobject. see also mxr id search for js_getobjectruntime bug 723286 ...
JS_GetOptions
obsolete since jsapi 27this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. get the currently enabled jscontext options. syntax uint32 js_getoptions(jscontext *cx); name type
description cx jscontext * the context from which to read options.
description js_getoptions retrieves the option flags of a given js context cx. this function returns a uint32 value that is the logical or of zero or more of the jsoption flags described in js_setoptions. see also mxr id search for js_getoptions js_setoptions js_toggleoptions bug 880330 ...
JS_GetParent
obsolete since jsapi 39this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. get the parent object of a given object. syntax jsobject * js_getparent(jsobject *obj); name type
description obj jsobject * object for which to retrieve the parent.
description js_getparent retrieves the parent object of obj, or null if obj does not have a parent. warning: the result may be an internal-use-only object. such an object should not be passed to any other jsapi function that could expose it to script code. each object is assigned a parent when it is created: the standard library objects and functions all have the global object as their parent. objects c...
JS_GetParentRuntime
this article covers features introduced in spidermonkey 31 retrieve a pointer to the parent jsruntime. syntax jsruntime * js_getparentruntime(jscontext *cx); name type
description cx jscontext * the context to query.
description js_getparentruntime retrieves a pointer to the parent jsruntime of the runtime for a specified jscontext. if the cx's runtime has no parent runtime, js_getparentruntime returns cx's runtime itself. see also mxr id search for js_getparentruntime js_getruntime bug 964059 ...
JS_GetPendingException
get the current pending exception for a given jscontext. syntax bool js_getpendingexception(jscontext *cx, js::mutablehandlevalue vp); name type
description cx jscontext * pointer to the js context in which the exception was thrown. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. vp js::mutablehandlevalue out parameter. on success, *vp receives the current pending exception.
description if an exception has been thrown in the context cx, and it has not yet been caught or cleared, js_getpendingexception stores the exception object in *vp and returns true. otherwise, it returns false, and the value left in *vp is undefined. see examples in the jsapi phrasebook. see also mxr id search for js_getpendinge...
JS_GetPositiveInfinityValue
retrieve a floating-point infinity as a value of type js::value. syntax // added in spidermonkey 42 js::value js_getpositiveinfinityvalue(jscontext *cx); js::value js_getnegativeinfinityvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getpositiveinfinityvalue(jscontext *cx); jsval js_getnegativeinfinityvalue(jscontext *cx); name type
description cx jscontext * a context.
description js_getpositiveinfinityvalue returns a js::value that represents an ieee floating-point positive infinity. js_getnegativeinfinityvalue returns the corresponding negative infinity. infinities are typically used to represent numbers that are greater in magnitude than the greatest representable finite values. as a value in mathematical calculations, an infinite ...
JS_GetPrivate
obj must be an instance of a class that has the jsclass_has_private flag. new objects' private data fields are initially null. if obj is a function object, as reported by js_objectisfunction, the private data is a pointer to a jsfunction. ...
JS_GetPrototype
retrieves an object's prototype. syntax bool js_getprototype(jscontext *cx, js::handleobject obj, js::mutablehandleobject protop); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object for which to retrieve the prototype. protop js::mutablehandleobject out parameter. if successful, receives prototype object of obj.
description js_getprototype retrieves the prototype of a specified object, obj. a prototype object provides properties inherited by similar js objects. this is the equivalent of object.getprototypeof(obj) from javascript. if js_getprototype retur...
JS_GetRegExpFlags
this article covers features introduced in spidermonkey 17 get the flags of the given regexp object. syntax unsigned js_getregexpflags(jscontext *cx, handleobject obj) name type
description cx jscontext * a context. obj js::handleobject the object to get the flags.
description js_getregexpflags returns flags of the specified object, obj. if successful, js_getregexpflags returns the flags, otherwise returns false. see also mxr id search for js_getregexpflags js_newregexpobject js_newucregexpobject flags regexp bug 655641 ...
JS_GetRegExpSource
this article covers features introduced in spidermonkey 17 get the source string of the given regexp object. syntax jsstring * js_getregexpsource(jscontext *cx, js::handleobject obj); name type
description cx jscontext * a context. obj js::handleobject the object to get the source string.
description js_getregexpsource returns a source string of the specified object, obj. if successful, js_getregexpsource returns a pointer to the source string, otherwise returns null. see also mxr id search for js_getregexpsource js_newregexpobject js_newucregexpobject regexp bug 655641 ...
JS_GetRuntime
retrieves a pointer to the jsruntime. syntax jsruntime * js_getruntime(jscontext *cx); name type
description cx jscontext * the context to query.
description js_getruntime retrieves a pointer to the jsruntime with which a specified jscontext, cx, is associated. each context is associated with a particular jsruntime when it is created (see js_newcontext); js_getruntime provides a convenient, programmatic way to look up the association. see also mxr id search for js_getruntime js_newcontext ...
JS_GetScopeChain
using it. retrieves the scope chain for the javascript code currently running in a given context. js_getscopechain has been removed in spidermonkey 1.8.7 with no identical replacement. when you only used this function to retrieve the scope chain's global, then you can use the function js_getglobalforscopechain. syntax jsobject * js_getscopechain(jscontext *cx); name type
description cx jscontext * the context to query.
description js_getscopechain returns the first jsobject on the scope chain for the javascript code currently running in the given context, cx. the ecmascript standard, ecma 262-3 §10, describes execution contexts and scope chains. a scope chain is a sequence of objects whose properties are searched whenever a script or function refers ...
JS_GetStringBytes
obsolete since jsapi 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. convert a javascript string to a c string. syntax char * js_getstringbytes(jsstring *str); const char * js_getstringbytesz(jscontext *cx, jsstring *str); // added in jsapi 1.8.2 name type
description cx jscontext * (js_getstringbytesz and js_encodestring only) a context. str jsstring * string to retrieve bytes from.
description js_getstringbytes and js_getstringbytesz convert the specified javascript string, str, to a c string (an array of 8-bit chars). if js_cstringsareutf8 is true, then the returned string is utf-8, and the conversion is lossless. otherwise the h...
JS_GetStringChars
some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. retrieve a pointer to the 16-bit values that make up a given string. syntax jschar * js_getstringchars(jsstring *str); // obsolete since jsapi 1.8.5 const jschar * js_getstringcharsz(jscontext *cx, jsstring *str); // added in spidermonkey 1.8.2, obsolete since jsapi 33 name type
description cx jscontext * (in js_getstringcharsz only) a context. str jsstring * the string to obtain characters from.
description js_getstringchars obsolete since javascript 1.8.5 returns a pointer to the first element of an array of jschars. warnings: the array is not necessarily null-terminated. to get the length of the string, use js_getstringlength. the program mu...
JS_GetStringEncodingLength
this article covers features introduced in spidermonkey 1.8.5 get the length of a javascript string in bytes. syntax size_t js_getstringencodinglength(jscontext *cx, jsstring *str); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.. str jsstring * a string to encode.
description js_getstringencodinglength returns the length of the specified string in bytes, regardless of its encoding. you can use this value to create a buffer to encode the string into using the js_encodestringtobuffer function. to encode to utf8, use js::getdeflatedutf8stringlength and js::deflatestringtoutf8buffer instead. see also mxr id search for js_getstringencodingl...
JS_GetStringLength
this is the same as the length property of the string. this is the same as the length of the array returned by js_getstringchars, in char16_ts (not bytes). because some unicode characters are represented using two 16-bit code units, the result is not necessarily the same as the number of unicode characters in the string. ...
JS_GetTypeName
obsolete since jsapi 34this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. returns a pointer to the string literal
description of a specified js data type. syntax const char * js_gettypename(jscontext *cx, jstype type); name type
description cx jscontext * pointer to a js context from which to derive runtime information. type jstype one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean.
description js_gettypename returns a pointer to a string literal
description of a specified js data type, type. the following table lists jstypes and the string literals reported by js_gettypename: type ...
JS_HasElement
determine whether a javascript array has an element in the specified index. syntax bool js_haselement(jscontext *cx, js::handleobject obj, uint32_t index, bool *foundp); name type
description cx jscontext * the context in which to perform the property lookup. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the element. index uint32_t index of the element to look up. foundp bool * out parameter. on success, it stores true to *foundp, false otherwise.
description js_haselement examines a specified js object, obj, and its prototype chain, for an element or numeric property numbered index. if the element exists, js_haseleme...
JS_HasInstance
jsapi method equivalent to the instanceof operator in javascript. syntax bool js_hasinstance(jscontext *cx, js::handle<jsobject*> obj, js::handle<js::value> v, bool *bp); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> constructor/prototype to test. v js::handle<js::value> the value to test. bp bool * out parameter. on success, *bp receives the result of the test.
description js_hasinstance determines if a specified js value, v, is an instance of js object, obj. this function is equivalent to v instanceof obj test in javas...
JS_IdArrayGet
this article covers features introduced in spidermonkey 17 get the item of a jsidarray. syntax jsid js_idarrayget(jscontext *cx, jsidarray *ida, unsigned index) name type
description cx jscontext * a context. ida jsidarray * the jsidarray to get the length. index unsigned the index of the id in the jsidarray.
description js_idarrayget gets the item in the specified index of the id array pointed to by ida. see also mxr id search for js_idarrayget jsidarray js_idarraylength bug 641027 ...
JS_IdArrayLength
this article covers features introduced in spidermonkey 17 get the length of a jsidarray. syntax int js_idarraylength(jscontext *cx, jsidarray *ida); name type
description cx jscontext * a context. ida jsidarray * the jsidarray to get the length of.
description js_idarraylength gets the length of the id array pointed to by ida. see also mxr id search for js_idarraylength jsidarray js_idarrayget bug 641027 ...
JS_IdToProtoKey
this article covers features introduced in spidermonkey 31 convert a js id to a jsprotokey. syntax jsprotokey js_idtoprotokey(jscontext *cx, js::handleid id); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. id js::handleid the property identifier to convert.
description js_idtoprotokey converts a specified js id, id, to a prototype key. on success, js_idtoprotokey returns a jsprotokey. otherwise it returns jsproto_null. see also mxr id search for js_idtoprotokey js::protokeytoid bug 933681 ...
JS_IdToValue
convert a js id to a js value. syntax bool js_idtovalue(jscontext *cx, jsid id, js::mutablehandle<js::value> vp); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. id jsid the property identifier to convert. vp js::mutablehandle<js::value> out parameter. on success, *vp receives the converted value.
description js_idtovalue converts a specified js id, id, to a js value. on success, js_idtovalue stores the converted value in *vp and returns true. otherwise it returns false. the inverse of js_idtovalue is js_valuetoid. see also mxr id search for js_idtovalue js_valuetoid ...
JS_Init
once this method has succeeded, it is safe to call js_newruntime and other jsapi methods. this method must be called before any other jsapi method is used on any thread. ...
JS_InitCTypesClass
this article covers features introduced in spidermonkey 1.8.5 initialize the ctypes object on a global object. the ctypes object will be frozen. syntax jsbool js_initctypesclass(jscontext *cx, jsobject *global); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. global jsobject * the global object.
description ctypes capability is disabled in a build by default. see also ...
JS_InitStandardClasses
initializes general js function and object classes, and the built-in object classes used in most scripts. syntax bool js_initstandardclasses(jscontext *cx, js::handle<jsobject*> obj); name type
description cx jscontext * pointer to the executable script context for which to initialize js function and object classes. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> the global object to initialize. this object must be of a jsclass that has the jsclass_global_flags bits set.
description js_initstandardclasses initializes the built-in javascript global properties. these include all the standard ecmascript global properties defined in ecma 262-3 §15.1: array, boolea...
JS_InternJSString
this article covers features introduced in spidermonkey 1.8.5 make a string to interned string. syntax jsstring * js_internjsstring(jscontext *cx, js::handlestring str); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str js::handlestring a string to be interned.
description js_internjsstring converts a string str to interned string (interned atom) and returns the result string as jsstring *. on failure, js_internjsstring returns nullptr. see also mxr id search for js_internjsstring bug 609440 ...
JS_IsArrayObject
determine if a specified object is an array. syntax bool js_isarrayobject(jscontext *cx, js::handlevalue value, bool *isarray); bool js_isarrayobject(jscontext *cx, js::handleobject obj, bool *isarray); // obsolete since jsapi 44 bool js_isarrayobject(jscontext *cx, js::handlevalue value); bool js_isarrayobject(jscontext *cx, js::handleobject obj); name type
description cx jscontext * a context. value js::handlevalue the value to examine. obj js::handleobject the object to examine. isarray bool whether the value/object is an array.
description js_isarrayobject determines if a specified object, obj or value, is an array object. on success, returns true and sets isarray indicating whether obj is an array obje...
JS_IsAssigning
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determine whether script is executing assignment operation. syntax jsbool js_isassigning(jscontext *cx); name type
description description js_isassigning returns true if a script is executing and its current bytecode is a set (assignment) operation, even if there are native (no script) stack frames between the script and the caller to js_isassigning. see also bug 458421 ...
JS_IsBuiltinEvalFunction
this article covers features introduced in spidermonkey 17 return whether the given function is the global eval function. syntax bool js_isbuiltinevalfunction(jsfunction *fun); name type
description obj jsfunction * pointer to the function to test.
description js_isbuiltinevalfunction returns whether the given function is the global eval function. see also mxr id search for js_isbuiltinevalfunction js_isbuiltinfunctionconstructor bug 638312 ...
JS_IsBuiltinFunctionConstructor
this article covers features introduced in spidermonkey 17 return whether the given function is the global function constructor. syntax bool js_isbuiltinfunctionconstructor(jsfunction *fun); name type
description obj jsfunction * pointer to the function to test.
description js::iscallable returns whether the given function is the global function constructor. see also mxr id search for js_isbuiltinfunctionconstructor js_isbuiltinevalfunction bug 638312 ...
JS_IsConstructing
ork in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determine whether the currently executing jsnative was called as a constructor. js_isconstructing has been removed in bug 918462. use callargs::isconstructing or callreceiver::isconstructing instead. syntax jsbool js_isconstructing(jscontext *cx, jsval *vp); name type
description cx jscontext * the cx parameter passed to the jsnative. vp jsval * the vp parameter passed to the jsnative.
description js_isconstructing must be called only from a jsnative called from the engine. cx and vp must be the arguments that the engine passed to that jsnative. js_isconstructing returns js_true if the native was defined with jsfun_constructor (js_initc...
JS_IsConstructor
this article covers features introduced in spidermonkey 24 return whether the given function is a valid constructor. syntax bool js_isconstructor(jsfunction *fun); name type
description fun jsfunction * the function to examine.
description js_isconstructor determines if a specified function, fun is a valid constructor object. if so, js_isconstructor returns true. otherwise it returns false. see also mxr id search for js_isconstructor js::isconstructor bug 807228 ...
JS_IsExceptionPending
otherwise, it returns false this can be used from jsnative functions which call js code to determine if the called js code threw an exception or not. example /* jsapi */ bool pending; js::rootedvalue exception(cx); /* if an exception is pending, save and clear it. ...
JS_IsExtensible
this article covers features introduced in spidermonkey 1.8.5 query [[extensible]] properly of the given object. syntax bool js_isextensible(jscontext *cx, js::handleobject obj, bool *extensible); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to examine. extensible bool * out parameter. receives true if extensible, false otherwise.
description js_isextensible queries [[extensible]] property of the specified object, obj. if successful, js_isextensible stores [[extensible]] property to *extensible and returns true, otherwise returns false and the value of *extensible is undefined. see ...
JS_IsExternalString
this article covers features introduced in spidermonkey 17 determines whether or not the specified jsstring is an external string (that is, a string created by calling js_newexternalstring rather than js_newexternalstringwithclosure). syntax bool js_isexternalstring(jsstring *str); name type
description str jsstring * the string to check.
description js_isexternalstring returns true if the string is an external string; otherwise it's false. see also mxr id search for js_isexternalstring bug 651041 ...
JS_IsGlobalObject
this article covers features introduced in spidermonkey 24 determine if given object is a global object. syntax bool js_isglobalobject(jsobject *obj); name type
description obj jsobject * the object to examine.
description js_isglobalobject returns true if obj is a global object, false otherwise. see also mxr id search for js_isglobalobject js_newglobalobject bug 797821 ...
JS_IsNative
this article covers features introduced in spidermonkey 17 determines if given jsobject is a native object. syntax bool js_isnative(jsobject *obj); name type
description str jsobject * the object to check.
description js_isnative returns true if the object is a native object. see also mxr id search for js_isnative js_isnativefunction bug 648647 ...
JS_IsNativeFunction
this article covers features introduced in spidermonkey 17 return whether the given function object equals the specified native function. syntax bool js_isnativefunction(jsobject *funobj, jsnative call); name type
description funobj jsobject * the function object to examine. call jsnative the native function to compare.
description js_isnativefunction determines if a specified function object, funobj equals a specified native function, call. if so, js_isnativefunction returns true. otherwise it returns false. see also mxr id search for js_isnativefunction js_isnative bug 648801 ...
JS_IsRunning
indicates whether or not a script or function is currently executing in a given context. syntax bool js_isrunning(jscontext *cx); name type
description cx jscontext * the context to query.
description js_isrunning determines if a script or function is currently executing in a specified jscontext, cx. if a script is executing, js_isrunning returns true. otherwise it returns false. see also mxr id search for js_isrunning ...
JS_IsStopIteration
this article covers features introduced in spidermonkey 31 determine whether the value is a stopiteration exception or not. syntax // added in spidermonkey 42 bool js_isstopiteration(js::value v); // obsolete since spidermonkey 42 bool js_isstopiteration(jsval v); name type
description v js::value the value to check.
description js_isstopiteration returns true if v is stopiteration, otherwise false. see also mxr id search for js_isstopiteration js_throwstopiteration bug 918170 bug 1184564 -- changed jsval to js::value ...
JS_LeaveCompartment
this article covers features introduced in spidermonkey 24 note: the preferred way of changing a context's current compartment is using jsautocompartment. leave a the compartment, returning to the compartment active before the corresponding js_entercompartment. syntax void js_leavecompartment(jscontext *cx, jscompartment *oldcompartment); name type
description cx jscontext * the context in which to leave the compartment. oldcompartment jscompartment * value returned by previous call to js_entercompartment.
description every jscontext has a current compartment. any access to an object in a different compartment must be bracketed by calls to js_entercompartment and js_leavecompartment. see also mxr id search for js_leave...
JS_LeaveCrossCompartmentCall
void using it. this article covers features introduced in spidermonkey 1.8.1 js_leavecrosscompartmentcall has been removed in bug 786068. use js_leavecompartment instead. leave a the compartment, returning to the compartment active before the corresponding js_entercrosscompartmentcall. syntax void js_leavecrosscompartmentcall(jscrosscompartmentcall *call); name type
description call jscrosscompartmentcall * value returned by previous call to js_entercrosscompartmentcall.
description every jscontext has a current compartment. any access to an object in a different compartment must be bracketed by call js_entercrosscompartmentcall and js_leavecrosscompartmentcall. see also js_entercrosscompartmentcall js_entercompartment js_leavecompartment bug...
JS_LeaveLocalRootScope
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. leave a local root scope. syntax void js_leavelocalrootscope(jscontext *cx); name type
description cx jscontext * pointer to the context. this must be the same context passed to js_enterlocalrootscope(). requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description see js_enterlocalrootscope for an explanation of local root scopes. leaving a nested local root scope causes all objects created since the matching js_enterlocalrootscope call to become subject to garbage collection. that is, they are not transferred to the enclosing loc...
JS_LeaveLocalRootScopeWithResult
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. leave a local root scope, transferring the result value to the next enclosing root scope. syntax void js_leavelocalrootscopewithresult(jscontext *cx, jsval rval); name type
description cx jscontext * pointer to the context. this must be the same context that was passed to js_enterlocalrootscope. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rval jsval the result value that should remain protected from garbage collection.
description see js_enterlocalrootscope for an explanation of local root scopes. the protectio...
JS_Lock
obsolete since jsapi 12this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. lock the js run-time environment. syntax void js_lock(jsruntime *rt); name type
description rt jsruntime * pointer to the runtime to lock.
description js_lock is a deprecated api; don't use it. see also mxr id search for js_lock js_getruntime, js_unlock ...
JS_LooselyEqual
this article covers features introduced in spidermonkey 1.8.1 determine whether two javascript values are equal in the sense of the == operator. syntax bool js_looselyequal(jscontext *cx, js::handle<js::value> v1, js::handle<js::value> v2, bool *equal); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1, v2 js::handle<js::value> the value to compare. equal bool * out parameter. receives the comparison result.
description js_looselyequal determines if v1 is loosely equal to v2 under the javascript == operator, as specified in ecma 262-3 §11.9.3. if the ...
JS_MapGCRoots
root set. syntax uint32 js_mapgcroots(jsruntime *rt, jsgcrootmapfun map, void *data); callback syntax #define js_map_gcroot_next 0 /* continue mapping entries */ #define js_map_gcroot_stop 1 /* stop mapping entries */ #define js_map_gcroot_remove 2 /* remove and free the current entry */ typedef int (*jsgcrootmapfun)(void *rp, const char *name, void *data);
description call js_mapgcroots to map the gc's roots table using map(rp, name, data). the root is pointed at by rp; if the root is unnamed, name is null; data is supplied from the third parameter to js_mapgcroots. the map function should return js_map_gcroot_remove to cause the currently enumerated root to be removed. to stop enumeration, return js_map_gcroot_stop. to continue mapping, return js_map_gcroot...
JS_NewDateObjectMsec
this article covers features introduced in spidermonkey 1.8.5 creates a new date object instance, configured to represent the date and time indicated by the specified time in milliseconds since the unix epoch. syntax jsobject * js_newdateobjectmsec(jscontext *cx, double msec); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. msec double time since unix epoch in milliseconds.
description the returned jsobject is a standard javascript date. see also mxr id search for js_newdateobjectmsec js_newdateobject js_objectisdate bug 625870 ...
JS_NewDependentString
create a new javascript string containing a range of characters from an existing string. syntax jsstring * js_newdependentstring(jscontext *cx, js::handlestring str, size_t start, size_t length); name type
description cx jscontext * the context in which to create the new string. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str js::handlestring the string containing the characters for the new string. start size_t the start index of the substring. length size_t length of the substring, in characters.
description js_newdependentstring creates a new string as a substring of an existing javascript string, str. the new string contains the same characte...
JS_NewDouble
obsolete since jsapi 17this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. use js_newnumbervalue instead. allocates a copy of jsdouble on the gc heap. syntax jsdouble * js_newdouble(jscontext *cx, jsdouble d); name type
description cx jscontext * the context in which to create the new number. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. d jsdouble the number to copy.
description js_newdouble allocates a copy of the number d on the javascript garbage collection heap. this function is not very useful. to convert a jsdouble to a jsval, use js_newnumbervalue instead. warning: the argument d...
JS_NewNumberValue
use js_numbervalue instead convert a c floating-point number of type jsdouble to a jsval. syntax jsbool js_newnumbervalue(jscontext *cx, jsdouble d, jsval *rval); name type
description cx jscontext * the context in which to create the new number. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. d jsdouble the numeric value to convert. rval jsval * out parameter. on success, *rval receives a javascript number with the value d.
description js_newnumbervalue converts a c floating-point number of type jsdouble to jsval, the type of javascript values. the result is an integer jsval if d can be stored that way. otherwise, a new floating-point jsval is created. some space for the n...
JS_NewPlainObject
this article covers features introduced in spidermonkey 38 creates a new plain javascript object. syntax jsobject * js_newplainobject(jscontext *cx); name type
description cx jscontext * the context in which to create the new object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description js_newplainobject creates a new plain object, like new object(), with object.prototype as [[prototype]]. on success, js_newplainobject returns a pointer to the new object. otherwise it returns nullptr. see also mxr id search for js_newplainobject js_newobject bug 1125356 ...
JS_NewPropertyIterator
obsolete since jsapi 36this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. crate an iterator object for use with js_nextproperty. syntax jsobject * js_newpropertyiterator(jscontext *cx, js::handle<jsobject*> obj); name type
description cx jscontext * the js context in which to enumerate properties. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> the object whose properties are to be enumerated.
description create an object to iterate over the enumerable own properties of obj, in arbitrary order. (this differs from longstanding for..in loop order, which uses the ord...
JS_NewScriptObject
re is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. return the javascript script object that wraps a compiled script. the compiled script and its parts live until the script object is garbage collected. syntax jsobject * js_newscriptobject(jscontext *cx, jsscript *script); name type
description cx jscontext * the context in which to create the new script object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. script jsscript * the compiled script for which to create a new script object.
description js_newscriptobject returns the script object associated with the given jsscript. every jsscript object ha...
JS_NewStringCopyN
create a new js string. syntax jsstring * js_newstringcopyn(jscontext *cx, const char *s, size_t n); jsstring * js_newucstringcopyn(jscontext *cx, const char16_t *s, size_t n); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. s const char* or const char16_t * pointer to the array of characters containing the text for the js string to create. n size_t number of characters to copy from s into the new string.
description js_newstringcopyn allocates space for a javascript string and its underlying storage, and copies n characters from a c character array, s, into the new jsstring. js_newu...
JS_NewStringCopyZ
create a new javascript string based on a null-terminated c string. syntax jsstring * js_newstringcopyz(jscontext *cx, const char *s); jsstring * js_newucstringcopyz(jscontext *cx, const char16_t *s); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. s const char * or const char16_t * pointer to the character array containing the text for the js string to create; or null.
description js_newstringcopyz allocates space for a new javascript string and its underlying storage, and then copies the contents of a null-terminated character array, s, into the new string. on success, js_newstringcopyz returns a...
JS_Now
microseconds since the epoch, midnight, january 1, 1970 utc. syntax int64_t js_now(void);
description js_now returns microseconds since the epoch, midnight, january 1, 1970 utc. see also mxr id search for js_now ...
JS_NumberValue
this article covers features introduced in spidermonkey 17 convert a c floating-point number of type double to a js::value. replacement to js_newnumbervalue, js_newdoublevalue, js_newdouble. syntax // added in spidermonkey 42 js::value js_numbervalue(double d); // obsolete since spidermonkey 42 jsval js_numbervalue(double d); name type
description d double the numeric value to convert.
description js_numbervalue converts a c floating-point number of type double to js::value, the type of javascript values. the result is an integer js::value if d can be stored that way. otherwise, a new floating-point js::value is created. see also mxr id search for js_numbervalue bug 752223 bug 1184564 -- changed jsval to js::value ...
JS_ObjectIsDate
this article covers features introduced in spidermonkey 1.8.5 determines if a specified object is a date object. syntax bool js_objectisdate(jscontext *cx, js::handleobject obj); name type
description cx jscontext * pointer to a javascript context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * jsobject that should be checked.
description js_objectisdate() can be used to check if you are dealing with a date object, or a date object used across compartments (or windows or sites, in the browser embedding). this function returns true if the object is a date. see also mxr id search for js_objectisdate js_newdateobject js_newda...
JS_ObjectIsRegExp
this article covers features introduced in spidermonkey 17 determine if a specified object is a regexp. syntax bool js_objectisregexp(jscontext *cx, js::handleobject obj); name type
description cx jscontext * a context. obj js::handleobject the object to examine.
description js_objectisregexp determines if a specified object, obj, is a regexp object. if so, js_objectisregexp returns true. otherwise it returns false. see also mxr id search for js_objectisregexp js_newregexpobject js_newucregexpobject regexp bug 650931 ...
JS_PropertyStub
rather, they are convenient stand-ins anywhere the jsapi requires callbacks of certain types. examples at jsclass illustrate how stub functions can be used. js_propertystub is of type jspropertyop, the type of getter callback. it can be used in jsclass.addproperty, and jsclass.getproperty. it behaves exactly like ...
JS_RemoveExternalStringFinalizer
obsolete since jsapi 13this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. unregister a custom string memory manager. syntax int js_removeexternalstringfinalizer(jsstringfinalizeop finalizer); name type
description finalizer jsstringfinalizeop the finalizer to remove.
description remove finalizer from the global gc finalizers table, returning its type code if found, -1 if not found. as with js_addexternalstringfinalizer, there is a threading restriction if you compile the engine js_threadsafe: this function may be called for a given finalizer pointer on only one thread; different threads may call to remove distinct finalizers safely. you must ensure...
JS_RemoveRootRT
unregisters a pointer to a gc thing so that it is no longer a member of the garbage collector's root set. this enables any pointed-at gc thing to be garbage collected as needed. syntax jsbool js_removerootrt(jsruntime *rt, void *rp); name type
description rt jsruntime * pointer to the runtime with which the root was registered. rp void * address of the pointer to no longer protect. this must have been passed to one of js_addroot, js_addnamedroot, or js_addnamedrootrt earlier.
description js_removerootrt removes the gc thing that rp points to from the list of gc things that are protected from garbage collection. rp is thus a pointer to a pointer to a js double, string, or object. do not pass a pointer to a js double, string, or object -- y...
JS_ReportPendingException
forward the current pending exception in a given jscontext to the current jserrorreporter callback. syntax bool js_reportpendingexception(jscontext *cx); name type
description cx jscontext * the context in which the exception was thrown. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description if an exception is pending in the context cx, js_reportpendingexception converts the exception to a string and reports it to the current error reporter. on success, it clears the exception as though by calling js_clearpendingexception and returns true. if no exception is pending, or if a second error occurs while trying to report the first one, it returns false. this function can be used to catch exceptions thrown from scr...
JS_RestoreExceptionState
restores the exception state from a jsexceptionstate object previously created using js_saveexceptionstate. syntax void js_restoreexceptionstate(jscontext *cx, jsexceptionstate *state); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. state jsexceptionstate * pointer to the jsexceptionstate object to restore exception state from.
description this function permits to restore any previously saved exception state which was saved into a jsexceptionstate object created by the js_saveexceptionstate function. if any exception was pending when js_saveexceptionstate was called, the same exception will be set ...
JS_SameValue
if (v1 === 0 && v2 === 0) return 1 / v1 === 1 / v2; if (v1 !== v1 && v2 !== v2) return true; return v1 === v2; } syntax // added in spidermonkey 45 bool js_samevalue(jscontext *cx, js::handle<js::value> v1, js::handle<js::value> v2, bool *same); // obsolete since jsapi 39 bool js_samevalue(jscontext *cx, jsval v1, jsval v2, bool *same); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1 js::handle<js::value> / jsval the first value. v2 js::handle<js::value> / jsval the second value.
description js_samevalue determines whether two values ar...
JS_SaveExceptionState
saves the exception state from the specified context. syntax jsexceptionstate * js_saveexceptionstate(jscontext *cx); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description saves the current exception state (that is, any pending exception, or a cleared exception state) associated with the specified context cx, and returns a jsexceptionstate object holding this state. that object may then be used to restore again the context using js_restoreexceptionstate, or discarded using js_dropexceptionstate. either of those two functions frees any memory used by the jsexceptionstate. the jsexceptionstate created by this ...
JS_SaveFrameChain
after a call to js_saveframechain, it looks as if there is no code running on cx. before calling js_restoreframechain, cx's call stack must be balanced and all nested calls to js_saveframechain must have had matching js_restoreframechain calls. ...
JS_SealObject
_sealobject. moreover, js_sealobject's exact semantics are subtly incompatible with ecmascript. js_freezeobject and js_deepfreezeobject are near-substitutes compatible with ecmascript semantics, implementing semantics compatible with those of object.freeze. prevent modification of object fields. syntax jsbool js_sealobject(jscontext *cx, jsobject *obj, jsbool deep); name type
description cx jscontext * a context. obj jsobject * the object to seal. deep jsbool if true, seal all objects directly or indirectly reachable from obj's slots.
description js_sealobject prevents all write access to the object, either to add a new property, delete an existing property, or set the value or attributes of an existing property. see also bug 49...
JS_SetAllNonReservedSlotsToUndefined
this article covers features introduced in spidermonkey 24 assign undefined to all of the object's non-reserved slots. note: this is done for all slots, regardless of the associated property descriptor. syntax void js_setallnonreservedslotstoundefined(jscontext *cx, jsobject *objarg); name type
description cx jscontext * the context in which to clear the object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object from which to delete all properties.
description js_setallnonreservedslotstoundefined assignes undefined to all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. properties belonging to objects on obj...
JS_SetCheckObjectAccessCallback
set the runtime-wide check-object-access callback. this function is deprecated. in spidermonkey 1.8.1 and later, use js_setruntimesecuritycallbacks instead. syntax jscheckaccessop js_setcheckobjectaccesscallback( jsruntime *rt, jscheckaccessop acb); name type
description rt jsruntime * the runtime to configure. acb jscheckaccessop the new check-object-access callback.
description js_setcheckobjectaccesscallback sets the runtime-wide check-object-access callback, which is used as the fallback jsclass.checkaccess method for all classes that leave the checkaccess field null. this callback is also used to check access to the caller property of function objects (as, for example, when the javascript engine creates a stack trace) and to check access from scripts to properties with scripted ...
JS_SetDefaultLocale
this article covers features introduced in spidermonkey 24 set and reset the default locale for the ecmascript internationalization api. syntax bool js_setdefaultlocale(jsruntime *rt, const char *locale); void js_resetdefaultlocale(jsruntime *rt); name type
description rt jsruntime * pointer to a js runtime locale const char * string represents locale.
description js_setdefaultlocale sets the default locale for the ecmascript internationalization api (intl.collator, intl.numberformat, intl.datetimeformat). note that the internationalization api encourages clients to specify their own locales. the locale string remains owned by the caller. js_resetdefaultlocale resets the default locale to os defaults. see also mxr id search fo...
JS_SetExtraGCRoots
the trace operation. this is described below. data closure pointer, to be passed through to traceop. callback syntax typedef void jstracedataop (jstracer *trc, void *data); argument meaning trc tracing data, to be passed through to js_calltracer. data closure pointer. this is the data value that was passed to js_setextragcroots when this callback function was installed. callback
description generic trace operation that calls js_calltracer on additional traceable things. ...
JS_SetGCParametersBasedOnAvailableMemory
this article covers features introduced in spidermonkey 31 adjust performance parameters related to garbage collection based on available memory. syntax void js_setgcparametersbasedonavailablememory(jsruntime *rt, uint32_t availmem); name type
description rt jsruntime * the runtime to configure. value uint32_t the value of available memory in megabytes.
description js_setgcparametersbasedonavailablememory adjusts the parameters of the garbage collection based on available memory. see bug 950044 for details. see also mxr id search for js_setgcparametersbasedonavailablememory js_setgcparameter bug 950044 ...
JS_SetGCZeal
this article covers features introduced in spidermonkey 1.8 enable gc zeal, a testing and debugging feature that helps find gc-related bugs in jsapi applications. syntax void js_setgczeal(jscontext *cx, uint8_t zeal, uint32_t frequency); name type
description cx jscontext * a context. the gc zeal level of the associated jsruntime is set. zeal uint8_t the desired level of garbage collection. frequency uint32_t with some zeal levels, a gc is triggered every frequency allocations.
description js_setgczeal sets the level of additional garbage collection to perform for a runtime, for the purpose of finding or reproducing bugs. there are several different levels which have different functions: zeal level de...
JS_SetGlobalObject
obsolete since jsapi 25this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. set a context's global object. syntax void js_setglobalobject(jscontext *cx, jsobject *obj); name type
description cx jscontext * the context to configure. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * pointer to the object to set as the global object, or null.
description this function is obsolete; see also js_getglobalobject. js_setglobalobject sets the global object of the context cx to obj. if obj is null, the context is set to have no global object. each context's global object is in the ga...
JS_SetICUMemoryFunctions
sets the memory allocation and deallocation functions used by the icu internationalization library. syntax bool js_seticumemoryfunctions(js_icuallocfn allocfn, js_icureallocfn reallocfn, js_icufreefn freefn); type
description allocfn js_icuallocfn an allocation function. reallocfn js_icureallocfn a reallocation function. freefn js_icufreefn a free function.
description js_seticumemoryfunctions sets the allocator functions used by the icu internationalization library. it must be called before js_init. only use this function if you know what you are doing! mxr id search for js_seticumemoryfunctions. ...
JS_SetObjectPrincipalsFinder
set the runtime-wide object-principals-finder callback. this function is deprecated. in spidermonkey 1.8.1 or later, use js_setruntimesecuritycallbacks instead. syntax jsobjectprincipalsfinder js_setobjectprincipalsfinder(jsruntime *rt, jsobjectprincipalsfinder fop); name type
description rt jsruntime * the runtime to configure. fop jsobjectprincipalsfinder the new object-principals-finder callback.
description js_setobjectprincipalsfinder allows the application to set a callback that the javascript engine uses to obtain an object's principals. this callback is described in jsobjectprincipalsfinder. js_setobjectprincipalsfinder returns the previous object-principals-finder callback. mxr id search for js_setobjectprincipalsfinder ...
JS_SetParent
obsolete since jsapi 39this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. sets the parent for an object. syntax bool js_setparent(jscontext *cx, js::handleobject obj, js::handleobject parent); name type
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject pointer to the object for which to set the parent. this must be an object that has not yet been exposed to script. see the
description for details. parent js::handleobject pointer to the parent object to use. descript...
JS_SetPrincipalsTranscoder
set the runtime-wide principals transcoder callback. this function is deprecated. in spidermonkey 1.8.1 or later, use js_setruntimesecuritycallbacks instead. syntax jsprincipalstranscoder js_setprincipalstranscoder(jsruntime *rt, jsprincipalstranscoder px); name type
description rt jsruntime * the runtime to configure. px jsprincipalstranscoder the new principals transcoder.
description js_setprincipalstranscoder sets a runtime-wide callback which the javascript engine uses to serialize and deserialize principals. this callback is described at jsprincipalstranscoder. js_setprincipalstranscoder returns the previous principals transcoder. mxr id search for js_setprincipalstranscoder ...
JS_SetPrototype
set a javascript object's prototype. syntax bool js_setprototype(jscontext *cx, js::handleobject obj, js::handleobject proto); name type
description cx jscontext * the context in which to set the object's prototype. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to modify. proto js::handleobject the object to set as the new prototype of obj.
description js_setprototype sets the prototype object for a specified object. a prototype object provides properties that are shared by similar js object instances. ordinarily you set a prototype for an object when you create the object with js_newobject, but if you do not set a prototype at that time, you can later...
JS_SetRegExpInput
set the pending regexp input. syntax bool js_setregexpinput(jscontext *cx, js::handleobject obj, js::handlestring input, bool multiline); name type
description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject a pointer to a global object. input js::handlestring a pointer to the input string. multiline bool true if input is multiline.
description js_setregexpinput sets the pending input string of the built-in regexp object to the specified input string. the jsreg_multiline is set to multiline parameter, and other flags are all reset. on successful, js_setregexpinput returns true, otherwise re...
JS_SetVersion
obsolete since jsapi 25this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. configure a jscontext to use a specific version of the javascript language. syntax jsversion js_setversion(jscontext *cx, jsversion version); name type
description cx jscontext * pointer to a js context from which to derive runtime information. version jsversion version of javascript to set context to.
description js_setversion attempts to set the version of javascript to version for a specified executable script context, cx. the version comes from the jsversion enumerated type. js_setversion returns the js version in effect for the context before you change...
JS_SetVersionForCompartment
this article covers features introduced in spidermonkey 31 configure a jscompartment to use a specific version of the javascript language. syntax void js_setversionforcompartment(jscompartment *compartment, jsversion version); name type
description compartment jscompartment * pointer to a js compartment. version jsversion version of javascript to set compartment to.
description js_setversionforcompartment attempts to set the version of javascript to version for a specified compartment, compartment. the version comes from the jsversion enumerated type. see also mxr id search for js_setversionforcompartment jsversion js_getversion js_versiontostring js_stringtoversion bug 880917 ...
JS_ShutDown
this method should be called after all other jsapi data has been properly cleaned up: every jsruntime created with js_newruntime must have been destroyed with js_destroyruntime, every jscontext created with js_newcontext must have been destroyed with js_destroycontext, and so on. calling this method before all other resources have been destroyed has undefined behavior. ...
JS_StringEqualsAscii
this article covers features introduced in spidermonkey 1.8.5 compare flat string and ascii string. syntax bool js_stringequalsascii(jscontext *cx, jsstring *str, const char *asciibytes, bool *match); bool js_flatstringequalsascii(jsflatstring *str, const char *asciibytes); name type
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsflatstring * string to compare. asciibytes const char * ascii string to compare with. match bool * (js_stringequalsascii only) out parameter. received the comparison result.
description js_stringequalsascii and js_flatstringequalsascii compare string str and ascii string asciibytes. on s...
JS_StringHasBeenInterned
this article covers features introduced in spidermonkey 17 determine if string is interned. syntax bool js_stringhasbeeninterned(jscontext *cx, jsstring *str); name type
description str jsstring * a string to examine.
description js_stringhasbeeninterned returns true if the string str is interned. see also mxr id search for js_stringhasbeeninterned bug 724810 ...
JS_StringIsFlat
this article covers features introduced in spidermonkey 38 determine if a string is flattened. syntax bool js_stringisflat(jsstring *str); name type
description str jsstring * string to examine.
description js_stringisflat returns true if the string is flattened. see also mxr id search for js_stringisflat bug 1037869 ...
JS_StringToVersion
returns a jsversion value representing the version string. syntax jsversion js_stringtoversion(const char *string); name type
description string const char * version string to convert.
description js_stringtoversion attempts to convert the version string to a jsversion value. js_stringtoversion may return any of the following values: string enumeration "1.0" jsversion_1_0 obsolete since jsapi 24 "1.1" jsversion_1_1 obsolete since jsapi 24 "1.2" jsversion_1_2 obsolete since jsapi 24 "1.3" jsversion_1_3 obsolete since jsapi 24 "1.4" jsversion_1_4 obsolete since jsapi 24 "ecmav3" jsversion_ecma_3 "1.5" jsversion_1_5 obsolete since jsapi 24 "1.6" jsversion_1_...
JS_ToggleOptions
obsolete since jsapi 27this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. toggle specified options on a jscontext. syntax uint32 js_toggleoptions(jscontext *cx, uint32 options); name type
description cx jscontext * a context on which to modify options. options uint32 the set of options to toggle. this is the logical or of zero or more flags described at js_setoptions.
description js_toggleoptions toggles context-wide options. it is equivalent to js_setoptions(cx, js_getoptions(cx) ^ options). see also mxr id search for js_toggleoptions js_setoptions js_getoptions bug 880330 ...
JS_Unlock
obsolete since jsapi 12this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. unlock a previously locked js run-time environment. syntax void js_unlock(jsruntime *rt); name type
description rt jsruntime * pointer to the runtime to unlock.
description js_unlock is a deprecated api; don't use it. mxr id search for js_unlock ...
JS_ValueToBoolean
obsolete since jsapi 28this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. replaced by js::toboolean convert any javascript value to a boolean value. syntax jsbool js_valuetoboolean(jscontext *cx, jsval v, jsbool *bp); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. bp jsbool * out parameter. on success, *bp receives the converted boolean value.
description js_valuetoboolean converts a specified javascript value, v, to a boolean value. it implements the tobool...
JS_ValueToFunction
convert a js::value to a jsfunction. syntax jsfunction * js_valuetofunction(jscontext *cx, js::handlevalue v); jsfunction * js_valuetoconstructor(jscontext *cx, js::handlevalue v); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert.
description js_valuetofunction converts a specified javascript value, v, to a function. js_valuetoconstructor is the exactly same function as js_valuetofunction. this conversion is dangerous and almost entirely useless, because the resulting jsfunction is not a real function object and therefore cannot be safely passed to any other jsapi function...
JS_ValueToInt32
obsolete since jsapi 28this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. convert a javascript value to a 32-bit signed integer. syntax jsbool js_valuetoint32(jscontext *cx, jsval v, int32 *ip); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. ip int32 * out parameter. on success, *ip receives the converted integer value.
description js_valuetoint32 converts a specified js value, v, to a 32-bit signed integer (-2147483648 to 2147483647). first it converts v to a ...
JS_ValueToNumber
obsolete since jsapi 24this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. replaced by js::tonumber. convert any javascript value to a floating-point number of type jsdouble. syntax jsbool js_valuetonumber(jscontext *cx, jsval v, jsdouble *dp); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. dp jsdouble * out parameter. on success, *dp receives the converted floating-point value.
description js_valuetonumber converts a javascript value to a number. it implemen...
JS_ValueToObject
converts any javascript value to an object. syntax bool js_valuetoobject(jscontext *cx, js::handlevalue v, js::mutablehandleobject objp); name type
description cx jscontext * the context in which to convert the value. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. objp js::mutablehandleobject out parameter. on success, *objp receives null or a pointer to the resulting object.
description js_valuetoobject converts a specified javascript value, v, to an object. on success, this function stores either null or a pointer to the resulting object in *objp and returns true. otherwise it returns false and the value left in *objp is unspecified...
JS_ValueToString
obsolete since jsapi 28this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. convert a jsval to a jsstring. syntax jsstring * js_valuetostring(jscontext *cx, jsval v); name type
description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert.
description js_valuetostring converts a specified javascript value, v, to a string. it implements the tostring operator specified in ecma 262-3 §9.8. the result is like the javascript expression ""+v. if v is already a string, conversion succeeds. if v is true, f...
JS_VersionToString
returns a string representation of a jsversion value. syntax const char * js_versiontostring(jsversion version); name type
description version jsversion version value to convert.
description js_versiontostring attempts to convert the version to a const char * string representation. js_versiontostring may return any of the following values: enumeration string jsversion_1_0 "1.0" obsolete since jsapi 24 jsversion_1_1 "1.1" obsolete since jsapi 24 jsversion_1_2 "1.2" obsolete since jsapi 24 jsversion_1_3 "1.3" obsolete since jsapi 24 jsversion_1_4 "1.4" obsolete since jsapi 24 jsversion_ecma_3 "ecmav3" jsversion_1_5 "1.5" obsolete since jsapi 24 jsversion_1_6 ...
JS_YieldRequest
obsolete since jsapi 18this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. momentarily suspend the current jsapi request, allowing garbage collection to run if another thread has requested it. syntax void js_yieldrequest(jscontext *cx); name type
description cx jscontext * the jscontext that is currently in a request on the calling thread. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
description for more information about thread safety and requests, see js_threadsafe. js_yieldrequest momentarily suspends the current request. a program can call this function periodically to ensure that a long-run...
JS_freeop
this article covers features introduced in spidermonkey 17 a wrapper for js_free. syntax void js_freeop(jsfreeop *fop, void *p); name type
description fop jsfreeop * a pointer to jsfreeop structure to be used to get the implementation of free. p void * a pointer to the allocated memory to be freed.
description js_freeop is a wrapper for js_free(p) that may delay js_free(p) invocation as a performance optimization as specified by the given jsfreeop instance. see also mxr id search for js_freeop jsfreeop js_free bug 737365 ...
OBJECT_TO_JSVAL
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. casts a specified js object to a js value. please use js::objectvalue/js::objectornullvalue instead in spidermonkey 45 or later. syntax jsval object_to_jsval(jsobject *obj); name type
description obj jsobject * a pointer to a javascript object to convert to a jsval.
description object_to_jsval casts obj from type jsobject * to jsval. if obj is null, the result is jsval_null. see also mxr id search for object_to_jsval js_valuetoobject js::objectvalue js::objectornullvalue bug 1177892 -- removed ...
PRIVATE_TO_JSVAL
jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. cast raw void * pointers to type jsval and vice versa. please use js::privatevalue instead in spidermonkey 45 or later. syntax jsval private_to_jsval(void *ptr); void * jsval_to_private(jsval v); // obsoleted since jsapi 32
description with private_to_jsval(), an application can store a private data pointer, p, as a jsval. this can be useful with reserved slots. the private data pointer can point to application-defined memory of any type, but the pointer must be two-byte-aligned (that is, (int) p must be even). private data is managed entirely by the application. the javascript engine itself never uses a private data pointer...
Property attributes
efined in the ecmascript standard, in ecma 262-3 §8.6.1. spidermonkey additionally defines several non-standard property attributes. the jsapi expresses property attributes as a value of type unsigned, the bitwise or of zero or more of the jsprop flags described below. an application can set property attributes when creating a property. see js_defineproperty, js_fs, and js_fn flag
description jsprop_enumerate the property is visible to javascript for...in and for each ... in loops, as well as to js_enumerate. this is the inverse of the ecma standard dontenum attribute. mxr id search for jsprop_enumerate jsprop_readonly the property's value cannot be set. in javascript 1.2 and lower, it is an error to attempt to assign a value to a read-o...
STRING_TO_JSVAL
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. casts a specified js string to a js value. please use js::stringvalue instead in spidermonkey 45 or later. syntax jsval string_to_jsval(jsstring *str) name type
description obj jsstring * a pointer to a js string to convert to a jsval.
description string_to_jsval casts a given jsstring * to jsval. str must be a non-null pointer of type jsstring *. the conversion always succeeds. see also mxr id search for string_to_jsval js::stringvalue bug 1177892 -- removed ...
jsint
/c++ integer types. syntax typedef ... jsint; typedef ... jsuint; typedef ... jsword; typedef ... jsuword; typedef ... intn; typedef ... uintn; // following types are still provides in js/public/legacyinttypes.h, // but should not use them. typedef ... int8; typedef ... uint8; typedef ... int16; typedef ... uint16; typedef ... int32; typedef ... uint32; typedef ... int64; typedef ... uint64;
description jsint and jsuint are 32-bit integer types. jsword and jsuword are pointer-sized integer types. intn and uintn are integer types the same size as the platform's native int type. see also bug 714728 - removes jsword/jsuword bug 730511 - removes intn/uintn bug 732306 - removes jsint bug 733260 - removes jsuint bug 708735 - deprecates {u,}int{8,16,32,64} ...
Parser API
g returns a program object (see below) representing the parsed abstract syntax tree (ast). additional options may be provided via the options object, which can include any of the following properties: loc boolean default: true when loc is true, the parser includes source location information in the returned ast nodes. source string default: null a
description of the input source; typically a filename, path, or url. this string is not meaningful to the parsing process, but is produced as part of the source location information in the returned ast nodes. line number default: 1 the initial line number to use for source location information. builder builder default: null a builder object, which can be u...
Shell global objects
le only in nightly build objectaddress(obj) return the current address of the object. for debugging only--this address may change during a moving gc. sharedaddress(obj) return the address of the shared storage of a sharedarraybuffer. functions available only in debug build dumpobject() dump an internal representation of an object. dumpstringrepresentation(str) print a human-readable
description of how the string str is represented. setrngstate(seed0, seed1) set this compartment's rng state. functions available only in debug build or js_oom_breakpoint is defined oomthreadtypes() get the number of thread types that can be used as an argument for oomafterallocations() and oomatallocation(). oomafterallocations(count [,threadtype]) after count js_malloc memory allocations, fail ev...
SpiderMonkey: The Mozilla JavaScript runtime
ning automated javascript tests how to run the javascript test suites. creating javascript tests how to add tests to the javascript test suites. reference jsapi reference spidermonkey api reference. js debugger api reference api reference for the debugger object introduced in spidermonkey 1.8.6, which corresponds to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5). bytecode
descriptions listing of spidermonkey's bytecodes. parser api reflection of the spidermonkey parser, made available as a javascript api. tips, tricks and philosophy future directions future directions for functionality, design, and coding practices. spidermonkey internals a design overview and a file-by-file walkthrough of the implementation. bytecode reference spidermonkey bytecode reference. s...
Handling Mozilla Security Bugs
he bug. however, members of the mozilla security bug group employed by a distributor of mozilla-based products may share such information within that distributor, provided that this information is shared only with those who have a need to know, to the extent they need to know, and that such information is labeled and treated as the organization generally treats confidential material. not to post
descriptions of exploits in public forums like newsgroups. to be careful in whom they add to the cc field of a bug (since all those cc'd on a security bug potentially have access to the complete bug report). when a bug is put into the security bug group, the group members, bug reporter, and others associated with the bug will decide by consensus, either through comments on the bug or the group mailing lis...
Gecko states
off state_sizeable the object can be resized. for example, a user could change the size of a window by clicking the border with a mouse and dragging the mouse. state_moveable indicates that the object can be moved. for example, a user can click on the titlebar for the object and drag the object to a new location. state_selfvoicing the object or child uses text-to-speech (tts) technology for
description purposes. a speech-based accessibility aid does not announce information when an object with this state has the focus because the object automatically announces information. isn't used state_focusable the object can be focused. applied to: events: concomitant state: state_focused state_selectable the object can be selected. applied to: events: concomitant state: state_selected...
extIExtension
rs features introduced in thunderbird 3 the extiextension interface represents an extension. extiextension is defined in toolkit/components/exthelper/extiapplication.idl. implemented via xpcom service for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages. method overview fixme: attributes attribute type
description id readonly attribute astring the id of the extension. name readonly attribute astring the name of the extension. enabled readonly attribute boolean true if the extension is currently enabled. version readonly attribute astring the version number of the extension. firstr...
extIPreferenceBranch
e instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages. method overview boolean has(in astring aname) extipreference get(in astring aname) nsivariant getvalue(in astring aname, in nsivariant adefaultvalue) void setvalue(in astring aname, in nsivariant avalue) void reset() attributes attribute type
description root readonly attribute astring the name of the branch root. all readonly attribute nsivariant array of extipreference listing all preferences in this branch. events readonly attribute extievents the events object for the preferences supports: "change" methods has() check to see if a preference exists. boolean has(in astring aname) paramete...
extISessionStorage
uel (firefox), steel (thunderbird) and smile (seamonkey) pages. method overview these methods are usually accessed via application.storage. return type method boolean has(in astring aname) void set(in astring aname, in nsivariant avalue) nsivariant get(in astring aname, in nsivariant adefaultvalue) attributes attribute type
description events readonly attribute extievents the events object for the storage supports: "change" methods has() determines if a storage item exists with the given name. boolean has(in astring aname) parameters aname the name of an item return value true if an item exists with the given name, false otherwise. set() sets the value of a storage item with the given name. ...
Generic factory
pcom factories can be very simple. rick potts wrote a templated-based generic factory (nsfactory<t>) that simplifies the factory creation process that just requires writing a createinstance() method. the new nsigenericfactory interface takes this a step further, by providing a single interface that can be reused anytime a simple implementation of nsifactory is needed. here is the interface, and a
description of its use. /** * provides a generic nsifactory implementation that can be used by * dlls with very simple factory needs. */ class nsigenericfactory : public nsifactory { public: static const nsiid& iid() { static nsiid iid = ns_igenericfactory_iid; return iid; } typedef ns_callback(constructorprocptr) (nsisupports *aouter, refnsiid aiid, void **aresult); /** * establishes ...
An Overview of XPCOM
usually contained in reusable binary libraries (a dll on windows, for example, or a dso on unix), which can include one or more components. when two or more related components are grouped together in a binary library, the library is referred to as a module. modular, component-based programming makes software easier to develop and maintain and has some well-known advantages: benefit
description reuse modular code can be reused in other applications and other contexts. updates you can update components without having to recompile the whole application. performance when code is modularized, modules that are not necessary right away can be "lazy loaded", or not loaded at all, which can improve the performance of your application. maintenance ...
Starting WebLock
representing that file: nsembedcstring filename("weblock.txt"); appdir->appendnative(filename); manipulating files with nsifile once you have an nsifile object pointing to the file that you're interested in, you can open it and read its contents into memory. there are many ways to do this: you can use standard ansi file i/o, or nspr (see the netscape portable runtime library below for a brief
description of nspr), or you can use the networking apis that gecko provides. the netscape portable runtime library thenetscape portable runtime library (nspr) is a platform-independent library that sits below xpcom. as a layer of abstraction above the operating system, the nspr allows gecko applications to be platform independent by providing the following system-level facilities: threads thread sync...
Using XPCOM Utilities to Make Things Easier
mplementation code and leave you working on the actual logic for your component. note that all of the macros described in this section are similar but are used in slightly different situations. some differ only in whether or not a method is called when the module is created and/or destroyed. xpcom module macros lists the macros discussed in this section. xpcom module macros macro
description ns_impl_nsgetmodule(name, components) implements the nsimodule interface with the module name of name and the component list in components. ns_impl_nsgetmodule_with_ctor(name, components, ctor) same as above but allows for a special function to be called when the module is created. ns_impl_nsgetmodule_with_dtor(name, components, dtor) same as the first macro bu...
Interfacing with the XPCOM cycle collector
if you have a class that you think is involved in a cyclical-ownership leak, this page is for you. the intended audience is mozilla c++ developers. what the cycle collector does the cycle collector spends most of its time accumulating (and forgetting about) pointers to xpcom objects that might be involved in garbage cycles. ...
Components.Constructor
it eliminates the clutter of typing components.classes, components.interfaces, createinstance, and so on every time you wish to create an instance. it also gives creation of xpcom objects more javascript-like syntax. another important benefit is that it precomputes some of the computation it does, so using a...
Components.ID
summary components.id is a constructor that creates native objects that conform to the nsijsid interface. syntax var interfaceid = [ new ] components.id(iid); parameters iid a string of the format '{00000000-0000-0000-0000-000000000000}' giving the interface id of the interface
description components.id creates interface ids for use in implementing methods like queryinterface, getinterfaces, and other methods that take interface ids as parameters. components.classes, components.classesbyid, components.interfaces provide pretty much all the nsids that most javascript code would ever need to deal with. the exception to this is the case where a component is written in javascript and needs to register itself with the component manager using its own nsid - an id that is not already reg...
Components.interfacesByID
components.interfacesbyid is a read-only array of classes indexed by iid. introduction components.interfacesbyid is a read-only array of objects which implement the nsijsiid interface. each object represents one of the xpcom interfaces -- that some component or another might or might not implement. it reflects only those interfaces which have been designated in their .idl
description as [scriptable], i.e. the interfaces which xpconnect is capable of reflecting into javascript. components.interfacesbyid is exactly like components.interfaces except that the elements are indexed by the canonical form of their iid. usage you can retrieve an interface object using: var iface = components.interfacesbyid["{aa610f20-a889-11d3-8c81-000064657374}"]; ...
Components.isSuccessCode
summary determines whether a given xpcom return code (that is, an nsresult value) indicates the success or failure of an operation, returning true or false respectively. syntax var succeeded = components.issuccesscode(returncode); parameters returncode the return code (of type nsresult) to be checked.
description components.issuccesscode() may be used to determine whether an xpcom return code (an nsresult) indicates success or failure. an xpcom return code indicates success if its high-order bit is 0, and it indicates failure if its high-order bit is 1. note: a non-zero xpcom return code (that is, not ns_ok) does not necessarily indicate failure. components.issuccesscode() is functionally equivalent to the following javascript: function issuccesscode(returncode) { return (ret...
XPConnect wrappers
for practical advice on dealing with wrappers, see safely accessing content dom from chrome. developers in the know understand that wrappers play a large role in xpconnect, and that we have a lot of them. less informed developers understand that wrappers exist and are somehow important, but they don't know when they should use what wrappers, or if they should be seeing a wrapper. note: wrappers can appear in the console log; for example "[object xraywrapper [object blah]]". ...
nsSupportsWeakReference
#include "nsweakreference.h" class nssupportsweakreference { ... }; remarks in addition to inheriting from this class, you will need to ensure that your nsisupports::queryinterface implementation exposes nsisupportsweakreference as a supported interface. to use this class, you must link your component or application against the xpcom glue library. example code // supporting weak references to a hypothetical implementation // of the nsifoo interface... ...
amIInstallTrigger
nstallcallback acallback); boolean installchrome(in pruint32 atype, in astring aurl, in astring askin); deprecated since gecko 2.0 boolean startsoftwareupdate(in astring aurl, [optional] in print32 aflags); deprecated since gecko 2.0 boolean updateenabled(); deprecated since gecko 2.0 constants retained for backwards compatibility. constant value
description skin 1 locale 2 content 4 package 7 methods enabled() tests if installation is enabled. boolean enabled(); parameters none. return value install() starts a new installation of a set of add-ons. boolean install( in nsivariant aargs, in amiinstallcallback acallback optional ); parameters aargs the add-o...
amIWebInstallInfo
tion of amiwebinstalllistener to communicate with the running application and allow it to warn the user about blocked installs and start the installs running. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void install(); attributes attribute type
description installs nsivariant an array of addoninstall objects. read only. originatinguri nsiuri the uri that started the installs. for example, the referring page for a link to an xpi download. read only. originatingwindow nsidomwindow the window that started the installs. read only. note: prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey ...
imgILoader
imgirequest loadimage( in nsiuri auri, in nsiuri ainitialdocumenturl, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup aloadgroup, in imgidecoderobserver aobserver, in nsisupports acx, in nsloadflags aloadflags, in nsisupport...
inIDOMUtils
value state 1 :active 2 :focus 4 :hover 8 :-moz-drag-over 16 :target 1<<29 :-moz-focusring methods getbindingurls() returns an array of nsiuri object...
jsdIStackFrame
hat handler the bottom frame, and any frame you found attached through it, are invalidated via the jsdiephemeral interface. once a jsdistackframe has been invalidated all method and property accesses will throw a ns_error_not_available exception. method overview boolean eval(in astring bytes, in autf8string filename, in unsigned long line, out jsdivalue result); attributes attribute type
description callee jsdivalue function object running in this stack frame. read only. callingframe jsdistackframe link to the caller's stack frame. read only. executioncontext jsdicontext executon context. read only. functionname autf8string function name executing in this stack frame. read only. isconstructing boolean true if stack frame is constructing a new object. read only. isdebugger boolean...
mozIJSSubScriptLoader
d as an object, and a new ignorecache option is available. note: this method must only be called from javascript! jsval loadsubscriptwithoptions( in string url, in object options ); parameters url the url pointing to the script to load. it must be a local chrome:, resource: or file: url. options an object that may include any of these parameters: property type
description target object the object to use as the scope object for the script being executed. it defaults to the global object of the caller. note: undeclared variables in the loaded script will be created as global variables in the caller (ie.: in the caller's global object). this object will be searched for variables that cannot be resolved in the subscript scope. charset ...
mozIPersonalDictionary
read only. methods addcorrection() adds a misspelling to the list of corrections. note that this method is not currently implemented. void addcorrection( in wstring word, in wstring correction, in wstring lang ); parameters word the incorrect spelling of the word to add to the list of corrections. correct...
mozIPlaceInfo
warning: this interface is experimental and will change after gecko 2.0. toolkit/components/places/public/moziasynchistory.idlscriptable this interface provides additional info for a places entry 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type
description frecency long read only: the frecency of the place. guid string read only: the globally unique id of the place. placeid long read only: the machine-local (internal) id of the place. title string read only: the title associated with the place. uri nsiuri read only: the uri of the place. visits mozivisitinfo[] read only: an array of mozivisitinfo objects for the place. see also moziasynchistory ...
mozIPlacesAutoComplete
the places autocomplete search provider as well as methods to track opened pages for autocomplete purposes. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void registeropenpage(in nsiuri auri); void unregisteropenpage(in nsiuri auri); constants constant value
description match_anywhere 0 match anywhere in each searchable term. match_boundary_anywhere 1 match first on word boundaries, and if we do not get enough results, then match anywhere in each searchable term. match_boundary 2 match on word boundaries in each searchable term. match_beginning 3 match only the beginning of each search term. behavior_history 1 << 0 search through history. behavior_bo...
mozISpellCheckingEngine
not currently used. read only. dictionary wstring the name of the current dictionary used by check() and suggest(). this will be either element from the array returned by getdictionarylist() or an empty string if no dictionary is selected. note: se...
mozIStorageBindingParamsArray
article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports you can only create these objects by calling the mozistoragestatement.newbindingparamsarray(). method overview void addparams(in mozistoragebindingparams aparameters); mozistoragebindingparams newbindingparams(); attributes attribute type
description length unsigned long the number of mozistoragebindingparams objects in the array. methods addparams() adds the specified set of parameters to the end of the array. the appended parameters will be used when mozistoragestatement.executeasync() is called. void addparams( in mozistoragebindingparams aparameters ); parameters aparameters the mozistoragebindingparams o...
mozIStorageStatementCallback
criptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void handlecompletion(in unsigned short areason); void handleerror(in mozistorageerror aerror); void handleresult(in mozistorageresultset aresultset); constants constant value
description reason_finished 0 the statement has finished executing normally. reason_canceled 1 the statement stopped executing because it was canceled. reason_error 2 the statement stopped executing because an error occurred. methods handlecompletion() called when a statement finishes executing. void handlecompletion( in unsigned short areason ); param...
mozIStorageStatementWrapper
orage/public/mozistoragestatementwrapper.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void initialize(in mozistoragestatement astatement); void reset(); boolean step(); void execute(); attributes attribute type
description statement mozistoragestatement the statement that is wrapped. row mozistoragestatementrow the current row. throws an exception if no row is currently available. useful only from script. the value of this is only valid while the statement is still executing, and is still on the appropriate row. params mozistoragestatementparams the parameters; these can...
mozIStorageVacuumParticipant
. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) to create an instance of this interface, use the category manger, with the category "vacuum-participant". add more details here. method overview boolean onbeginvacuum(); void onendvacuum(in boolean asucceeded); attributes attribute type
description databaseconnection mozistorageconnection a connection to the database file to be vacuumed. expecteddatabasepagesize long the expected page size, in bytes, for the database. the vacuum manager will try to correct the page size when the browser is idle, using this value as a target. valid page sizes are in the range 512 to 65,536. the recommended value is mozistorageconnection::default_page_si...
mozITXTToHTMLConv
void findurlinplaintext(in wstring text, in long alength, in long apos, out long astartpos, out long aendpos) wstring scanhtml(in wstring text, in unsigned long whattodo) wstring scantxt(in wstring text, in unsigned long whattodo) constants conversion control attributes these bits allow you to control the conversion of text into html. constant type
description kentities unsigned long enables conversion of basic special characters to html entities. this applies to "<", "&", and ">" (which are converted to <, &, and >, respectively). kglyphsubstitution unsigned long enables conversion of smilies and non-ascii special characters. kstructphrase unsigned long enables conversion of text attributes, such ...
mozIThirdPartyUtil
case of ip addresses, host aliases such as 'localhost', or a file:// uri), an exact string comparison on host is performed. for example, the uri "http://mail.google.com/" is not third party with respect to "http://images.google.com/", but "http://mail.yahoo.com/" and "http://192.168.1.1/" are. boolean isthirdpartyuri( in nsiuri afirsturi, in nsiuri aseconduri ); parameters afirsturi missing
description aseconduri missing
description return value true if afirsturi is third party with respect to aseconduri. isthirdpartywindow() determine whether the given window hierarchy is third party. this is done as follows: obtain the uri of the principal associated with awindow. call this the 'bottom uri'. if auri is provided, determine if it is third party with respect to the bottom uri. if so, return. ...
mozIVisitInfo
this may be null. sessionid long read only: the sessionid of this visit. ...
nsIAbCard
py(in nsiabcard srccard) boolean equals(in nsiabcard card) string converttobase64encodedxml() astring converttoxmlprintdata() string converttoescapedvcard() astring generatename(in long agenerateformat,[optional] in nsistringbundle abundle) astring generatephoneticname(in boolean alastnamefirst) attributes attribute type
description firstname astring lastname astring phoneticfirstname astring phoneticlastname astring displayname astring nickname astring primaryemail astring secondemail astring workphone astring homephone astring faxnumber astring...
nsIAboutModule
erface is implemented to add an 'about:' page. the contract id ends with a parameter that corresponds to the name of the about page. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview unsigned long geturiflags(in nsiuri auri); nsichannel newchannel(in nsiuri auri); constants constant value
description uri_safe_for_untrusted_content (1 << 0) a flag that indicates whether a uri is safe for untrusted content. if it is, web pages and so forth will be allowed to link to this about: uri. otherwise, only chrome will be able to link to it. allow_script (1 << 1) a flag that indicates whether script should be enabled for the given about: uri even if it's disabled in genera...
nsIAccessibleWin32Object
accessible/public/msaa/nsiaccessiblewin32object.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type
description hwnd voidptr handle to the external window implementing iaccessible. read only. native code only! ...
nsIAnnotationService
removed at application exit. expire_weeks 2 for general page settings, things the user is interested in seeing if they come back to this page some time in the near future. removed at 30 days. expire_months 3 something that the user will be interested in seeing in their histo...
nsIAppShell
read only. methods create() obsolete since gecko 1.9 (firefox 3) creates an application shell. void create( inout int argc, inout string argv ); parameters argc the number of parameters passed in on the command line. argv a direct reference to the parameter array. dispatchnati...
nsIApplicationCacheChannel
c/nsiapplicationcachechannel.idlscriptable this interface is implemented by communication channels that support application caches. 1.0 66 introduced gecko 1.9.1 inherits from: nsiapplicationcachecontainer last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void markofflinecacheentryasforeign(); attributes attribute type
description chooseapplicationcache boolean when true, the channel will choose an application cache if one was not explicitly provided and none is available from the notification callbacks. the default value is false. this attribute will not be transferred through a redirect. exceptions thrown ns_error_already_opened if set after calling asyncopen() on the channel. inheritapplicationcache boolean tru...
nsIApplicationCacheContainer
netwerk/base/public/nsiapplicationcachecontainer.idlscriptable this interface is used by objects that can be associated with an application cache. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type
description applicationcache nsiapplicationcache the application cache with which the object is associated. see also offline resources in firefox nsiapplicationcache nsiapplicationcachechannel nsiapplicationcacheservice nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsIApplicationUpdateService
read only. canapplyupdates boolean true if the update service can download and install updates. indicates if the current user has access privileges to the install directory. read only. cancheckforupdates boolean true if the update service can check for updates. application updates might be disa...
nsIArray
n nsimutablearray! null is a valid entry in the array, and as such any nsisupports parameters may be null, except where noted. method overview nsisimpleenumerator enumerate(); unsigned long indexof(in unsigned long startindex, in nsisupports element); void queryelementat(in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result); attributes attribute type
description length unsigned long the number of elements in the array. read only. methods enumerate() enumerate the array. nsisimpleenumerator enumerate(); parameters none. return value a new enumerator positioned at the start of the array. exceptions thrown ns_error_failure if the array is empty (to make it easy to detect errors). ns_error_out_of_memory if there is not enough memory to complete the op...
nsIAsyncInputStream
ssary that nsiinputstream.isnonblocking() return true. nor is it necessary that a non-blocking nsiinputstream implementation also implement nsiasyncinputstream. method overview void asyncwait(in nsiinputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult astatus); constants constant value
description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the oninputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the underlying stream). methods asyncwait() asynchronously wait for the stream to be readable or clos...
nsIAsyncOutputStream
ry that nsioutputstream.isnonblocking() return true. nor is it necessary that a non-blocking nsioutputstream implementation also implement nsiasyncoutputstream. method overview void asyncwait(in nsioutputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult reason); constants constant value
description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the onoutputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the underlying stream). methods asyncwait() asynchronously wait for the stream to be writable or clo...
nsIAuthModule
req_mutual_auth (1 << 0) client and server will be authenticated. req_delegate (1 << 1) the server is allowed to impersonate the client. the req_mutual_auth flag may also need to be specified in order for this flag to take effect. methods getnexttoken() this method is called to get the next token in a sequence of authentication steps. void getnexttoken( ...
nsIAuthPrompt
save_password_for_session 1 saves the password for the session. save_password_permanently 2 saves the password permanently. methods prompt() this method puts up a text input dialog with ok and cancel buttons. boolean prompt( in wstring dialogtitle, in wstring text, in wstring passwordrealm...
nsIAuthPrompt2
no security provided. level_pw_encrypted 1 password will be sent encrypted, but the connection is otherwise insecure. level_secure 2 the connection, both for password and data, is secure. methods asyncpromptauth() asynchronously prompt the user for a username and password. this has largely th...
nsIAuthPromptProvider
netwerk/base/public/nsiauthpromptprovider.idlscriptable this interface requests a prompt interface for the given prompt reason. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getauthprompt(in pruint32 apromptreason, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result); constants constant value
description prompt_normal 0 normal (non-proxy) prompt request. prompt_proxy 1 proxy authentication request. methods getauthprompt() this method requests a prompt interface for the given prompt reason. void getauthprompt( in pruint32 apromptreason, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result ); parameters apromptreason the reason for the authentication prompt, one of the prompt_* constants. iid the desired inter...
nsIChromeRegistry
converts a chrome url into a canonical representation by ensuring that the filename portion of the url is included, as in chrome://pack...
nsIClipboard
indclipboard(); constants most clipboard operations in firefox use kglobalclipboard, which is the one also used by the typical control-c/control-v keyboard shortcuts. the kselectionclipboard is peculiar to the x windows system, where it refers to the primary selection, which is the one that simple mouse selection and middle-click paste operations are using. constant value
description kselectionclipboard 0 clipboard for selection. kglobalclipboard 1 clipboard for global use. kfindclipboard 2 clipboard for find strings. methods emptyclipboard() this method empties the clipboard and notifies the clipboard owner. it empties the "logical" clipboard. it does not clear the native clipboard. void emptyclipboard( in long awhichc...
nsICommandLineRunner
lic/nsicommandlinerunner.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsicommandline method overview void init(in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state); void run(); void setwindowcontext(in nsidomwindow awindow); attributes attribute type
description helptext autf8string process and combine the help text provided by each command-line handler. read only. methods init() called with the argc/argv combination passed to main. it assumes a native character set. on windows the character set is utf-8, not the native codepage. void init( in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state ); parameters ar...
nsICompositionStringSynthesizer
this means that the clause is not converted. i.e., raw text of user input. attr_selectedrawtext 0x03 a clause attribute but this is typically not used. this means that the clause is not converted but selected to convert or modify. attr_convertedtext 0x04 a clause attribute. this means that the clause is alrea...
nsIConsoleMessage
sage.idlscriptable this interface is a base interface for messages passed to or from the nsiconsoleservice. inherits from: nsisupports last changed in gecko 1.7 implementations may provide an object that can be query interfaced, nsisupports.queryinterface(), to provide more specific message information. see nsiscripterror for an example. attributes attribute type
description message wstring the message in a string format. [binaryname(messagemoz)] read only. see also nsiconsoleservice ...
nsIContainerBoxObject
layout/xul/base/public/nsicontainerboxobject.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the boxobject belonging to a xul browser, editor or iframe element implements this interface. attributes attribute type
description docshell nsidocshell read only. the nsidocshell object that manages the contained document. the browser.xml, editor.xml and general.xml bindings use this property to gain access to other properties such as webnavigation, contentdocument and contentwindow. ...
nsIContentPref
name astring read only. value nsivariant read only. see also nsicontentprefservice2 nsicontentprefcallback2 ...
nsIContentPrefCallback2
this will be called exactly once for each method invocation, and afterward no other callback methods will be called. void handlecompletion( in unsigned short reason ); parameters reason one of the complete_* values indicating the manner in which the method...
nsIContentPrefService
useful for accessing and manipulating preferences in ways that are caller-specific or for which there is not yet a generic method, although generic functionality useful to multiple callers should generally be added to this unfrozen interface. also useful for testing the database creation...
nsIContentPrefService2
dom/interfaces/base/nsicontentprefservice2.idlscriptable asynchronous api for content preferences 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17)
description content preferences allow the application to associate arbitrary data, or "preferences", with specific domains, or web "content". specifically, a content preference is a structure with three values: a domain with which the preference is associated, a name that identifies the preference within its domain, and a value. (see nsicontentpref below.) for example, if you want to remember the user's preference for a certain zoom level on www.mozilla.org pages, you might store a preference whose domain is "www.mozilla.org", whose name i...
nsIContentSecurityPolicy
calls to this may trigger violation reports when queried, so this value should not be cached. read only. allowsinlinescript boolean whether this policy allows in-page script. calls to this may trigger violation reports when queried, so this value should not be cached. read onl...
nsIContentView
urrently, only <frame> and <iframe> elements are handled as content views. support for using this api for all scrollable elements is coming; see bug 618975 for details. method overview void scrollby(in float dxpx, in float dypx); void scrollto(in float xpx, in float ypx); void setscale(in float xscale, in float yscale); attributes attribute type
description contentheight float read only. contentwidth float dimensions of scrolled content in chrome-document css pixels. read only. id nscontentviewid id that can be used in conjunction with nsidomwindowutils to change the actual document, instead of just how it is transformed; this is a 64-bit unsigned integer. read only. scrollx float hori...
nsIContentViewManager
browser display, then use those nsicontentview objects to manipulate the content views. method overview void getcontentviewsin(in float axpx, in float aypx, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, [optional] out unsigned long alength, [retval, array, size_is(alength)] out nsicontentview aresult); attributes attribute type
description rootcontentview nsicontentview the root content view. read only. methods getcontentviewsin() returns an array of nsicontentview objects representing all of the content views that intersect with the specified rectangle in the browser. note: the rectangle is specified using an anchor point, then four distances to indicate how far in each direction to expand the rectangle. t...
nsIControllers
void appendcontroller( in nsicontroller controller ); parameters controller a controller to be added to the list of controllers. exceptions thrown ns_error_out_of_memory getcontrollerat() returns the controller instance at the given position. nsico...
nsIConverterInputStream
l/converter-input-stream;1. to create an instance, use: var converterinputstream = components.classes["@mozilla.org/intl/converter-input-stream;1"] .createinstance(components.interfaces.nsiconverterinputstream); method overview void init(in nsiinputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar); constants constant value
description default_replacement_character 0xfffd default replacement character value. methods init() initialize this stream. void init( in nsiinputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar ); parameters astream the source stream which is read and converted. acharset the character encoding to use for converting the bytes of the stream. a value of nul...
nsICookiePromptService
pt the cookie. extensions/cookie/nsicookiepromptservice.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview long cookiedialog(in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision); constants constant value
description deny_cookie 0 holds the value for a denying the cookie. accept_cookie 1 holds the value for accepting the cookie. accept_session_cookie 2 holds the value for accepting the session cookie. methods cookiedialog() opens a dialog that asks for permission to accept a cookie. long cookiedialog( in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromh...
nsICookieService
cvs blame will tell you why it is here. it remains until we can find a better home for it. methods getcookiestring() get the complete cookie string associated with the uri. string getcookiestring( in nsiuri auri, in nsichannel achannel ); parameters auri the uri of the docume...
nsICrashReporter
minidumppath nsilocalfile get or set the path on the local system to which minidumps will be written when a crash happens. exceptions thrown ns_error_not_initialized if crash reporting is not initialized. serverurl nsiurl get or set the url to which crash reports will be submitted. only https and http urls are allowed, as ...
nsICryptoHMAC
adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hashing algorithms. these values are to be used by the init() method to indicate which hashing function to use. these values map onto the values defined in mozilla/security/nss/lib/softoken/pkcs11t.h and are switched to ckm_*_hmac constant. constant value
description md2 1 message digest algorithm 2 md5 2 message-digest algorithm 5 sha1 3 secure hash algorithm 1 sha256 4 secure hash algorithm 256 sha384 5 secure hash algorithm 384 sha512 6 secure hash algorithm 512 methods finish() completes this hmac object and produces the actual hmac diegest data. note: this met...
nsICryptoHash
const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hash algorithms these constants are used by the init() method to indicate which hashing function to use. the values map directly onto the values defined in mozilla/security/nss/lib/cryptohi/hasht.h. constant value
description md2 1 message digest algorithm 2 md5 2 message-digest algorithm 5 sha1 3 secure hash algorithm 1 sha256 4 secure hash algorithm 256 sha384 5 secure hash algorithm 384 sha512 6 secure hash algorithm 512 methods finish() completes the hash object and produces the actual hash data. note: this method m...
nsIDNSRecord
s query may return more than one resolved ip address, the record acts like an enumerator, allowing the caller to easily step through the list of ip addresses. inherits from: nsisupports last changed in gecko 1.7 method overview prnetaddr getnextaddr(in pruint16 aport); native code only! acstring getnextaddrasstring(); boolean hasmore(); void rewind(); attributes attribute type
description canonicalname acstring for example, www.mozilla.org --> rheet.mozilla.org. read only. methods native code only!getnextaddr this function copies the value of the next ip address into the given prnetaddr struct and increments the internal address iterator. prnetaddr getnextaddr( in pruint16 aport ); parameters aport a port number to initialize the prnetaddr with. return value the value of...
nsIDNSService
ns. method overview nsicancelable asyncresolve(in autf8string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget); void init(); obsolete since gecko 1.8 nsidnsrecord resolve(in autf8string ahostname, in unsigned long aflags); void shutdown(); obsolete since gecko 1.8 attributes attribute type
description myhostname autf8string read only. constants resolve flag constants various flags that may be ored together to form the aflags parameter passed to asyncresolve() and resolve(). constant value
description resolve_bypass_cache (1 << 0) this flag suppresses the internal dns lookup cache. resolve_canonical_name (1 << 1) the canonical na...
nsIDOMClientRect
/nsidomclientrect.idlscriptable represents a rectangular box. the type of box is specified by the method that returns such an object. it is returned by functions like element.getboundingclientrect. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type
description bottom float y-coordinate, relative to the viewport origin, of the bottom of the rectangle box. read only. height float height of the rectangle box (this is identical to bottom minus top). read only. left float x-coordinate, relative to the viewport origin, of the left of the rectangle box. read only. right float x-coordinate, relative t...
nsIDOMElement
read only. methods getattribute() get an attribute value. domstring getattribute( in domstring name ); parameters name attribute name return value a domstring containing the attribute value. getattributenode() get an attribute node. nsidomattr getattributenode( in domstring name ); parameters name attribute name return value a nsidomattr corr...
nsIDOMFileException
ce represents exceptions that can be raised by calls to the methods in the nsidomfile interface. note: gecko's implementation of this interface presently differs from the working draft of the file api specification. content/base/public/nsidomfileexception.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) attributes attribute type
description code unsigned short the error code describing the error condition that took place; see the constants list for details. constants constant value
description not_found_err 0 the specified file wasn't found. not_readable_err 1 the specified file wasn't readable. see also nsidomfile nsidomfilelist nsidomfilereader ...
nsIDOMFontFaceList
layout/inspector/public/nsidomfontfacelist.idlscriptable a list of nsidomfontface objects, each representing a single font face. 1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview nsidomfontface item(in unsigned long index); attributes attribute type
description length unsigned long the number of items in the list. read only. methods item() returns the nsidomfontface object at the specified index into the list. nsidomfontface item( in unsigned long index ); parameters index the index into the array of the font face object to return. return value an nsidomfontface object representing a single font face. see also nsidomf...
nsIDOMGeoGeolocation
may be null. read only. methods clearwatch() when the clearwatch() method is called, the watch() process stops calling for new position identifiers and cease invoking callbacks. void clearwatch( in unsigned short watchid ); parameters none. getcurrentposition() acquires the user's c...
nsIDOMGeoPosition
dom/interfaces/geolocation/nsidomgeoposition.idlscriptable this interface describes a geographical location at a specific time. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type
description address nsidomgeopositionaddress the address of the user's current location, if available. read only. coords nsidomgeopositioncoords the user's current position information. read only. timestamp domtimestamp the time at which the reading was taken. read only. see also using geolocation ...
nsIDOMGeoPositionAddress
n the geolocation service being used. 1.0 66 introduced gecko 1.9.2 obsolete gecko 14.0 inherits from: nsisupports last changed in gecko 11 (firefox 11 / thunderbird 11 / seamonkey 2.8) this object is obtained from an nsidomgeopositionaddress object via its address attribute. note: this needs to be moved into the dom reference. attributes attribute type
description city domstring the city. read only. country domstring the country. read only. countrycode obsolete since gecko 11 domstring removed in firefox 11, since it isn't defined in the specification; use country instead. county domstring the county. read only. postalcode domstring the postal or zip code. read only. premises domstring the premises. read only. region domstring the region. rea...
nsIDOMGeoPositionError
the nsidomgeopositionerror interface represents an error that occurred while performing geolocation operations. dom/interfaces/geolocation/nsidomgeopositionerror.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports attributes attribute type
description code short numerical error code; see error constants for a complete list. read only. message domstring human readable error message. read only. gecko 1.9.2 note the message attribute was removed in gecko 1.9.2 (firefox 3.6). error constants constant value
description permission_denied 1 the user denied permission to retrieve location data. position_...
nsIDOMGeoPositionOptions
the nsidomgeopositionoptions interface is used to specify options for geolocation operations. dom/interfaces/geolocation/nsidomgeopositionoptions.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports attributes attribute type
description enablehighaccuracy boolean if true, high accuracy mode is used. timeout unsigned long maximum time in milliseconds before giving up on an attempt to retrieve location information. ...
nsIDOMHTMLSourceElement
child of the audio and video media elements in html. dom/interfaces/html/nsidomhtmlsourceelement.idlscriptable please add a summary to this article. last changed in gecko 1.9.1.2 inherits from: nsidomhtmlelement the source element allows authors to specify multiple media resources for media elements. it does not specify anything on its own. attributes attribute type
description src domstring the src attribute gives the address of the media resource. the value must be a valid url. this attribute must be present. note that dynamically manipulating this value after the page has loaded has no effect on the containing element; instead, change the src attribute of that element (audio or video) instead. type domstring the type attribute gives the ...
nsIDOMHTMLTimeRanges
mes of each range, specifying the index number of the range to look up. dom/interfaces/html/nsidomhtmltimeranges.idlscriptable please add a summary to this article. last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview float start(in unsigned long index); float end(in unsigned long index); attributes attribute type
description length unsigned long the number of ranges represented by the nsidomhtmltimeranges object. read only. methods end() returns the time offset to the end of the specified time range. float end( in unsigned long index ); parameters index the index to the time range whose end time is to be returned. return value the time at which the specified range ends, in seconds measured from the beginn...
nsIDOMMozNetworkStats
idomnetworkstats.idlscriptable interface of the network stats object. inherits from: nsisupports last changed in gecko 1.0 implemented by: @mozilla.org/networkstats;1. to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstats;1"] .createinstance(components.interfaces.nsidomnetworkstats); attributes attribute type
description connectiontype domstring connection type of the stats. read only. data nsidommoznetworkstatsdata array stats samples. read only. start date start date of the stats samples. read only. end date end date of the stats samples. read only. ...
nsIDOMMozNetworkStatsData
dom/network/interfaces/nsidomnetworkstats.idlscriptable represents a single record in the network statistics database, as reported using the nsidommoznetworkstatsmanager interface. 1.0 66 introduced gecko 18.0 inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) attributes attribute type
description rxbytes unsigned long the number of bytes received on the connection. read only. txbytes unsigned long the number of bytes transmitted on the connection. read only. date date the date of the sample. read only. ...
nsIDOMMozNetworkStatsManager
nsidomdomrequest getallalarms([optional] in nsisupports network); nsidomdomrequest removealarms([optional] in long alarmid); nsidomdomrequest clearstats(in nsisupports network); nsidomdomrequest clearallstats(); nsidomdomrequest getavailablenetworks(); nsidomdomrequest getavailableservicetypes(); attributes attribute type
description samplerate long minimum time in milliseconds between samples stored in the database. read only. maxstorageage long long time in milliseconds recorded by the api until present time. all samples older than maxstorageage from now are deleted. read only. constants constant type
description wifi long constant for wifi, set to 0 ...
nsIDOMMozTouchEvent
this is a random number that is guaranteed to remain the same for each finger during all moztouchmove events between the corresponding moztouchdown and moztouchup events. methods initmoztouchevent() initializes the touch event. void initsimplegestureevent( in domstring typ...
nsIDOMNSHTMLDocument
read only. designmode domstring set to "on" or "off" to enable or disable editing for the entire document...
nsIDOMNavigatorDesktopNotification
dom/interfaces/notification/nsidomnavigatordesktopnotification.idlscriptable property that extends the navigator object. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) property that extends the navigator object. attributes attribute type
description moznotification nsidomdesktopnotificationcenter read only. see also nsidomdesktopnotificationcenter ...
nsIDOMOrientationEvent
omorientationevent.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsidomevent method overview void initorientationevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z); attributes attribute type
description x double the amount of tilt along the x axis. read only. y double the amount of tilt along the y axis. read only. z double the amount of tilt along the z axis. read only. the values of x, y, and z can range from -1 to 1, where 0 means the device is balanced on that axis. see accelerometer values explained for details. methods initorientationevent() initializes the orientation event ...
nsIDOMProgressEvent
s a placeholder until the specification is complete, and is compatible with the webkit progressevent. method overview void initprogressevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg); deprecated since gecko 22.0 attributes attribute type
description lengthcomputable boolean specifies whether or not the total size of the transfer is known. read only. loaded unsigned long long the number of bytes transferred since the beginning of the operation. this doesn't include headers and other overhead, but only the content itself. read only. total unsigned long long the total number of bytes of content that ...
nsIDOMStorage
ar order with the condition that this order not change by merely changing the value associated with a key, but the order may change when a key is added or removed. method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type
description length unsigned long the number of keys stored in the session store. read only. methods clear() clear the content of this storage bound to a domain or an origin. void clear(); parameters none. getitem() returns from session storage the data corresponding to the specified key. domstring getitem( in domstring key ); parameters key the key for which data should be returned. return value a...
nsIDOMStorage2
.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type
description length unsigned long the number of keys stored in local storage. methods clear() clears the contents of this storage context; this removes all values bound to the domain or origin. void clear(); parameters none. getitem() returns from local storage the data corresponding to the specified key. domstring getitem( in domstring key ); parameters key the key for which data should be returned...
nsIDOMStorageEventObsolete
s the old, non-standard form of this event. you should use the nsidomstorageevent interface instead. method overview void initstorageevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring keyarg, in domstring oldvaluearg, in domstring newvaluearg, in domstring urlarg, in nsidomstorage storageareaarg); attributes attribute type
description domain domstring the domain of the storage area which changed, or "#session" if the event represents a change to session storage. read only. methods initstorageevent() initializes a storage event. void initstorageevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring domainarg ); parameters typearg the type argument. ca...
nsIDOMStorageItem
ce represents an object in dom storage. this is for session storage. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) gecko 1.9.1 note starting in gecko 1.9.1 (firefox 3.5), this is only used for session storage; previously, it was also used for global storage. attributes attribute type
description secure boolean if true, the item was stored for an https page. note: all items, regardless of whether they were stored for an http page or an https page, are visible from https pages. however, http pages can only see items stored from http pages, and will not see items stored from https pages. as such, this attribute is irrelevant for storage that is bound to an origin. value domstring the v...
nsIDOMStorageWindow
side storage objects. all dom windows inherit from this interface. 1.0 66 introduced gecko 1.8.1 obsolete gecko 8.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 8.0 this interface has been merged into nsidomwindow, and this interface has been removed. attributes attribute type
description globalstorage nsidomstoragelist global storage, accessible by domain. read only. localstorage nsidomstorage local storage for the current browsing context. data stored in local storage may only be accessed from the same origin that inserted the data into storage in the first place. read only. moz_indexeddb nsiidbfactory indexed databases for the curre...
nsIDOMUserDataHandler
dom/interfaces/core/nsidomuserdatahandler.idlscriptable the callback function for the setuserdata method. 1.0 66 introduced gecko 1.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void handle(in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst); constants constant value
description node_cloned 1 the node was cloned. node_imported 2 the node was cloned into a new document. node_deleted 3 unimplemented node_renamed 4 unimplemented node_adopted 5 the node was adopted into a new document. methods handle() this method is a callback which will be called if a node with user data is being cloned, imported or adopted. void handle( in unsigned short operation, in do...
nsIDOMWindow
read only. note: prior to gecko 7.0 this attribute was part of nsidomwindow2. document nsidomdocument the document contained in the window. read only. frames nsidomwindowcollection the child windows for this window. read only. native code only! globals...
nsIDOMWindow2
me> elements. inherits from: nsidomwindow last changed in gecko 1.9 (firefox 3) because nsidomwindow is frozen, this interface was introduced in firefox 3 (gecko 1.9) to allow dom windows to take on new features. dom windows implement nsidomwindow2, which is a subclass of nsidomwindow. in gecko 7.0 this interface has been merged into nsidomwindow. attributes attribute type
description applicationcache nsidomofflineresourcelist the application cache object for this window. read only. windowroot nsidomeventtarget the window root for this window. this is useful for connecting event listeners to this window as well as every other window nested in that window root. not accessible from scripts. read only. see also dom nsidomwindow ...
nsIDOMWindowInternal
self nsidomwindowinternal readonly: returns an object reference to the window object. navigator nsidomnavigator readonly: returns a reference to the navigator object. screen nsidomscreen readonly: returns a reference to the screen object associated with the window. ...
nsIDOMXPathException
dom/interfaces/xpath/nsidomxpathexception.idlscriptable describes an exception resulting from xpath operations. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type
description code unsigned short the error code; see error codes for details. constants error codes constant value
description invalid_expression_err 51 an invalid xpath expression was used. type_err 52 an attempt was made to reference an unavailable type. see also introduction to using xpath in javascript document object model (dom) level 3 xpath specification nsidomxpathevaluator document.evaluate nsidomxpathresult ...
nsIDOMXULControlElement
dom/interfaces/xul/nsidomxulcontrolelement.idlscriptable provides additional attributes specific to control elements. 66 introduced gecko 1.0 inherits from: nsidomxulelement last changed in gecko 1.0 attributes attribute type
description disabled boolean indicates whether the element is disabled or not. tabindex long the tab order of the element. ...
nsIDOMXULElement
allowevents boolean true if the element's allowevents attribute is the string "true", otherwise false. removes the attribute if you set it to false. boxobject nsiboxobject read only. gets or creates a box object for the element; browser, editor, iframe, listbox, menu, menupopup, scrollbox, tooltip and tree elements receiv...
nsIDOMXULLabeledControlElement
this should be one of the characters that appears in the label for the element. when the user presses the appropriate modifier and the access key, the element will be focused and/or activated from anywhere in the window. ...
nsIDOMXULSelectControlElement
selectedindex long selecteditem nsidomxulselectcontrolitemelement value domstring methods appenditem() nsidomxulselectcontrolitemelement appenditem( in domstring label, in domstring value ); parameters label value return value getindexofitem() long getindexofitem( in nsidomxulselectcontrolitemelement item ); parameters item retu...
nsIDOMXULSelectControlItemElement
dom/interfaces/xul/nsidomxulselectcntrlitemel.idlscriptable please add a summary to this article. inherits from: nsidomxulelement last changed in gecko 1.7 attributes attribute type
description accesskey domstring command domstring control nsidomxulselectcontrolelement read only. crop domstring disabled boolean image domstring label domstring selected boolean read only. value domstring ...
nsIDebug2
xpcom/base/nsidebug2.idlscriptable adds access to additional information in debug builds of mozilla code by expanding upon the features in nsidebug 1.0 66 introduced gecko 1.9.2 inherits from: nsidebug last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type
description assertioncount long the number of assertions since process start. this is normally zero in release builds, but does include calls to nsidebug.assertion(). read only. isdebugbuild boolean whether xpcom was compiled with debug defined. this often correlates to whether other code (for example, firefox, xulrunner) was compiled with debug defined. read only. see also nsidebug ...
nsIDialogParamBlock
methods getint() get a previously set integer. print32 getint( in print32 inindex ); parameters inindex the index of the integer to get. must be in the range 0..7. return value the previously set integer, or 0 if no integer has been previously set at that index. getstring(...
nsIDirIndexParser
netwerk/streamconv/public/nsidirindexlistener.idlscriptable a parser for 'application/http-index-format' directories. inherits from: nsistreamlistener last changed in gecko 1.7 called for each directory entry. attributes attribute type
description comment string the comment given, if any. this result is only valid after onstoprequest has occurred, because it can occur anywhere in the datastream. read only. encoding string the encoding to use. listener nsidirindexlistener the interface to use as a callback for new entries. ...
nsIDirectoryEnumerator
ar to nsisimpleenumerator except the retrieved entries are qi'ed to nsifile, and there is a mechanism for closing the directory when the enumeration is complete. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void close(); attributes attribute type
description nextfile nsifile the next file in the sequence. the nextfile attribute is the first element upon the first call. this attribute is null if there is no next element. read only. methods close() closes the directory being enumerated, releasing the system resource. it is safe to call this function many times. void close(); parameters none. exceptions thrown ns_ok if the...
nsIDirectoryIterator
rface provides a way to iterate over the entries in a directory. xpcom/obsolete/nsifilespec.idlscriptable please add a summary to this article. ...
nsIDocumentLoader
documentchannel nsichannel read only. loadgroup nsiloadgroup read only. methods clearparentdocloader() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void clearparentdocloader(); parameters none. createdocumentloader() obsolete since gecko 1.8 ...
nsIDownload
wnloaded.) inherits from: nsitransfer last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: once the download is completed, the download manager stops updating the nsidownload object. completed states are nsidownloadmanager::download_finished, nsidownloadmanager::download_failed, and nsidownloadmanager::download_canceled. attributes attribute type
description amounttransferred long long the number of bytes downloaded so far. read only. cancelable nsicancelable an object that can be used to cancel the download. once the download is complete, this value is set to null. read only. displayname astring a user-readable
description of the transfer. read only. id unsigned long the id by which the ...
nsIDownloadManagerUI
ad manager user interface, implement this interface. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getattention(); void show([optional] in nsiinterfacerequestor awindowcontext, [optional] in unsigned long aid, [optional] in short areason); attributes attribute type
description visible boolean true if the download manager ui is visible; otherwise false. read only. constants constant value
description reason_user_interacted 0 when opening the download manager user interface, this value indicates that it's being done at the user's request. reason_new_download 1 when opening the download manager user inter...
nsIDownloadProgressListener
methods ondownloadstatechange() called when the status of a particular download changes. void ondownloadstatechange( in short astate, in nsidownload adownload ); parameters astate the previous state of the download. see nsidownloadmanager.constants for a list of possible values. ado...
nsIDragService
dragdrop_action_copy 1 the drag and drop operation should copy the object. dragdrop_action_move 2 the drag and drop operation should move the object. dragdrop_action_link 4 the drag and drop operation should link the object. dragdrop_action_uninitialized 64 the action is not initialized. ...
nsIDragSession
r interacting with an ongoing drag session during a drag and drop operation. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void getdata( in nsitransferable atransferable, in unsigned long aitemindex ); boolean isdataflavorsupported( in string adataflavor ); attributes attribute type
description candrop boolean set the current state of the drag, whether it can be dropped or not. usually the target "frame" sets this so the native system can render the correct feedback. datatransfer nsidomdatatransfer the data transfer object for the current drag operation. dragaction unsigned long sets the action (copy, move, link and so on) for the current dr...
nsIDroppedLinkHandler
event a dragenter or dragover event. aallowsamedocument if false, drops are only allowed if the document of the source of the drag is different from the destination. this check includes any parent, sibling and child frames in the same content tree. if true, the source is not checked. return value true if the link being dragged can be dropped. exceptions thrown missing exception missing
description droplink() given a drop event, determines the link being dragged. if a uri is returned the caller can, for instance, load it. if null is returned, there is no valid link to be dropped. astring droplink( in nsidomdragevent aevent, out astring aname, [optional] in boolean adisallowinherit ); parameters aevent a drop event. aname the link title if it exists, or an empty string othe...
nsIDroppedLinkItem
dom/base/nsidroppedlinkhandler.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type
description url domstring url of the dropped link. name domstring name of the dropped link. type domstring mime-type of the dropped link. see also nsidroppedlinkhandler ...
nsIEditorBoxObject
layout/xul/base/public/nsieditorboxobject.idlscriptable please add a summary to this article. inherits from: nsicontainerboxobject last changed in gecko 1.9 (firefox 3) the boxobject belonging to a xul editor element implements this interface. note: please consider using nsicontainerboxobject instead. attributes attribute type
description docshell nsidocshell read only. obsolete since gecko 1.9 the nsidocshell object that manages the contained document. the editor.xml binding uses this property to gain access to the webnavigation, contentdocument, contentwindow, webbrowserfind, editingsession and commandmanager properties. ...
nsIEditorDocShell
ell.idlscriptable provides a way to get an editor from a specific frame in a docshell hierarchy. it is intended to be only used internally. inherits from: nsisupports last changed in gecko 1.7 use nsieditingsession.makewindoweditable() and nsieditingsession.geteditorforwindow() from out side. method overview void makeeditable(in boolean inwaitforuriload); attributes attribute type
description editable boolean this docshell is editable. read only. editor nsieditor gets or sets the editor for the content document. haseditingsession boolean this docshell has an editing session. read only. methods makeeditable() make this docshell editable, setting a flag that causes an editor to get created, either immediately, or after a url has been loaded. void makeeditable( in boolean inwa...
nsIEditorIMESupport
read only. methods native code only!begincomposition obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. handles the start of inline input composition.
nsIEditorSpellCheck
y. void checkcurrentdictionary(); parameters none. checkcurrentword() checks a given word. in spite of the name, this function checks the word you give it, returning true if the word is misspelled. if the word is misspelled, it will compute the suggestions which you can get from getsuggestedword(). boolean checkcurrentword( in wstring suggestedword ); parameters suggestedword missing
description return value true if the specified word is misspelled; otherwise false. checkcurrentwordnosuggest() like checkcurrentword(), checks the word you give it, returning true if it is misspelled. this is faster than checkcurrentword() because it does not compute any suggestions. note: this does not clear any suggestions left over from previous calls to checkcurrentword(), so there may be suggestions...
nsIEventListenerInfo
by nsieventlistenerservice.getlistenerinfofor, which provides a list of all the listeners to a given event target. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview nsisupports getdebugobject(); astring tosource(); attributes attribute type
description allowsuntrusted boolean indicates whether or not the event listener allows untrusted events. read only. capturing boolean indicates whether or not the event listener is in capture mode. read only. insystemeventgroup boolean indicates whether or not the event listener is in the system event group. read only. type astring the type of the e...
nsIEventListenerService
read only. obsolete since gecko 7.0 methods geteventtargetchainfor() returns an array of event targets indicating all the targets that will receive the same events that are delivered to the specified target. aeventtarget will be at index 0. the objects are the ones that would be used as event.curre...
nsIEventTarget
when this flag is specified, dispatch() returns immediately after the event is queued. dispatch_sync 1 this flag specifies the synchronous mode of event dispatch, in which the dispatch() method does no...
nsIException
there is no unambiguous indicator for unknown. read only. data nsisupports arbitary data for the implementation. read only. filename string filename location. ...
nsIFTPChannel
l, and offering additional information about the ftp channel. you can determine if a channel is an ftp channel by checking to see if it implements this interface, by calling nsisupports.queryinterface() on it. netwerk/protocol/ftp/nsiftpchannel.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports attributes attribute type
description lastmodifiedtime prtime the time at which the ftp channel was last updated. ...
nsIFaviconService
read only. methods addfailedfavicon() this method adds a given favicon's uri to the failed favicon cache. the lifespan of the favicon cache is up to the caching system. this cache will also be written to if you use setandloadfaviconforpage() method and it encounters an error while fetching an icon. void addfailedfavicon( in ns...
nsIFeedContainer
categories nsiarray an array of the categories found in a feed or entry. note: the returned array will contain nsifeedcategory objects, except that interface has not been implemented yet. contributors nsiarray an array of nsifeedperson objects describing con...
nsIFeedElementBase
toolkit/components/feeds/public/nsifeedelementbase.idlscriptable this interface is a base interface from which several of the other feed access interfaces derive. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type
description attributes nsisaxattributes all the attributes found on the element. most derived interfaces provide convenience accessors for their standard fields, so this is only useful when looking for nonstandard fields. baseuri nsiuri the base uri for the entry or feed. interwiki link ...
nsIFeedGenerator
toolkit/components/feeds/public/nsifeedgenerator.idlscriptable this interface describes the software that generated an rss or atom news feed. 1.0 66 introduced gecko 1.8 inherits from: nsifeedelementbase last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type
description agent astring the name of the software that created the feed. uri nsiuri a uri associated with the generator software. version astring a string indicating the version of the generator software that created the feed. interwiki link ...
nsIFeedPerson
toolkit/components/feeds/public/nsifeedperson.idlscriptable this interface describes an author of or a contributor to an rss or atom feed. 1.0 66 introduced gecko 1.8 inherits from: nsifeedelementbase last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type
description email astring the person's email address. name astring the name of the person. uri nsiuri a uri associated with the person; this is most likely the person's home page. see also nsifeedelementbase interwiki link ...
nsIFeedProcessor
methods parseasync() parses a feed asynchronously. the caller must then call the processor's nsistreamlistener methods to drive the parsing process. you must not call any of the other parsing methods on the nsifeedprocessor interface during an asynchronous parse. void parseasync( ...
nsIFeedProgressListener
id handlestartfeed( in nsifeedresult result ); parameters result an nsifeedresult describing the current state of the feed at the moment parsing begins. reporterror() called by the feed processor when a fatal xml parsing error occurs, or if the document isn't a feed. void reporterror( in astring errortext, in long linenumber, in boolean bozo ); parameters errortext a short
description of the error. linenumber the line on which the error occurred. bozo the bozo bit will be set if the error was due to a fatal error. see also nsifeedresultlistener interwiki lin ...
nsIFeedResult
t.idlscriptable this interface provides access to http and parsing metadata for a feed or entry. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void registerextensionprefix(in astring anamespace, in astring aprefix); attributes attribute type
description bozo boolean the feed processor sets the bozo bit when a feed triggers a fatal error during xml parsing. there may still be feed metadata and entries that were parsed before the error occurred. doc nsifeedcontainer the parsed feed or entry. null if a non-feed was processed. headers nsiproperties the http response headers that accompanied the feed. ...
nsIFeedTextConstruct
s usually don't need to create instances of this directly. various other feed-related interfaces, such as nsifeed, nsifeedentry, and nsifeedcontainer have attributes that return objects implementing nsifeedtextconstruct. method overview nsidomdocumentfragment createdocumentfragment(in nsidomelement element); astring plaintext(); attributes attribute type
description base nsiuri if the text construct contains html or xhtml, relative references in the content should be resolved against this base uri. lang astring the language of the text (such as "en-us" for u.s. english). text astring the actual text content. this string may contain markup if the type is either "html" or "xhtml". type astring the typ...
nsIFileInputStream
netwerk/base/nsifilestreams.idlscriptable an input stream that allows you to read from a file. inherits from: nsiinputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constant value
description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. if open_on_read is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when the end of the file is reached. ...
nsIFileOutputStream
netwerk/base/public/nsifilestreams.idlscriptable this interface is an output stream that lets you stream to a file. inherits from: nsioutputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants behavior flag constants constant value
description defer_open 1<<0 see the same constant in nsifileinputstream. the deferred open will be performed when one of the following is called: seek() tell() write() flush() defer_open is useful if we use the stream on a background thread, so that the opening and possible stating of the file happens there as well. ...
nsIFileStreams
the nsifilestreams interface is an input stream that allows you to read from a file. netwerk/base/public/nsifilestreams.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constants value
description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. if open_on_read is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when the end of...
nsIFileURL
netwerk/base/public/nsifileurl.idlscriptable provides access to the underlying nsifile object corresponding to a url. the url scheme need not be file:, since other local protocols may map urls to files (e.g., resource:). inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) attributes attribute type
description file nsifile get/set nsifile corresponding to this url. the getter returns a reference to an immutable object. callers must clone before attempting to modify the returned nsifile object. note: this constraint might not be enforced at runtime, so beware! the setter clones the nsifile object (allowing the caller to safely modify the nsifile object after setting it on this interface). ...
nsIFormHistory2
read only. hasentries boolean returns true if the form history has any entries. read only. methods addentry() adds a name and value pair to the form history. void addentry( in astring name, in astring value ); parameters name value entryexists() gets whether a name and value ...
nsIFrameLoader
this can be used to decide what operations may or may not be allowed on the loader's docshell. read only. docshell nsidocshell get the docshell from the frame loader. read only. messagemanager nsichromeframemessag...
nsIFrameLoaderOwner
s the owner of an nsiframeloader. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview [noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); void swapframeloaders(in nsiframeloaderowner aotherowner); attributes attribute type
description frameloader nsiframeloader the frame loader owned by this nsiframeloaderowner. read only. methods getframeloader() returns the frame loader object owned by this object. [noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); parameters none. return value the nsiframeloader owned by this object. swapframeloaders() swaps frame loaders with the given nsiframeloader...
nsIHapticFeedback
longpress 1 specify as the action type to perform a long vibration. methods performsimpleaction() perform haptic feedback. void performsimpleaction( in long islongpress ); parameters islongpress the press length; this will determine how long the vibration should last. see press le...
nsIHttpChannelInternal
read only. channelisfordownload boolean external handlers may set this to true to notify the channel that it is open on behalf of a download. documenturi nsiuri an http channel can own a reference to the document uri. forceallowthirdpartycookie boolean force relevant cookies to be sent with this load even if nor...
nsIIFrameBoxObject
layout/xul/base/public/nsiiframeboxobject.idlscriptable please add a summary to this article. inherits from: nsicontainerboxobject last changed in gecko 1.9 (firefox 3) the boxobject belonging to a xul iframe element implements this interface. note: please consider using nsicontainerboxobject instead. attributes attribute type
description docshell nsidocshell read only. obsolete since gecko 1.9 the nsidocshell object that manages the contained document. the general.xml binding uses this property to gain access to the webnavigation, contentdocument and contentwindow properties. ...
nsIINIParserWriter
sk, call the writefile() method. method overview void setstring(in autf8string asection, in autf8string akey, in autf8string avalue); void writefile([optional] in nsifile ainifile, [optional] in unsigned long aflags); constants file writing constants these constants are specified when calling writefile(), in order to change its behavior. constant value
description write_utf16 0x1 windows and the nsis installer code sometimes expect ini files to be in utf-16 encoding. on windows only, this flag to writefile() can be used to change the encoding from its default utf-8. methods setstring() set the value of a property string for a particular section and key. void setstring( in autf8string asection, in autf8string akey, in autf8st...
nsIIOService
when in offline mode, attempts to access the network will fail (although this does not necessarily correlate with whether there is actually a network available -- that's hard to detect without causing the dialer to come up). observers will be notified of changes to this attribute. methods allowport() checks i...
nsIIdleService
can be 0 if there is no valid idle time to report (this can happen if the user never interacted with the browser at all, and if we are unable to poll for idle time manually). read only. methods addidleobserver() add an observer to be notified when the user idles for some...
nsIJSID
when you implement a function that is passed an nsiidref parameter, such as queryinterface(). note that for these cases of jsid the specified class or interface must exist and be scriptable. method overview boolean equals(in nsijsid other); const nsid* getid(); violates the xpcom interface guidelines void initialize(in string idstring); string tostring(); attributes attribute type
description id nsidptr read only. native code only! obsolete since gecko 1.9 the internal nsid. name string read only. the name of the jsid, if it was set. number string read only. the string representation of the internal nsid. valid boolean read only. returns true if the jsid has been initialised. methods equals() this method determines if this nsijsid has the same nsid as another nsijsid. boole...
nsIJumpListItem
2.1) note: to consumers: it's reasonable to expect we'll need support for other types of jump list items (an audio file, an email message, etc.). to add types, create the specific interface here, add an implementation class to winjumplistitem, and add support to addlistbuild and removed items processing. method overview boolean equals(in nsijumplistitem item); attributes attribute type
description type short retrieves the jump list item type. read only. constants constant value
description jumplist_item_empty 0 empty list item. jumplist_item_separator 1 separator. jumplist_item_link 2 web link item. jumplist_item_shortcut 3 application shortcut. methods equals() compare this item to another. compares the type and other properties specific to this item's type: separator ...
nsILoadGroup
up.idlscriptable a load group maintains a collection of nsirequest objects. inherits from: nsirequest last changed in gecko 1.7 method overview void addrequest(in nsirequest arequest, in nsisupports acontext); void removerequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatus); attributes attribute type
description activecount unsigned long returns the count of "active" requests (that is requests without the load_background bit set). read only. defaultloadrequest nsirequest accesses the default load request for the group. each time a number of requests are added to a group, the defaultloadrequest may be set to indicate that all of the requests...
nsILoginInfo
for logins obtained from html forms, this field is the action attribute from the form element, with the path removed (for example, "https://www.site.com"). forms with no action attribute default to submitting to their origin url, so that is stored here. this field is null for logins attained from protoc...
nsILoginManager
esearch() generates results for a user field autocomplete menu. note: this method is provided for use only by the formfillcontroller, which calls it directly. it should not be used for any other purpose. nsiautocompleteresult autocompletesearch( in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement ); parameters asearchstring missing
description apreviousresult missing
description aelement missing
description return value missing
description countlogins() returns the number of logins matching the specified criteria. called when only the number of logins is needed, and not the actual logins (which avoids prompting the user for a master password, as the logins don't need to be decrypted). unsigned long countlogins( in astring a...
nsILoginManagerCrypto
toolkit/components/passwordmgr/public/nsiloginmanagercrypto.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview astring decrypt(in astring ciphertext); astring encrypt(in astring plaintext); attributes attribute type
description isloggedin boolean current login state of the token used for encryption. if the user is not logged in, performing a crypto operation will result in a master password prompt. read only. uibusy boolean true when a master password prompt is being displayed. read only. methods decrypt() decrypts the specified string, returning the plain text value. can throw if the user cancels entry of their ...
nsILoginManagerStorage
read only. methods addlogin() called by the login manager to store a new login. gecko 1.9.1 note default values for the nsiloginmetainfo properties are created if the specified login doesn't explicitly specify them. void addlogin( in nsilogininfo alogin ); parameters alogin the login to add to the login storage. co...
nsILoginMetaInfo
default values. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) you can specifically modify these values by passing changes into nsiloginmanager.modifylogin() using an nsipropertybag2 object as the input. metadata properties are ignored when comparing logins. attributes attribute type
description guid astring the guid to uniquely identify the login. this can be any arbitrary string, but a format as created by nsiuuidgenerator is recommended. for example, "{d4e1a1f6-5ea0-40ee-bff5-da57982f21cf}" timecreated unsigned long long the time, in unix epoch milliseconds, when the login was first created. timelastused unsigned long long the time, in unix epoch milliseconds, when the login wa...
nsIMIMEInputStream
a.org/network/mime-input-stream;1. to create an instance, use: var mimeinputstream = components.classes["@mozilla.org/network/mime-input-stream;1"] .createinstance(components.interfaces.nsimimeinputstream); method overview void addheader(in string name, in string value); void setdata(in nsiinputstream stream); attributes attribute type
description addcontentlength boolean when true a "content-length" header is automatically added to the stream. the value of the content-length is automatically calculated using the available() method on the data stream. the value is recalculated every time the stream is rewound to the start. not allowed to be changed once the stream has been started to be read. methods addheader() adds a...
nsIMacDockSupport
@mozilla.org/cookie-monster;1. to create an instance, use: var dock = components.classes["@mozilla.org/widget/macdocksupport;1"] .getservice(components.interfaces.nsimacdocksupport); see working with the mac os x dock for details and examples. method summary void activateapplication(in boolean aignoreotherapplications); attributes attribute type
description badgetext astring text to display in a badge on the application's dock icon. this can be used, for example, to display the number of unread messages in an email client. dockmenu nsistandalonemenu the menu to display when the user right-clicks on the application's icon in the dock. methods activateapplication() activates the application, making it the frontmost...
nsIMarkupDocumentViewer
docshell/base/nsimarkupdocumentviewer.idlscriptable describes the properties of a content viewer for an html or xml markup document. inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview void scrolltonode(in nsidomnode node); void sizetocontent(); attributes attribute type
description allowplugins boolean if true, plugins are allowed within the doc shell. default = true. obsolete since gecko 1.8 authorstyledisabled boolean disable entire author style level (including html presentation hints) bidicharacterset octet whether to force the user's character set 1 - use the document character set 2 - use the character set chosen by the user. obsol...
nsIMemoryMultiReporter
er and generate reports, you need to call collectreports(). this will call the specified callback's nsimemorymultireportercallback.callback() method once for each report. this will trigger any needed computation work. note: this differs from the behavior of nsimemoryreporter, which lets all fields except amount be accessed without triggering computation. attributes attribute type
description explicitnonheap print64 the sum of all of this multi-reporter's measurements that have a path that starts with "explicit" and are of the kind kind_nonheap. note: this is a hack that makes nsimemoryreportermanager.explicit more efficient. this is important; multi-reporters can special-case this operation so it's much faster than gathering all the reports, filteri...
nsIMemoryReporterManager
note: it covers all heap allocations, but will miss any operating system level ones not covered by memory reporters. this reporte...
nsIMenuBoxObject
openedwithkey boolean true if the menubar was opened using the keyboard; otherwise false. note: for gecko 2.0, the openedwithkey attribute exists on the nsimenuboxobject_mozilla_2_0_branch interface. subsequent gecko versions will have the attribute on the nsimenuboxobject...
nsINavHistoryFullVisitResultNode
visit query (which returns nsinavhistoryvisitresultnode, and as such takes more time to look up. 1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryvisitresultnode last changed in gecko 1.9 (firefox 3) the information returned in this interface is not commonly used, hence its separation into a separate query type for efficiency. attributes attribute type
description referringvisitid long long the referring visit id; the referrer should have the same session id as the visit described by this record. read only. transitiontype long indicates the type of transition for the visit. this will be one of the nsinavhistoryservice.transition type constants. read only. visitid long long the visit id of the visit. read only. ...
nsINavHistoryObserver
methods onbeforedeleteuri() obsolete since gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) note: this method was removed in gecko 21.0 as part of bug 826409. the specified page and all its visits are about to be deleted. note: the page does not necessarily have to have ever existed fo...
nsINavHistoryQueryResultNode
2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: if you request that places not be expanded in the options that generated the node, the node will report that it has no children and will never try to populate itself. method overview void getqueries([optional] out unsigned long querycount, [retval,array,size_is(querycount)] out nsinavhistoryquery queries); attributes attribute type
description folderitemid long long for both simple folder nodes and simple-folder-query nodes, this is set to the concrete itemid of the folder. otherwise, this is set to -1. read only. queryoptions nsinavhistoryqueryoptions the options that group the node's children; only valid for result_type_query nodes. read only. methods getqueries() returns the queries that build the node's children; only valid...
nsINavHistoryResult
. the viewer provides notifications to the controller when view events occur; this is done using the nsinavhistoryresultviewobserver interface. method overview void addobserver(in nsinavhistoryresultobserver aobserver, in boolean aownsweak); void removeobserver(in nsinavhistoryresultobserver aobserver); attributes attribute type
description root nsinavhistorycontainerresultnode the root of the results. this container gives you access to all the results in the tree. note: keep in mind that you need to open containers for their results to be valid. when a result goes out of scope it will continue to observe changes till it is cycle collected. while the result waits to be collected...
nsINavHistoryResultObserver
although this attribute is read-write, you should not alter it directly; instead, call nsinavhistoryresult.addobserver() to add an observer to a result. methods batching() lets the observer know when a batch operation in places is about to start or end. the observer can then pause updates or events until the batch is ...
nsINavHistoryResultViewObserver
drop_on 0 the drag operation wishes to drop the dragged item onto the indicated row. drop_after 1 the drag operation wishes to insert the dragged item after the indicated row. methods candrop() implement this method to report whether or not a drop is per...
nsINavHistoryResultViewer
although this attribute is read-write, you should not alter it directly; instead, use the nsinavhistoryresult.viewer attribute to set the viewer. methods containerclosed() called when a container node's state changes from closed to opened. void containerclosed( in nsinavhistorycontainerresultnode...
nsINavHistoryVisitResultNode
s a visit to an entry; you can use it to determine the date and time of the last time the user visited a particular page, for example. this interface provides the session id so that it's possible to group items from the same session together. 1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryresultnode last changed in gecko 1.9 (firefox 3) attributes attribute type
description sessionid long long the session id of the visit, used for session grouping when a tree view is sorted by date. read only. see also nsinavhistoryresultnode ...
nsIParserUtils
sanitizerallowstyle (1 << 1) flag for sanitizer: allow <style> elements and style attributes (with contents sanitized in case of -moz-binding). note: if -moz-binding is absent, properties that might be xss risks in other web engines are preserved! sanitizercidembedsonly ...
nsIPasswordManager
enumerator nsisimpleenumerator readonly: an enumeration of the rejected sites as nsipassword objects. only the host portion of these objects is relevant. methods adduser() stores a password. astring adduser(in autf8...
nsIPermission
terface defines a "permission" object, which is used to allow or block objects (for example cookies, images) from certain sites based on user preferences. netwerk/base/public/nsipermission.idlscriptable please add a summary to this article. last changed in gecko 2 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports attributes attribute type
description capability pruint32 the permission to set: allow, deny, or unknown (which is the default). see nsipermissionmanager.permission_type_constants for allowed values. read only. expiretime print64 the expiration time of the permission measured in milliseconds since 1970 jan 1 0:00:00. read only. expiretype pruint32 th...
nsIPipe
process buffer that can be read using nsiinputstream and written using nsioutputstream. inherits from: nsisupports last changed in gecko 1.6 method overview void init(in boolean nonblockinginput, in boolean nonblockingoutput, in unsigned long segmentsize, in unsigned long segmentcount, in nsimemory segmentallocator); attributes attribute type
description inputstream nsiasyncinputstream the pipe's input end, which also implements nsisearchableinputstream. read only. outputstream nsiasyncoutputstream the pipe's output end. read only. methods init() initialize this pipe. void init( in boolean nonblockinginput, in boolean nonblockingoutput, in unsigned long segmentsize, in unsig...
nsIPlacesView
uilt-in places views. method overview nsinavhistoryresultnode[] getdragableselection(); nsinavhistoryresultnode[][] getremovableselectionranges(); nsinavhistoryresult getresult(); nsinavhistorycontainerresultnode getresultnode(); nsinavhistoryresultnode[] getselectionnodes(); void selectall(); attributes attribute type
description hasselection boolean whether or not there are selected items. read only. insertionpoint insertionpoint the insertionpoint at which new items will be inserted upon drop, paste, or creation. read only. place string theuri (as a string) of the root place that the view displays. this may be modified dynamically to update the view. see displaying places inf...
nsIPluginHost
native code only! methods native code only!createtempfiletopost to create temp file with content len header in, it will use by http post. nsifile createtempfiletopost( in string apostdataurl ); parameters apostdataurl return value native code only!createtmpfiletopost obsolete since gecko 2.0 (firefox 4 / thunderb...
nsIPrefLocalizedString
trings nsisupportsstring) and 'localized' wide strings, which get their default values from properites files. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void setdatawithlength(in unsigned long length, [size_is(length)] in wstring data); wstring tostring(); attributes attribute type
description data wstring provides access to string data stored in this property. methods setdatawithlength() used to set the contents of this object. void setdatawithlength( in unsigned long length, [size_is(length)] in wstring data ); parameters length the length of the string. this value should not include space for the null terminator, nor should it account for the size ...
nsIPrinterEnumerator
this name should also be present in printernamelist. this is not necessarily gecko's default printer; see nsiprintsettingsservice.defaultprintername for that. read only. printernamelist nsistringenumerator the list of printer names. read only. methods displaypropert...
nsIPrivateBrowsingService
e from javascript, use: var pbs = components.classes["@mozilla.org/privatebrowsing;1"] .getservice(components.interfaces.nsiprivatebrowsingservice); c++ callers should use the contract id @mozilla.org/privatebrowsing-wrapper;1 instead. method overview void removedatafromdomain(in autf8string adomain); attributes attribute type
description autostarted boolean indicates whether or not private browsing was started automatically at application launch time. this is only ever true if privatebrowsingenabled is also true. read only. lastchangedbycommandline boolean indicates whether or not the last private browsing mode transition was performed on the command line (using either the...
nsIProcess
this is only valid after the process has exited. read only. isrunning boolean true if the process is running, otherwise false. only accurate if the process was run with blocking disabled. read only. location nsifile the location of the executable file on disk. read only. gecko 1.
nsIProfileLock
toolkit/profile/public/nsitoolkitprofile.idlscriptable an object returned by the nsitoolkitprofile.lock method; as long as you hold a reference to the object, the profile remains locked. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void unlock(); attributes attribute type
description directory nsilocalfile the main profile directory. read only. localdirectory nsilocalfile a directory corresponding to the main profile directory, which exists for the purpose of storing data on the local filesystem, including cache files or other data files that may not represent critical user data. (for example, this directory may not be included as part of a backup sch...
nsIProfileUnlocker
eunlocker.idlscriptable returned by the nsitoolkitprofile.lock method; you can use this to attempt to force a profile to be unlocked. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void unlock(in unsigned long aseverity); constants constant value
description attempt_quit 0 politely ask the process currently holding the profile's lock to quit. force_quit 1 forcibly terminate the process holding the profile lock. methods unlock() tries to unlock the profile by attempting or forcing the process that currently holds the lock to quit. void unlock( in unsigned long aseverity ); parameters aseverity either att...
nsIProgrammingLanguage
xpcom/base/nsiprogramminglanguage.idlscriptable this interface provides an enumeration of programming language identifiers. inherits from: nsisupports last changed in gecko 0.9.5 constants identifiers for programming languages. constant value
description unknown 0 cplusplus 1 c++ javascript 2 javascript python 3 python perl 4 perl java 5 java zx81_basic 6 zx81 basic javascript2 7 javascript 2 ruby 8 ruby php 9 php tcl 10 tcl max 10 this will be kept at the largest index. ...
nsIProperty
xpcom/ds/nsiproperty.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type
description name astring get the name of the property. read only. value nsivariant get the value of the property. read only. ...
nsIPropertyBag
read only. methods getproperty() get a property value for the given name. ...
nsIPropertyElement
xpcom/ds/nsipersistentproperties2.idlscriptable this interface provides access to individual entries within a stringbundle. inherits from: nsisupports last changed in gecko 1.0 attributes attribute type
description key autf8string the key used to refer to this property. value astring the string value stored for this property. see also xul tutorial:property files ...
nsIProtocolProxyService
proxy auto config (pac) may perform a synchronous dns query, which may not return immediately. so, calling resolve without this flag may result in locking up the calling thread for a lengthy period of time. by passing this flag to resolve, o...
nsIPushService
instead of service worker events. you can use the global nsiobserverservice to listen for these notifications. messages sent to system subscriptions are broadcasted to all push-message observers. your nsiobserver should ensure the data parameter matches your subscription scope. otherwise, your code may try to handle messages meant for other subscriptions. topic subject data
description push api counterpart push-message nsipushmessage if the message has a payload; null for blank messages. scope fired when a push message is sent to a system subscription. serviceworkerglobalscope.onpush push-subscription-change null scope fired when the push server drops a subscription, or the subscription identifier changes. serviceworkerglobalscope.on...
nsIPushSubscription
subscription also has a public key and secret; these are used to encrypt message payloads. this interface resembles pushsubscription from the push api. method overview void getkey(in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key); bool quotaapplies(); bool isexpired(); attributes attribute type
description endpoint domstring the subscription url. pushcount long long the total number of messages sent to this subscription. lastpush long long the last time a message was sent to this subscription, in milliseconds since the epoch. quota long the number of remaining background messages for this subscription, or -1 if exempt. methods getk...
nsIResumableChannel
ftp channels). inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void asyncopenat(in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid); obsolete since gecko 1.8 void resumeat(in unsigned long long startpos, in acstring entityid); attributes attribute type
description entityid acstring the entity id for this uri. available after onstartrequest. read only. exceptions thrown ns_error_not_resumable if this load is not resumable. methods asyncopenat() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) open this channel, and read starting at the specified offset. the request given to the nsistreamlistener will...
nsISHEntry
contenttype acstring indicates the content-type of the document that this is a session history entry for. contentviewer nsicontentviewer content viewer, for fast restoration of presentation. docidentifier unsigned long long an integer that should be the same for two entries attached to the same docshell if and only if the two ...
nsISHistory
read only. index long the index of the current document in session history. read only. maxlength long used to get/set the maximum number of toplevel documents, session history can hold for each instance. requestedindex long the index of the last document ...
nsISOCKSSocketInfo
netwerk/socket/nsisockssocketinfo.idlscriptable this interface provides information about a socks socket. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type
description destinationaddr prnetaddrptr the destination server address. native code only! externalproxyaddr prnetaddrptr the external (remote) proxy address. native code only! internalproxyaddr prnetaddrptr the internal (local) proxy address. native code only! ...
nsISSLSocketControl
netwerk/socket/nsisslsocketcontrol.idlscriptable this interface establishes tls and ssl connections. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void proxystartssl(); void starttls(); attributes attribute type
description forcehandshake boolean obsolete since gecko 1.9 notificationcallbacks nsiinterfacerequestor methods proxystartssl() starts an ssl proxy connection. void proxystartssl(); parameters none. starttls() establishes a starttls connection. this is used to encrypt plain-text data communication. void starttls(); parameters none. ...
nsIScreenManager
read only. primaryscreen nsiscreen the primary display screen; this is the screen with the menu bar (on the mac) or taskbar or equivalent on windows or linux. read only. methods native code only!screenfornativewidget returns the nsiscreen instance for the native widget pointer. this pointer's definition is specifi...
nsIScriptError2
bird 9.0 / seamonkey 2.6) in gecko 12.0 this interface was merged into the nsiscripterror interface. method overview void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); attributes attribute type
description innerwindowid unsigned long long the inner window id with which the error is associated. this is zero if the error was initialized by calling nsiscripterror.init() instead of initwithwindowid(). read only. outerwindowid unsigned long long the window id with which the error is associated. this is zero if the error was initialized by calling nsiscripterror.init() inst...
nsIScriptableUnicodeConverter
throws ns_error_uconv_noconv if the requested charset is not supported. methods convertfromunicode() converts the data from unicode to one charset. returns the converted string. after converting, finish should be called and its return value appended to this return value. acstring convertfromunicode( in astring asrc ); finish() re...
nsIScrollable
g scrollbarpref); void setscrollrange(in long scrollorientation, in long minpos, in long maxpos); obsolete since gecko 29.0 void setscrollrangeex(in long minhorizontalpos, in long maxhorizontalpos, in long minverticalpos, in long maxverticalpos); obsolete since gecko 29.0 constants scroll orientations scroll orientations a scrollbar can be in. constant value
description scrollorientation_x 1 horizontal scrolling. when passing this in to a method you are requesting or setting data for the horizontal scrollbar. scrollorientation_y 2 vertical scrolling. when passing this in to a method you are requesting or setting data for the vertical scrollbar. scrollbar states visibility states of a scrollbar. constant value de...
nsISearchSubmission
netwerk/base/public/nsibrowsersearchservice.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type
description postdata nsiinputstream the post data associated with a search submission, wrapped in a mime input stream. may be null. read only. uri nsiuri the uri to submit a search to. read only. ...
nsISeekableStream
xpcom/io/nsiseekablestream.idlscriptable provides seeking support in data streams. inherits from: nsisupports last changed in gecko 1.7 method overview void seek(in long whence, in long long offset); void seteof(); long long tell(); constants constant value
description ns_seek_set 0 specifies that the offset is relative to the start of the stream. ns_seek_cur 1 specifies that the offset is relative to the current position in the stream. ns_seek_end 2 specifies that the offset is relative to the end of the stream. methods seek() this method moves the stream offset of the stream implementing this interface. void seek( in long whence, in long long offset ); parameters whence s...
nsISelection2
read only. methods getrangesforinterval() return array of ranges intersecting with the given dom interval. void getrangesforinterval( in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruin...
nsIServerSocket
read only. methods asynclisten() this method puts the server socket in the listening state. it will asynchronously listen for and accept client connections. the listener will be notified once for each client connection that is accepted. the listener's onsocketaccepted() method will be called on the same thread that called a...
nsISessionStore
will always be false when in private browsing mode. methods deletetabvalue() deletes a value from a specified tab. void deletetabvalue( in nsidomnode atab, in astring akey ); parameters atab the tab for which to delete the value. akey the key whose value is to be deleted. exceptio...
nsISmsRequestManager
(in long arequestid, in long aerror); void notifysmsdeleted(in long arequestid, in bool adeleted); void notifysmsdeletefailed(in long arequestid, in long aerror); void notifysmssendfailed(in long arequestid, in long aerror); void notifysmssent(in long arequestid, in nsidommozsmsmessage amessage); constants all sms related errors that could apply to smsrequest objects. constant value
description success_no_error 0 no_signal_error 1 not_found_error 2 unknown_error 3 internal_error 4 methods addrequest() track an already existing request object. long addrequest( in nsidommozsmsrequest arequest ); parameters arequest an smsrequest. return value the request id. createrequest() create a new request object. long createrequest( in nsidommozsmsmanager amanager, ou...
nsISocketProvider
when set, the hostname parameter passed in this interface will be used instead of the address structure passed for a later request. anonymous_connect 1 << 1 when setting this flag, the socket will not apply any credentials when establishing a connection.
nsISocketTransportService
obsolete since gecko 1.8 methods native code only! attachsocket adds a new socket to the list of controlled sockets. this will fail with the error code ns_error_not_available if the maximum number of sockets is already reached. in this case, the...
nsISound
event_alert_dialog_open 1 an alert dialog is opened. event_confirm_dialog_open 2 a confirm dialog is opened. event_prompt_dialog_open 3 a prompt dialog (one that allows the user to enter data, such as an authentication dialog) is o...
nsIStackFrame
filename string filename location. this is the location that caused the error, which may or may not be a source file location. for example, standard language errors would generally have the same location as their top stack entry. file parsers may put the location of the file they were parsing, and so forth. ...
nsIStructuredCloneContainer
it stores by calling deserializetovariant(). you can also get a base-64-encoded string containing a copy of the container's serialized data, using getdataasbase64(). method overview nsivariant deserializetovariant(); astring getdataasbase64(); void initfrombase64(in astring adata,in unsigned long aformatversion); void initfromvariant(in nsivariant adata); attributes attribute type
description formatversion unsigned long get the version of the structured clone algorithm which was used to generate this container's serialized buffer. read only. serializednbytes unsigned long long get the size in bytes of this container's serialized data. read only. methods deserializetovariant() deserialize the object this container holds, returning it wrapped as an nsivariant. nsivariant deserial...
nsIStyleSheetService
a user sheet loaded via this api will come before usercontent.css and userchrome.css in the cascade (so the rules in it will...
nsISupports
ns thrown ns_error_no_interface the requested interface is not available. violates the xpcom interface guidelines release() notifies the object that an interface pointer has been destroyed and any resources the object held on behalf of the client can be released. nsrefcnt release(); parameters none. return value an integer value that is generally ignored. remarks the method
descriptions above were taken from essential com by don box. the point of those
descriptions is to highlight the fact that addref() and release() do not necessarily correspond to incrementing and decrementing a counter, respectively, even though that is how they are usually implemented. on win32 systems, nsisupports is abi-compatible with microsoft com's iunknown interface. ...
nsISupportsCString
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for ascii character strings. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data acstring provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsChar
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for single character values (often used to store an ascii character). inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data char provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsDouble
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for double-precision floating-point values. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data double provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsFloat
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for single-precision floating-point values. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data float provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsID
methods tostring() this method returns a string valued representation of the object. ...
nsISupportsInterfacePointer
dataiid nsidptr stores an iid corresponding to the data attribute. methods tostring() returns a string valued representation of the object. ...
nsISupportsPRBool
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for boolean values. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data prbool provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRInt16
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 16-bit signed integers. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data print16 provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRInt32
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 32-bit signed integers. 66 introduced gecko 1.0 inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data print32 provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRInt64
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 64-bit signed integers. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data print64 provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRTime
methods tostring() this methods returns a string valued representation of the object. ...
nsISupportsPRUint16
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 16-bit unsigned integers. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data pruint16 provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRUint32
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 32-bit unsigned integers. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data pruint32 provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRUint64
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 64-bit unsigned integers. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data pruint64 provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRUint8
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 8-bit unsigned integers. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data pruint8 provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsString
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for unicode character strings. inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type
description data astring provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsVoid
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for generic pointers. inherits from: nsisupportsprimitive last changed in gecko 1.0 method overview string tostring(); attributes attribute type
description data voidptr this attribute provides access to the native type represented by the object. native code only! methods tostring() string tostring(); parameters none. return value a string valued representation of the object. ...
nsISyncJPAKE
and hmac keys. void final( in acstring ab, in acstring agvb, in acstring arb, in acstring ahkdfinfo, out acstring aaes256key, out acstring ahmac256key ); parameters ab schnorr signature value b, in hex representation. agvb schnorr signature value g^vb (vb is a random value), in hex representation. arb schnorr signature value rb = vb - xb * h, in hex representation. ahkdfinfo missing
description aaes256key the aes 256 encryption key, in base64 representation. ahmac256key the 256 bit hmac key, in base64 representation. round1() perform first round of the jpake exchange. void round1( in acstring asignerid, out acstring agx1, out acstring agv1, out acstring ar1, out acstring agx2, out acstring agv2, out acstring ar2 ); parameters asignerid string identifying the signer. agx...
nsITaggingService
tagcontainericonspec autf8string retrieves the url spec for the tag container icon methods taguri() this method tags a uri with the given set of tags. current tags set for the url persist. tags in atags which are already set for the given uri a...
nsITaskbarPreview
ews. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) you can not directly instantiate this interface. instead, you use nsitaskbartabpreview or nsitaskbarwindowpreview as appropriate. method overview void invalidate(); attributes attribute type
description active boolean indicates whether or not the preview is marked as active (currently selected) in the taskbar. controller nsitaskbarpreviewcontroller the controller for this preview. the controller provides the behavior and appearance for the taskbar preview, and is responsible for determining the size and contents of the preview, whi...
nsITaskbarPreviewButton
on properties. these buttons are displayed below the window preview. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) you can't directly instantiate this interface. instead, you use the nsitaskbarwindowpreview.getbutton() to get the objects representing the buttons. attributes attribute type
description disabled boolean if true, the button is disabled. this is not the same as visible, which indicates whether or not the button should be displayed at all. dismissonclick boolean if true, the array of previews should be dismissed when the button is clicked. this is false by default. hasborder boolean if true, the taskbar should draw a border around this button's image. this is true by default.
nsITaskbarPreviewController
butes need to be implemented. method overview boolean drawpreview(in nsidomcanvasrenderingcontext2d ctx); boolean drawthumbnail(in nsidomcanvasrenderingcontext2d ctx, in unsigned long width, in unsigned long height); boolean onactivate(); void onclick(in nsitaskbarpreviewbutton button); void onclose(); attributes attribute type
description height unsigned long the height in pixels of the preview image. this value may change at any time. see drawpreview() for more information. read only. thumbnailaspectratio float the thumbnail's aspect ratio. this doesn't need to match the preview's aspect ratio, and is allowed to be changed at any time. see drawthumbnail() for more information. read only. wid...
nsITaskbarProgress
lass wraps around the native functionality to do this. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void setprogressstate(in nstaskbarprogressstate state, in unsigned long long currentvalue optional, in unsigned long long maxvalue optional); constants constant value
description state_no_progress 0 stop displaying progress on the taskbar button. this should be used when the operation is complete or canceled. state_indeterminate 1 display a cycling, indeterminate progress bar. state_normal 2 display a determinate, normal progress bar. state_error 3 display a determinate, error progress bar. state_paused 4 display a determinate progress bar indicating that the op...
nsITaskbarTabPreview
reviews as memory allows. you can't directly instantiate this interface; instead, call the nsiwintaskbar.createtaskbartabpreview(). method overview void ensureregistration(); violates the xpcom interface guidelines nativewindow gethwnd(); violates the xpcom interface guidelines void move(in nsitaskbartabpreview anext); attributes attribute type
description icon imgicontainer the icon displayed next to the title in the preview. this is null by default. title domstring the title displayed above the thumbnail. by default, this is an empty string. methods violates the xpcom interface guidelines ensureregistration() used internally to ensure that the taskbar knows about this preview. if a preview is not regis...
nsITextInputProcessorNotification
38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface tells details of a request or notification to ime. when gecko supports new notification to ime, this interface may have some new attributes. so, nsitextinputprocessorcallback won't be changed for keeping backward compatibility. attributes attribute type
description type acstring the type of request or notification to ime. see type values below. types "request-to-commit" this is required to be handled. when this is requested, the callback should commit composition synchronously, i.e., nsitextinputprocessor.commitcomposition() should be called. if the callback doesn't want to commit the composition synchronously, it's okay to com...
nsIThread
read. to create a thread, use the nsithreadmanager interface. xpcom/threads/nsithread.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsieventtarget method overview void shutdown() boolean haspendingevents() boolean processnextevent(in boolean maywait) attributes attribute type
description prthread prthread the nspr thread object corresponding to the nsithread. read only. methods shutdown() shuts down the thread. this causes events to stop being dispatched to the thread, and causes any pending events to run to completion before the thread joins with the current thread (see pr_jointhread() for details). during the execution of this method call, events for the...
nsIThreadInternal
y the xpcom thread object to let consumers observe dispatch activity on a thread. xpcom/threads/nsithreadinternal.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsithread method overview void popeventqueue(); void pusheventqueue(in nsithreadeventfilter filter); attributes attribute type
description observer nsithreadobserver get/set the current thread observer; set to null to disable observing. this attribute may be read from any thread but must only be set on the thread corresponding to this thread object. the observer will be released on the thread corresponding to this thread object after all other events have been processed during a call to shutdown. methods popev...
nsIThreadManager
represented by an nsithread. xpcom/threads/nsithreadmanager.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nsithread getthreadfromprthread(in prthread prthread); native code only! nsithread newthread(in unsigned long creationflags); attributes attribute type
description currentthread nsithread the currently executing thread. if the calling thread does not already have a nsithread associated with it, one is created and associate with the current prthread. read only. ismainthread boolean this attribute is true if the calling thread is the main thread of the application process. read only. mainthread nsithread the main t...
nsIThreadPool
d in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) a thread pool provides a convenient way to process events off the main thread. when you send events to the thread pool, the pool creates a new thread to process the event, up to the number of threads specified by the threadlimit attribute. method overview void shutdown(); attributes attribute type
description idlethreadlimit unsigned long get/set the maximum number of idle threads that are kept alive. once there are more than this many idle worker threads, the idle threads start getting destroyed. idlethreadtimeout unsigned long get/set the amount of time in milliseconds that a thread must be idle before it becomes eligible to be destroyed. listener nsithreadp...
nsIToolkitProfile
from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) you should not create these objects yourself; to obtain them, use the nsitoolkitprofileservice interface to create and obtain them. method overview nsiprofilelock lock(out nsiprofileunlocker aunlocker); void remove(in boolean removefiles); attributes attribute type
description localdir nsilocalfile the location of the profile local directory, which may be the same as the root directory. see nsiprofilelock.localdirectory(). read only. name autf8string the profile's name. rootdir nsilocalfile the location of the profile directory. read only. methods lock() locks the profile using platform-specific locking methods. nsipr...
nsIToolkitProfileService
firefox 18.0 / thunderbird 18.0 / seamonkey 2.15). method overview nsitoolkitprofile createprofile(in nsilocalfile arootdir, in autf8string aname); void flush(); nsitoolkitprofile getprofilebyname(in autf8string aname); nsiprofilelock lockprofilepath(in nsilocalfile adirectory, in nsilocalfile atempdirectory); attributes attribute type
description profilecount unsigned long the number of user profiles currently in existence. this will always return 0, 1, or 2; if there are more than 2 profiles, 2 is always returned. read only. profiles nsisimpleenumerator an enumerator providing access to the list of profiles; each profile is an nsitoolkitprofile object (though you must first call aprofile.queryinterface(compo...
nsITraceableChannel
l requester - e.g. to xmlhttprequest or to the browser tab that made the request) with your own implementation (see "implementing nsistreamlistener" below). after that your nsistreamlistener implementation will get the response data and will be able to pass the data on to the original nsistreamlistener (possibly modifying it). see nsitraceablechannel, intercept http traffic for a more detailed
description with code samples. see modify url before loading page in firefox for an overview of how to modify a request before it is made. method overview nsistreamlistener setnewlistener(in nsistreamlistener alistener); methods setnewlistener() replaces the channel's current listener with a new one, returning the listener previously assigned to the channel. nsistreamlistener setnewlis...
nsITransactionManager
this is commonly referred to as the number of levels of undo. a value of -1 means no limit. a value of zero means the transaction manager will execute each transaction, then immediately release all references it has to the transaction without pushing it on the undo stack. a ...
nsITransport
ose(in nsresult areason); nsiinputstream openinputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); nsioutputstream openoutputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); void seteventsink(in nsitransporteventsink asink, in nsieventtarget aeventtarget); constants open flags. constant value
description open_blocking 1<<0 open flags. open_unbuffered 1<<1 generic nsitransporteventsink status codes. nsitransport implementations may override these status codes with their own more specific status codes (for example, see nsisockettransport). constant value
description status_reading 0x804b0008 status_writing 0x804b0009 methods close() close the transport and any open streams. v...
nsITransportSecurityInfo
netwerk/socket/nsitransportsecurityinfo.idlscriptable this interface provides information about transport security, including the security state and any error message for the connection. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type
description errormessage wstring error message on connection failure. read only. securitystate unsigned long a flag detailing the security state of the connection. the possible values are defined in nsiwebprogresslistener. read only. shortsecurity
description wstring for secure connections (ssl) gives the common name (cn) of the certifying authority. read only. see also nsisockettransport ...
nsITreeBoxObject
view nsitreeview the view that backs the tree and that supplies it with its data. it is dynamically settable, either using a view attribute on the tree tag or by setting this attribute to a new value. focused boolean whether or not we are currently focused. treebody nsidomelement reado...
nsITreeColumns
read only. length long an alias for count (for the benefit of scripts which treat this as an array). read only. tree nsitreeboxobject the tree widget for these columns. read only. methods getcolumnat() get the column for a given index. nsitreecolumn getcolumnat( in long index ); parameters index index of the column return value a nsitreecolumn for ...
nsITreeContentView
cked by dom content. it is typically reached by calling queryinterface on a nsitreeview. layout/xul/base/src/tree/public/nsitreecontentview.idlscriptable please add a summary to this article. last changed in gecko 1.8.0 inherits from: nsisupports method overview long getindexofitem(in nsidomelement item); nsidomelement getitematindex(in long index); attributes attribute type
description root nsidomelement the element in the dom which this view uses as root content. read only. obsolete since gecko 1.8 methods getindexofitem() retrieve the index associated with the specified content item. long getindexofitem( in nsidomelement item ); parameters item a tree row for which to find the row index. return value a non-negative integer row index if the row was found within the t...
nsITreeSelection
read only. currentcolumn nsitreecolumn the current column. currentindex long the current item (the one with focus). note: this property indicates only the index of the row with tree cursor around it. this is not a reliable method of determining the selected row, as the selection m...
nsITreeView
void performactiononrow(in wstring action, in long row); void selectionchanged(); void setcelltext(in long row, in nsitreecolumn col, in astring value); void setcellvalue(in long row, in nsitreecolumn col, in astring value); void settree(in nsitreeboxobject tree); void toggleopenstate(in long index); attributes attribute type
description rowcount long the total number of rows in the tree (including the offscreen rows). read only. selection nsitreeselection the selection for this view. constants constant value
description progress_normal 1 note: renamed from progressnormal in gecko 1.8 progress_undetermined 2 note: renamed from progres...
nsIURI
follows the idna draft specification for converting internationalized domain names (utf-8) to ascii for compatibility with existing internet infrastructure. read only. note: ipv6 addresses are not enclosed in square brackets. asciispec acstring (us-ascii) the uri spec with an a...
nsIURIFixup
fixup_flag_allow_keyword_lookup 1 allow the fixup to use a keyword lookup service to complete the uri. the fixup object implementer should honour this flag and only perform any lengthy keyword (or search) operation if it is set. fixup_flags_make_alternate_uri 2 tell the fixup to make an alternate uri from the input uri...
nsIURIFixupInfo
preferreduri nsiuri best guess of what uri consumer expects. may be null if we can't deliver (eg. the input is an invalid uri and fixup_flag_allow_keyword_lookup is not passed). read only. ...
nsIURL
if the url denotes a path to a directory and not a file, for example http://host/foo/bar/, then the directory attribute accesses the complete /foo/bar/ portion, and the filename is the empty string. if the trailing slash is omitted, then the directory is /foo/ and the file is bar (that is this is a syntactic, not a semantic breakdow...
nsIUpdate
front end and other application services can use to learn more about what is going on. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiupdatepatch getpatchat(in unsigned long index); nsidomelement serialize(in nsidomdocument updates); attributes attribute type
description appversion astring the application version of this update. billboardurl astring the url to a page that is typically localized to display in the update prompt. buildid astring the build id of this update. this is used to identify a particular build, down to the hour, minute, and second of its creation. this lets the system differentiate between several nightly builds with the same version,...
nsIUpdateChecker
erface describes an object that knows how to check for software updates. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void checkforupdates(in nsiupdatechecklistener listener, in boolean force); void stopchecking(in unsigned short duration); constants constant value
description current_check 1 constant for the stopchecking() method indicating that only the current update check should be stopped. current_session 2 constant for the stopchecking() method indicating that all update checks during the current session should be stopped. any_checks 3 constant for the stopchecking() method indicating that all update checking should be stopped. this disables the update chec...
nsIUpdateManager
ce describes a global application service that maintains a list of previously installed updates, as well as the currently in use update. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsiupdate getupdateat(in long index); void saveupdates(); attributes attribute type
description activeupdate nsiupdate an nsiupdate object describing the currently in use update. this update is not in the history list. read only. updatecount long the number of updates in the history list; the updates can be fetched by calling getupdateat(). read only. methods getupdateat() returns the update at the specified index into the history list. nsiupdate getupdateat( in long index ); para...
nsIUpdatePatch
describes an object representing a patch file that can be downloaded and applied to a version of this application so that it can be updated. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsidomelement serialize(in nsidomdocument updates); attributes attribute type
description finalurl astring the final url this patch was being downloaded from. hashfunction astring the hash function to use when determining the integrity of the patch file. hashvalue astring the value of the hash function named in hashfunction that should be computed if the file is not corrupt. selected boolean true if this patch is currently selected as the patch to be downloaded and installed ...
nsIUploadChannel
a channel may optionally implement this interface if it supports the notion of uploading a data stream. the upload stream may only be set prior to the invocation of asyncopen on the channel. inherits from: nsisupports last changed in gecko 1.7 method overview void setuploadstream(in nsiinputstream astream, in acstring acontenttype, in long acontentlength); attributes attribute type
description uploadstream nsiinputstream get the stream (to be) uploaded by this channel. read only. methods setuploadstream() sets a stream to be uploaded by this channel. most implementations of this interface require that the stream: implement threadsafe addref and release implement nsiinputstream.readsegments() implement nsiseekablestream.seek(). history here is that we need to support both streams...
nsIUserInfo
nt user. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/userinfo;1. to get the service, use: var userinfo = components.classes["@mozilla.org/userinfo;1"] .getservice(components.interfaces.nsiuserinfo); you can then look at the userinfo object's attributes to learn what the system knows about the user. attributes attribute type
description linux mac osx os/2 windows domain string read only. the computer's domain, or the domain of its hostname. the domain portion of the email address, if available. not supported. not supported. emailaddress string read only. the concatenation of the user's login name and the computer's domain. the user's email address as saved in the system...
nsIVariant
native code only! methods native code only!getasacstring acstring getasacstring(); parameters none. return value the value is converted to an 8-bit string in the iso-8859-1 character set. if the value was utf16 then the high bits are lost. if the value was utf8 then it is converted to utf16 and the high bits are discarded. arrays ...
nsIWebBrowser
st changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) warning: this interface was frozen for a very long time, but was unfrozen for gecko 2.0. method overview void addwebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); void removewebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); attributes attribute type
description containerwindow nsiwebbrowserchrome the chrome object associated with the browser instance. the embedder must create one chrome object for each browser object that is instantiated. the embedder must associate the two by setting this property to point to the chrome object before creating the browser window via the browser's nsibasewindow interface. the chrome object must al...
nsIWebBrowserFind
an nsiwebbrowser. by default, the implementation will search the focused frame, or if there is no focused frame, the web browser content area. it does not by default search subframes or iframes. to change this behavior, and to explicitly set the frame to search, queryinterface to nsiwebbrowserfindinframes. method overview boolean findnext(); attributes attribute type
description entireword boolean whether to match entire words only. default is false. findbackwards boolean whether to find backwards (towards the beginning of the document). default is false (search forward). matchcase boolean whether to match case (case sensitive) when searching. default is false. searchframes boolean whether to search through...
nsIWebBrowserFindInFrames
once the search is done, this will be set to be the last frame searched, whether or not a result was found. ...
nsIWebNavigationInfo
note: this is guaranteed not to change, so that boolean tests can be done on the return value if istypesupported to detect whether a type is supported at all. image 1 returned by istypesupported() to indicate that a type is supported as an image. plugin 2 retur...
nsIWebPageDescriptor
docshell/base/nsiwebpagedescriptor.idlscriptable this interface allows content being displayed in one window to be loaded into another window without refetching it from the network. inherits from: nsisupports last changed in gecko 1.7 method overview void loadpage(in nsisupports apagedescriptor, in unsigned long adisplaytype); attributes attribute type
description currentdescriptor nsisupports retrieves the page descriptor for the current document. read only. constants display type constants constant value
description display_as_source 0x0001 generates an optionally syntax-highlighted (for xml/html documents) source of the original page. display_normal 0x0002 just refetches the existing page. note that if the descriptor is that of the source of another page, this ...
nsIWinAppHelper
nstance, use: var xulappinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsiwinapphelper); the nsixulappinfo and nsixulruntime interfaces are also implemented by "xre/app-info". method overview void fixreg(); obsolete since gecko 1.9 void postupdate(in nsilocalfile logfile); obsolete since gecko 1.9.2 attributes attribute type
description usercanelevate boolean read only. returns true only if all the following conditions are all true at once: the operating system is at least windows vista user account control is enabled the user is an administrator the application is not already running with elevated permissions otherwise it returns false. methods fixreg() obsolete since gecko 1.9 (firefox 3) in...
nsIWinTaskbar
read only. defaultgroupid astring the default application user model id the application registers with the system. this id is used by the taskbar for grouping windows and when associating pinned shortcuts with running inst...
nsIWindowMediator
zlevelbottom 2 send window to bottom. zlevelbelow 3 place window below some window. methods addlistener() register a listener for window status changes. void addlistener( in nsiwindowmediatorlistener alistener ); parameters alistener the listener to register. example: of window listener object and ho...
nsIWindowWatcher
users must keep this attribute current, including after the topmost window is closed. this attribute will be null if the active window is not an nsidomwindow; for example, if the active window is an alert...
nsIWorker
represents a dom worker thread. 1.0 66 introduced gecko 1.9.1 inherits from: nsiabstractworker last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) for usage details, see worker and the article using dom workers. method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); attributes attribute type
description onmessage nsidomeventlistener an object to receive notifications when messages are received on the worker's message port. methods postmessage() used to allow the worker to send a message back to the web application that created it. void postmessage( in domstring amessage, in nsiworkermessageport amessageport optional ); parameters amessage the message the worker wishes to post back to ...
nsIWorkerGlobalScope
eads/nsidomworkers.idlscriptable this interface is an abstract interface representing the 'inside' of a worker. this interface allows a worker to look up information about itself, as well as to control itself. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type
description location nsiworkerlocation read only. navigator nsiworkernavigator read only. onerror nsidomeventlistener self nsiworkerglobalscope returns the global scope object itself. read only. see also using web workers nsiworkermessageport nsiworkermessageevent nsiworkerscope nsiabstractworker nsiworker ...
nsIWorkerMessageEvent
read only. origin domstring the event's origin. read only. source nsisupports the event's source. read only. methods initmessageevent() initializes the message event. void initmessageevent( in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring...
nsIWorkerScope
is interface represents the global scope in which a worker's script runs. 1.0 66 introduced gecko 1.9.1 inherits from: nsiworkerglobalscope last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); void close(); attributes attribute type
description onclose nsidomeventlistener a listener object to be called when the worker stops running. onmessage nsidomeventlistener a listener object to be called when a message is posted on the port. the message is in the event's data member. methods close() allows the worker to terminate itself. if a listener has been established by setting the value of the onclose attribute, it gets called. void c...
nsIXMLHttpRequestEventTarget
content/base/public/nsixmlhttprequest.idlscriptable this interface provides access to the event listeners used when uploading data using the xmlhttprequest object. 1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) attributes attribute type
description onabort nsidomeventlistener a javascript function object that gets invoked if the operation is canceled by the user. onerror nsidomeventlistener a javascript function object that gets invoked if the operation fails to complete due to an error. onload nsidomeventlistener a javascript function object that gets invoked when the operation is successfully completed. onloadend nsidomeventlistener a javascript function obje...
nsIXMLHttpRequestUpload
content/base/public/nsixmlhttprequest.idlscriptable this interface provides access to the features needed when uploading data using nsixmlhttprequest. ...
nsIXPCScriptable
pconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval val); jsobjectptr outerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); jsobjectptr innerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); void postcreateprototype(in jscontextptr cx, in jsobjectptr proto); attributes attribute type
description classname string scriptableflags pruint32 the bitwise or'd set of flags (define below) that indicate the behavior of this object. constants constant value
description want_precreate 1 << 0 want_create 1 << 1 want_postcreate 1 << 2 want_addproperty 1 << 3 want_delproperty 1 << 4 want_getproperty 1 << 5 want_setproperty 1 << 6 want_enumerate 1 << 7 wan...
nsIXSLTException
content/xslt/public/nsixsltexception.idlscriptable please add a summary to this article. inherits from: nsiexception last changed in gecko 1.7 attributes attribute type
description sourcenode nsidomnode the context node, may be null. read only. stylenode nsidomnode the node in the stylesheet that triggered the exception. read only. ...
nsIXULAppInfo
ormation from application.ini. implemented by: @mozilla.org/xre/app-info;1. to create an instance, use: var xulappinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); the nsixulruntime interface is also implemented by "xre/app-info". it contains advanced information on the xul runtime. attributes attribute type
description appbuildid acstring the application's build id/date, for example "2004051604". for xulrunner applications, this will be different than the build id of the platform. be careful about which one you want. read only. id acstring the xul application's uuid. can be an empty string, if id is not set. has to be defined for advanced application features such as the exten...
nsIXULSortService
although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. used internally for insertion sorting. void insertcontainernode( in nsirdfcompositedatasource db, in ns...
Using the clipboard
ata instead of settransferdata. here are the steps to pasting: create a clipboard object which refers to the system clipboard. create a transferring object which implements the nsitransferable interface. initialize the transferring object with a null privacy context, as long as this object will not be placed on the clipboard. otherwise, use a one from a logical source window instead (see the
description above). tell the transferring object about the flavor of data you want to get. retrieve the data from the clipboard and put it in the transferable. get the data from the transferring object. the first steps are similar to that used for copying: var trans = transferable(); trans.adddataflavor("text/unicode"); recall that transferable() is a function from the boilerplate in the previous se...
pyxpidl
s, use the header.py utility: sdkdir/sdk/bin/header.py --cachedir=<path> -o <outputfilename.h> <filename.idl> generating typelibs generating typelib files is done using the typelib.py utility: sdkdir/sdk/bin/typelib.py --cachedir=<path> -o <outputfilename.xpt> <filename.idl> comparing pyxpidl to xpidl this table provides a mapping of old xpidl options to pyxpidl. ...
xpidl
it generates: c++ header files (.h), with a commented template for full c++ implementation of the interface xpconnect typelib files (.xpt), with runtime type information to dynamically call xpcom objects through xpconnect note: starting in gecko 9.0, xpidl has been replaced with pyxpidl in the gecko sdk. pyxpidl has been used for some time now, but now this older tool has been fully retired. xpidl is based on the libidl idl compiler from the gnome project. the libidl compiler depends on glib, also from the gnome project. ...
XPIDL
idls make it possible to define interfaces which can then be processed by tools to autogenerate language-dependent interface specifications. xpidl is expected to converge towards webidl in the future. note: starting in gecko 9.0, the older xpidl utility, which was previously used to generate c++ header files, typelib information, and so forth has been replaced with pyxpidl in the gecko sdk. pyxpidl has been used for some time now, but now the older tool has been fully retired. ...
Mozilla technologies
om users. the xml extras module is built by default on all platforms, and is included in the browser installers so it is available in the nightly builds.xpcomxpcom is a cross platform component object model, similar to microsoft com. ...
Autoconfiguration in Thunderbird
r email servers. in many cases, people should be able to download and install thunderbird, enter their real name, email address and password in the account setup wizard and have a fully functioning mail client and get and send their mail as securely as possible. see also: for instructions for users, see automatic account configuration on the thunderbird knowledge base. the configuration file
description and definition the original project page on the mozilla wiki for background, design, implementation and project details this document describes how autoconfiguration in thunderbird works, and what to do to allow mail servers to be autoconfigured. mechanisms thunderbird gets the server settings via different means, each of which is intended for different cases: ispdb the ispdb is a centr...
LDAP Support
see bug #119291 for more details. original document information author(s): scott macgregor copyright information: portions of this content are © 1998–2010 by individual mozilla.org co...
Activity Manager examples
see the activity manager interfaces page for an overview of the related interfaces. if the default implementation of nsiactivityprocess, nsiactivitywarning and nsiactivityevent are not sufficient for the activity initiator, activity developers can provide their own components to extend the capabilities. ...
libmime content type handlers
nder rfc822 messages for use by the messenger component of seamonkey. a necessary capability of this module is to dynamically add the ability to decode and render various content types. this functionality will be accomplished via content type handler plugins for libmime. libmime has a homegrown object system written in c, and since the content type handler plugins need to exist in this module, a
description of the libmime object system should be reviewed and understood. api's content type handler plugins are dynamically loaded and need to access internal pointers, functions that are part of the c based object system. the following xp-com interface is implemented by libmime and is necessary for content type handler plugin development. /* * this interface is implemented by content type handlers t...
Toolkit version format
his format: addon's and target application's version in install and update manifests. the following preferences: app.extensions.version, extensions.lastappversion versions returned by nsixulappinfo. application.ini in xulrunner applications appversion flag in chrome manifests. you can use nsiversioncomparator to compare versions from your application. see older version formats below for
description of the older version format used in firefox/thunderbird 1.0. version format a version string consists of one or more version parts, separated with dots. each version part is itself parsed as a sequence of four parts: <number-a><string-b><number-c><string-d>. each of the parts is optional. numbers are integers base 10 (may be negative), strings are non-numeric ascii characters. a few examples ...
Working with windows in chrome code
nent may be an unnecessary complication. you can use the preferences service in such cases. pros: quite easy to use for storing simple data. cons: can't easily be used to store complex data. abusing the preferences service and not cleaning up after yourself can cause prefs.js to grow large and slow down application startup. see code snippets:preferences for detailed
description of the preferences system and example code. example: var prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); var branch = prefs.getbranch("extensions.myext."); var var1 = branch.getboolpref("var1"); // get a pref see also code snippets:dialogs ...
CData
read only. note: this is never ctypes.void_t or an array type with an unspecified length. ...
CType
ntype these represent callable c functions. structtype these represent c structures. arraytype these represent c arrays. method overview methods available on all ctype objects ctype array([n]) string tosource() string tostring() properties properties of all ctype objects these properties are available on all ctype objects. property type
description name string the type's name. read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, this is simply the string that was passed to the constructor. for other function, pointer, and array types, this should be a valid c type expression. ptr ctype returns a ctype representing the data type ...
Mozilla
techtalk for more complete although less detailed documentation. mozilla svg project since you have come this far, you probably already know that svg stands for scalable vector graphics, and that it is an xml language for sophisticated 2-dimensional graphics. svg is to graphics what xhtml is to text, mathml is to mathematical equations and cml is to the
description of chemical molecules. mozilla technologies mozilla has several technologies used as components of its projects. these are documented here. mozilla web developer faq this document answers questions that web authors ask frequently specifically in connection with firefox and other gecko-based browsers. there are links to more general we...
Plug-in Side Plug-in API - Plugins
and called by the browser. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. plugin method summary npp_destroy deletes a specific instance of a plug-in. npp_destroystream tells the plug-in that a stream is about to be closed or destroyed. np_getentrypoints undocumented. np_getmime
description registers the mime types supported by the plug-in (unix, mac os). npp_getvalue allows the browser to query the plug-in for information. np_getvalue allows the browser to query the plug-in for information. npp_handleevent delivers a platform-specific window event to the instance. np_initialize provides global initialization for a plug-in. npp_new creates a new instance of a plug-in. np...
URLs - Plugins
ols provide a means for locating and accessing resources that are available on the internet and on intranets. plug-ins can request and receive the data associated with urls of any type that the browser can handle, including http, ftp, news, mailto, and gopher. the table below summarizes urls supported by gecko. in addition, gecko may support urls not listed on this table. url scheme
description about locates browser information or "fun" pages. file (host-specific filenames) locates files on a specific host computer rather than an internet resource. ftp (file transfer protocol) locates files and directories on internet hosts for file download. gopher (gopher protocol) locates specified items on a gopher server. obsolete since gecko 2.0 ...
Accessibility Inspector - Firefox Developer Tools
ould have a value of whatever is entered in the input, whereas a link's value would be the url in the corresponding <a> element's href. domnode — the type of dom node that the item in the accessibility tree represents. you can click on the "target" icon that comes after it to select the node in the page inspector. hovering over the "target" icon highlights the dom node in the page content.
description — any further
description provided on the element, usually by the content of a title attribute. keyboardshortcut — any keyboard shortcut that is available to activate the element, as specified in an accesskey attribute. note that this works correctly as of firefox 62 (bug 1467381). childcount — the number of child items the current item has in the accessibility tree hierarchy. indexinpar...
Introduction to DOM Inspector - Firefox Developer Tools
iewer from this menu and see the various selectors and rules that have been applied. the rule that applies the search icon to the element uses a class simple selector and uses a list-style-image property to point to a file in the current theme. the list of viewers available from the viewer menu gives you some idea about how extensive the dom inspector's inspecting capabilities are. the following
descriptions provide an overview of what these viewers are about: the dom nodes viewer shows attributes of nodes that can take them, or the text content of text nodes, comments, and processing instructions. the attributes and text contents may also be edited. the box model viewer gives various metrics about xul and html elements, including placement and size. the xbl bindings viewer lists the xbl bindings...
Debugger.Object - Firefox Developer Tools
king was enabled when this debugger.object’s referent was allocated, return the javascript execution stack captured at the time of the allocation. otherwise, return null. function properties of the debugger.object prototype the functions described below may only be called with a this value referring to a debugger.object instance; they may not be used as methods of other kinds of objects. the
descriptions use “referent” to mean “the referent of this debugger.object instance”. unless otherwise specified, these methods are not invocation functions; if a call would cause debuggee code to run (say, because it gets or sets an accessor property whose handler is debuggee code, or because the referent is a proxy whose traps are debuggee code), the call throws a debugger.debuggeewouldrun exceptio...
Debugger.Script - Firefox Developer Tools
constructs exactly one debugger.script for each underlying webassembly module per debugger instance. a debugger.script instance is a strong reference to the underlying webassembly module; it protects the module it refers to from being garbage collected. please note at the time of this writing, support for webassembly is very preliminary. many properties and methods below throw. convention for
descriptions of properties and methods below, if the behavior of the property or method differs between the instance referring to a jsscript or to a block of webassembly code, the text will be split into two sections, headed by “if the instance refers to a jsscript” and “if the instance refers to webassembly code”, respectively. if the behavior does not differ, no such emphasized headings will appear...
Debugger.Source - Firefox Developer Tools
erties provide the serialized text as a string. currently only entire modules evaluated via new webassembly.module are represented. spidermonkey constructs exactly one debugger.source for each underlying webassembly module per debugger instance. please note at the time of this writing, support for webassembly is very preliminary. many properties below return placeholder values. convention for
descriptions of properties and methods below, if the behavior of the property or method differs between the instance referring to javascript source or to a block of webassembly code, the text will be split into two sections, headed by “if the instance refers to javascript source” and “if the instance refers to webassembly code”, respectively. if the behavior does not differ, no such emphasized headin...
Debugger - Firefox Developer Tools
ception as its sole argument and the debugger instance as the this value. this function should return a resumption value, which determines how the debuggee should continue. if the uncaught exception hook itself throws an exception,uncaught-hook-exception, spidermonkey throws a new error object,confess-to-debuggee-exception, to the debuggee whose message blames the debugger, and includes textual
descriptions ofuncaught-hook-exception and the originaldebugger-exception. if uncaughtexceptionhook’s value is null, spidermonkey throws an exception to the debuggee whose message blames the debugger, and includes a textual
description ofdebugger-exception. assigning anything other than a callable value or null to this property throws a typeerror exception. (this is not an ideal way to handle debugge...
Debugger.Object - Firefox Developer Tools
ook like this: { "type":"jsm", "uri":"resource:://gre/modules/xpcomutils.jsm" } firefox provides [debuggerhostannotationsforfirefox annotations] for its host objects. function properties of the debugger.object prototype the functions described below may only be called with a this value referring to a debugger.object instance; they may not be used as methods of other kinds of objects. the
descriptions use "referent" to mean "the referent of this debugger.object instance". unless otherwise specified, these methods are not invocation functions; if a call would cause debuggee code to run (say, because it gets or sets an accessor property whose handler is debuggee code, or because the referent is a proxy whose traps are debuggee code), the call throws a debugger.debuggeewouldrun exception. ge...
Examine and edit CSS - Firefox Developer Tools
eference is overridden to light. in order to use this simulator, you must set privacy.resistfingerprinting to false. you can use the color scheme simulator to see how the styles display based on the prefers-color-scheme media query, if it is defined for the page. the color scheme simulator has four states, which you can cycle through by clicking the button repeatedly: icon value
description null the prefers-color-scheme media feature is not defined. light the user prefers a light interface. dark the user prefers a dark interface. note that the first three states of the button may be difficult to distinguish visually. they typically produce a similar effect. examine computed css to see the complete computed css for the sele...
Examine and edit HTML - Firefox Developer Tools
dom inspection was implemented in firefox 61, but was hidden behind the dom.webcomponents.shadowdom.enabled pref until firefox 63. it is now turned on by default. element popup context menu you can perform certain common tasks on a specific node using a popup context menu. to activate this menu, context-click the element. the menu contains the following items — click on the links to find the
description of each command in the context menu reference: edit as html create new node duplicate node delete node attributes add attribute copy attribute value edit attribute remove attribute break on ... subtree modification attribute modification node removal use in console show dom properties show accessibility properties change pseudo-class hover ...
Waterfall - Firefox Developer Tools
bars, laid out in a waterfall to reflect the serial nature of the browser's execution. when a marker is selected you'll see more information about it in a sidebar on the right. this includes the marker's duration and some more information that's specific to the marker type. markers the markers for operations are color-coded and labeled. the following operations are recorded: name and
description color detailed information dom event javascript code that's executed in response to a dom event. event type for example, "click" or "message". event phase for example, "target" or "capture". javascript functions executed in the page are labeled with the reason the function was called: script t...
Taking screenshots - Firefox Developer Tools
tarting in firefox 62 you can use the :screenshot helper function in the web console. type :screenshot in the web console to create a screenshot of the current page. by default, the image file will be named screen shot yyy-mm-dd at hh.mm.ss.png. tip: you could type :s and then hit tab to autocomplete :screenshot. the command has the following optional parameters: command type
description --clipboard boolean when present, this parameter will cause the screenshot to be copied to the clipboard. prevents saving to a file unless you use the --file option to force file writing. --delay number the number of seconds to delay before taking the screenshot; you can use an interger or floating point number. this is useful if you want to pop open a menu or invoke...
Web Console Helpers - Firefox Developer Tools
pecified value in a readable way; this is useful for dumping the contents of objects and arrays. :screenshot creates a screenshot of the current page with the supplied filename. if you don't supply a filename, the image file will be named with the following format: screen shot yyy-mm-dd at hh.mm.ss.png the command has the following optional parameters: command type
description --clipboard boolean when present, this parameter will cause the screenshot to be copied to the clipboard. --delay number the number of seconds to delay before taking the screenshot. --dpr number the device pixel ratio to use when taking the screenshot. --file boolean when present, the screenshot will be saved to a fil...
The JavaScript input interpreter - Firefox Developer Tools
mand line remembers the commands you've typed. use this function to clear the console's command history. :screenshot new in firefox 62. create a screenshot of the current page with the supplied filename. if you don't supply a filename, the image file will be named: screen shot yyy-mm-dd at hh.mm.ss.png the command has the following optional parameters: command type
description --clipboard boolean when present, this parameter will cause the screenshot to be copied to the clipboard. --delay number the number of seconds to delay before taking the screenshot. --dpr number the device pixel ratio to use when taking the screenshot. --file boolean when present, the screenshot will be saved to a fil...
Attr - Web APIs
obsolete since gecko 14 this property now always returns null. isid read only indicates whether the attribute is an "id attribute". an "id attribute" being an attribute which value is expected to be unique across a dom document. in html dom, "id" is the only id attribute, but xml documents could define others. whether or not an attribute is unique is often determined by a dtd or other schema
description. lastchild obsolete since gecko 14 this property now always returns null. nextsibling this property now always returns null. nodename use attr.name instead. nodetype this property now always returns 2 (attribute_node). nodevalue use attr.value instead. ownerdocument you shouldn't have been using this in the first place, so you probably don't care that this is going away. parentnode ...
AudioContextLatencyCategory - Web APIs
ying a latency to a audiocontext, you can allow the user agent to select an appropriate latency for your use case that makes sense on the device on which your content is being used. audiocontextlatencycategory can be used when constructing a new audiocontext by passing one of these values as the latencyhint option in the audiocontext() constructor's options dictionary. values value
description "balanced" the user agent should balance audio output latency and power consumption when selecting a latency value. "interactive" the audio is involved in interactive elements, such as responding to user actions or needing to coincide with visual cues such as a video or game action. the user agent should select the lowest possible latency that doesn't cause glitches in the...
AudioContextOptions - Web APIs
d by audiobuffer. if not specified, the preferred sample rate for the context's output device is used by default. constants standard values for latencyhint the latencyhint property can be number specifying a preferred maximum latency in seconds or a string from the audiocontextlatencycategory enumerated string, which selects a standard value for a given type of audio usage: value
description "balanced" the user agent should balance audio output latency and power consumption when selecting a latency value. "interactive" the audio is involved in interactive elements, such as responding to user actions or needing to coincide with visual cues such as a video or game action. the user agent should select the lowest possible latency that doesn't cause glitches in the...
AudioNode - Web APIs
fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="196" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">audionode</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: an audionode can be target of events, therefore it implements the eventtarget interface.
description the audio routing graph each audionode has inputs and outputs, and multiple audio nodes are connected to build a processing graph. this graph is contained in an audiocontext, and each audio node can only belong to one audio context. a source node has zero inputs but one or multiple outputs, and can be used to generate sound. on the other hand, a destination node has no outputs; instead, all ...
AudioParam.setTargetAtTime() - Web APIs
urrenttime. if it is less than or equal to audiocontext.currenttime, the parameter will start changing immediately. timeconstant the time-constant value, given in seconds, of an exponential approach to the target value. the larger this value is, the slower the transition will be. returns a reference to this audioparam object. some older browser implementations of this interface return void.
description the change starts at the time specified in starttime and exponentially moves towards the value given by the target parameter. the decay rate as defined by the timeconstant parameter is exponential; therefore the value will never reach target completely, but after each timestep of length timeconstant, the value will have approached target by another 1-e-1≈63.2%1 - e^{-1} \approx 63.2%. for the ...
AudioProcessingEvent - Web APIs
web audio api audioprocessingevent represents events that occur when a scriptprocessornode input buffer is ready to be processed. note: as of the august 29 2014 web audio api spec publication, this feature has been marked as deprecated, and is soon to be replaced by audioworklet. properties the list below includes the properties inherited from its parent, event. property type
description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean does the event normally bubble? cancelable read only boolean is it possible to cancel the event? playbacktime read only double the time when the audio will be pl...
AudioTrack.kind - Web APIs
rackkind = audiotrack.kind; value a domstring specifying the type of content the media represents. the string is one of those found in audio track kind strings below. audio track kind strings the kinds available for audio tracks are: "alternative" a potential alternative to the main track, such as a different audio take or a version of the soundtrack with only the music and no dialogue. "
descriptions" an audio track providing audible
descriptions of the action depicted in a video track. "main" the primary audio track. "main-desc" the primary audio track with audio
descriptions mixed into it. "translation" a translated version of the primary audio track. "commentary" an audio track containing a commentary. this might be used to contain the director's commentary track on a movie, for ...
BiquadFilterNode.type - Web APIs
the type property of the biquadfilternode interface is a string (enum) value defining the kind of filtering algorithm the node is implementing. syntax var audioctx = new audiocontext(); var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = 'lowpass'; value a string (enum) representing a biquadfiltertype. type values and their meaning type
description frequency q gain lowpass standard second-order resonant lowpass filter with 12db/octave rolloff. frequencies below the cutoff pass through; frequencies above it are attenuated. the cutoff frequency. indicates how peaked the frequency is around the cutoff. the greater the value is, the greater is the peak. not used highpass standard second-order resonant highpass filter with 12...
BiquadFilterNode - Web APIs
ilternode.gain read only is an a-rate audioparam, a double representing the gain used in the current filtering algorithm. biquadfilternode.type is a string value defining the kind of filtering algorithm the node is implementing. the meaning of the different parameters depending of the type of the filter (detune has the same meaning regardless, so isn't listed below) type
description frequency q gain lowpass standard second-order resonant lowpass filter with 12db/octave rolloff. frequencies below the cutoff pass through; frequencies above it are attenuated. the cutoff frequency. indicates how peaked the frequency is around the cutoff. the greater the value is, the greater is the peak. not used highpass standard sec...
CSSPrimitiveValue.getCounterValue() - Web APIs
of the cssprimitivevalue interface is used to get the counter value. if this css value doesn't contain a counter value, a domexception is raised. modification to the corresponding style property can be achieved using the counter interface. syntax var countervalue = cssprimitivevalue.getcountervalue(); return value a counter object representing the counter value. exceptions type
description domexception an invalid_access_err is raised if the css value doesn't contain a counter value (e.g. this is not css_counter). specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.getcountervalue' in that specification. obsolete initial definition ...
CSSPrimitiveValue.getRGBColorValue() - Web APIs
e cssprimitivevalue interface is used to get an rgb color value. if this css value doesn't contain a rgb color value, a domexception is raised. modification to the corresponding style property can be achieved using the rgbcolor interface. syntax var rgbcolorvalue = cssprimitivevalue.getrgbcolorvalue(); return value an rgbcolor object representing the color value. exceptions type
description domexception an invalid_access_err is raised if the attached property can't return an rgb color value (i.e. this is not css_rgbcolor). example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("color"); console.log(cssvalue.getrgbcolorvalue()); specifications specification status comment document object model (...
CSSPrimitiveValue.getRectValue() - Web APIs
e getrectvalue() method of the cssprimitivevalue interface is used to get a rect value. if this css value doesn't contain a rect value, a domexception is raised. modification to the corresponding style property can be achieved using the rect interface. syntax var rectvalue = cssprimitivevalue.getrectvalue(); return value a rect object representing the rect value. exceptions type
description domexception an invalid_access_err is raised if the css value doesn't contain a rect value. (i.e. this is not css_rect). example var cs = window.getcomputedstyle(document.getelementbyid("clippeddiv")); var cssvalue = cs.getpropertycssvalue("clip"); console.log(cssvalue.getrectvalue()); specifications specification status comment document object mo...
CSSPrimitiveValue.getStringValue() - Web APIs
the getstringvalue() method of the cssprimitivevalue interface is used to get a string value. if this css value doesn't contain a string value, a domexception is raised. syntax var stringvalue = cssprimitivevalue.getstringvalue(); return value a string value. exceptions type
description domexception an invalid_access_err is raised if the css value doesn't contain a string value. example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("display"); console.log(cssvalue.getstringvalue()); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.getstringvalue' in that specification. obsolete initial definition ...
CSSPrimitiveValue.primitiveType - Web APIs
the value can be obtained by using the getstringvalue() method. css_cm the value is a <length> in centimeters. the value can be obtained by using the getfloatvalue() method. ...
CSSPrimitiveValue - Web APIs
co,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">cssprimitivevalue</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, cssvalue. cssprimitivevalue.primitivetype read only an unsigned short representing the type of the value. possible values are: constant
description css_attr the value is an attr() function. the value can be obtained by using the getstringvalue() method. css_cm the value is a <length> in centimeters. the value can be obtained by using the getfloatvalue() method. css_counter the value is a counter or counters function. the value can be obtained by using the getcountervalue() method. c...
CSSRuleList - Web APIs
the number of rules in the list is rules.length. note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the list directly, but instead here, only via its parent stylesheet. ...
CanvasRenderingContext2D.addHitRegion() - Web APIs
arent region for cursor fallback and navigation by accessibility tools. cursor the cursor to use when the mouse is over this region (defaults to inherit). inherits the cursor of the parent hit region, if any, or the canvas element's cursor. control an element (descendant of the canvas) to which events are to be routed. defaults to null. label a text label for accessibility tools to use as a
description of the region, if there is no control. defaults to null. role an aria role for accessibility tools to determine how to represent this region, if there is no control. defaults to null. examples using the addhitregion method this example demonstrates the addhitregion() method. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canv...
CanvasRenderingContext2D.drawWindow() - Web APIs
arent because the user's background-color preference is applied, but iframes are transparent if the page doesn't set a background. if an opaque color is used for the background color, rendering will be faster because we won't have to compute the window's transparency. flags optional used to better control the drawwindow call. flags can be ored together. constant value
description drawwindow_draw_caret 0x01 show the caret if appropriate when drawing. drawwindow_do_not_flush 0x02 do not flush pending layout notifications that could otherwise be batched up. drawwindow_draw_view 0x04 draw scrollbars and scroll the viewport if they are present. drawwindow_use_widget_layers 0x08 use the widget layer...
Basic usage of canvas - Web APIs
yed by those browsers. providing fallback content is very straightforward: just insert the alternate content inside the <canvas> element. browsers that don't support <canvas> will ignore the container and render the fallback content inside it. browsers that do support <canvas> will ignore the content inside the container, and just render the canvas normally. for example, we could provide a text
description of the canvas content or provide a static image of the dynamically rendered content. this can look something like this: <canvas id="stockgraph" width="150" height="150"> current stock price: $3.15 + 0.15 </canvas> <canvas id="clock" width="150" height="150"> <img src="images/clock.png" width="150" height="150" alt=""/> </canvas> telling the user to use a different browser that supports ca...
CloseEvent - Web APIs
owing values are permitted status codes. the following definitions are sourced from the iana website [ref]. note that the 1xxx codes are only websocket-internal and not for the same meaning by the transported data (like when the application-layer protocol is invalid). the only permitted codes to be specified in firefox are 1000 and 3000 to 4999 [source, bug]. status code name
description 0–999 reserved and not used. 1000 normal closure normal closure; the connection successfully completed whatever purpose for which it was created. 1001 going away the endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection. 1002 protoc...
console.debug() - Web APIs
ether in the order listed and output to the console. msg a javascript string containing zero or more substitution strings, which are replaced with subst1 through substn in consecutive order. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the format of the output. see using string substitutions in console for a
description of how substitutions work. see outputting text to the console in the documentation of the console object for details. specifications specification status comment console apithe definition of 'console.debug()' in that specification. living standard initial definition ...
ContentIndex.getAll() - Web APIs
the getall() method of the contentindex interface returns a promise that resolves with an iterable list of content index entries. syntax var indexedcontent = contentindex.getall(); parameters this method receives no parameters. return value returns a promise that resolves with an array of content
description items. content
description each item returned is an object containing the following data: id: a unique string identifier. title: a string title for the item. used in user-visible lists of content. title: a string title of the item. used in user-visible lists of content.
description: a string
description of the item. used in user-visible lists of content. url: a string containing the url of the corresponding html document. needs to be under the scope of the current s...
ContentIndex - Web APIs
stration) { // content index api functionality const contentindex = registration.index; } adding to the content index here we're declaring an item in the correct format and creating an asynchronous function which uses the add() method to register it with the content index. ...
Content Index API - Web APIs
stration) { // content index api functionality const contentindex = registration.index; } adding to the content index here we're declaring an item in the correct format and creating an asynchronous function which uses the add() method to register it with the content index. ...
CustomElementRegistry.define() - Web APIs
element. note that custom element names must contain a hyphen. constructor constructor for the new custom element. options optional object that controls how the element is defined. one option is currently supported: extends: string specifying the name of a built-in element to extend. used to create a customized built-in element. return value void. exceptions exception
description notsupportederror the customelementregistry already contains an entry with the same name or the same constructor (or is otherwise already defined), or extends is specified and it is a valid custom element name, or extends is specified but the element it is trying to extend is an unknown element. syntaxerror the provided name is not a valid custom element name. ...
CustomElementRegistry.whenDefined() - Web APIs
customelementregistry interface returns a promise that resolves when the named element is defined. syntax promise<> customelements.whendefined(name); parameters name custom element name. return value a promise that resolves to undefined when the custom element is defined. if the custom element is already defined, the promise is resolved immediately. exceptions exception
description syntaxerror if the provided name is not a valid custom element name, the promise rejects with a syntaxerror. examples this example uses whendefined() to detect when the custom elements that make up a menu are defined. the menu displays placeholder content until the actual menu content is ready to display. <nav id="menu-container"> <div class="menu-placeholder">loading..
DOMException() - Web APIs
if not present, the empty string '' is used. name optional returns a domstring that contains one of the strings associated with an error constant. return value domexception a newly created domexception object. ...
DOMException.message - Web APIs
syntax var domexceptionmessage = domexceptioninstance.message; value a domstring. specifications specification status comment web idlthe definition of 'message' in that specification. candidate recommendation browser compatibility the compatibility table on 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. ...
DOMException - Web APIs
ption object with a specified message and name. properties domexception.code read only returns a short that contains one of the error code constants, or 0 if none match. this field is used for historical reasons. new dom exceptions don't use this anymore: they put this info in the domexception.name attribute. domexception.message read only returns a domstring representing a message or
description associated with the given error name. domexception.name read only returns a domstring that contains one of the strings associated with an error name. error names common error names are listed here. some apis define their own sets of names, so this is not necessarily a complete list. note: because historically the errors were identified by a numeric value that corresponded with a named var...
DOMParser - Web APIs
parsing svg or html the domparser can also be used to parse an svg document (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) or an html document (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9). ther...
DeprecationReportBody - Web APIs
ing the deprecated feature that generated the report, for example navigatorgetusermedia. this can be used to group reports by deprecated feature. anticipatedremoval a date object (rendered as a string) representing the date when the feature is expected to be removed from the current browser. if the date is not known, this property will return null. message a string containing a human-readable
description of the deprecation, including information such as what newer feature has superceded it, if any. this typically matches the message a browser will display in its devtools console when a deprecated feature is used, if one is available. sourcefile a string containing the path to the source file where the deprecated feature was used, if known, or null otherwise. linenumber a number representing t...
DirectoryReaderSync - Web APIs
(e); } }; method overview entrysync readentries () raises (fileexception); method readentries() returns a lost of entries from a specific directory. call this method until an empty array is returned. entrysync readentries ( ) raises (fileexception); returns parameter none exceptions this method can raise a fileexception with the following codes: exception
description not_found_err the directory does not exist. invalid_state_err the directory has been modified since the first call to readentries was processed. security_err the browser determined that it was not safe to look up the metadata. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to...
Document.createNodeIterator() - Web APIs
w[, filter]]); values root the root node at which to begin the nodeiterator's traversal. whattoshow optional is an optional unsigned long representing a bitmask created by combining the constant properties of nodefilter. it is a convenient way of filtering for certain types of node. it defaults to 0xffffffff representing the show_all constant. constant numerical value
description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a treewalker with an attr node as its root. in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since at...
Document.createTreeWalker() - Web APIs
root a root node of this treewalker traversal. typically this will be an element owned by the document. whattoshow optional a unsigned long representing a bitmask created by combining the constant properties of nodefilter. it is a convenient way of filtering for certain types of node. it defaults to 0xffffffff representing the show_all constant. constant numerical value
description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a treewalker with an attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never...
Document.evaluate() - Web APIs
notes xpath expressions can be evaluated on html and xml documents. while using document.evaluate() works in ff2, in ff3 one must use somexmldoc.evaluate() if evaluating against something other than the current document. result types (merge with template:xpathresultconstants? these are supported values for the resulttype parameter of the evaluate method: result type value
description any_type 0 whatever type naturally results from the given expression. number_type 1 a result set containing a single number. useful, for example, in an xpath expression using the count() function. string_type 2 a result set containing a single string. boolean_type 3 a result set containing a single boolean value. useful, for example, an ...
Introduction to the DOM - Web APIs
umber of different data types being passed around the api that you should be aware of. note: because the vast majority of code that uses the dom revolves around manipulating html documents, it's common to refer to the nodes in the dom as elements, although strictly speaking not every node is an element. the following table briefly describes these data types. data type (interface)
description document when a member returns an object of type document (e.g., the ownerdocument property of an element returns the document to which it belongs), this object is the root document object itself. the dom document reference chapter describes the document object. node every object located within a document is a node of some kind. in an html document, an object can be an...
Using the W3C DOM Level 1 Core - Web APIs
parentnode.appendchild(newelement); } you can see this script as a complete example. how can i learn more? now that you are familiar with the basic concepts of the dom, you may want to learn about the dom level 1 fundamental methods. see also the dom level 1 core specification from the w3c. it's a reasonably clear spec, although it is formal. the main thing that's useful to authors is the
description of the different dom objects and all their properties and methods. also see our other dom documentation. original document information author(s): l. david baron <dbaron at dbaron dot org> copyright information: © 1998-2005 by individual mozilla.org contributors; content available under a creative commons license ...
Element.currentStyle - Web APIs
tyle() every time its value is read. /* any copyright is dedicated to the public domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ if (!("currentstyle" in element.prototype)) { object.defineproperty(element.prototype, "currentstyle", { get: function() { return window.getcomputedstyle(this); } }); } specification not part of any specification. microsoft had a
description on msdn. browser compatibility the compatibility table on 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 webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcurrents...
Element.getAttribute() - Web APIs
utes for details. syntax let attribute = element.getattribute(attributename); where attribute is a string containing the value of attributename. attributename is the name of the attribute whose value you want to get. examples const div1 = document.getelementbyid('div1'); const align = div1.getattribute('align'); alert(align); // shows the value of align for the element with id="div1"
description lower casing when called on an html element in a dom flagged as an html document, getattribute() lower-cases its argument before proceeding. non-existing attributes essentially all web browsers (firefox, internet explorer, recent versions of opera, safari, konqueror, and icab, as a non-exhaustive list) return null when the specified attribute does not exist on the specified element; this is w...
Element.releasePointerCapture() - Web APIs
syntax targetelement.releasepointercapture(pointerid); parameters pointerid the pointerid of a pointerevent object. return value this method returns undefined. exceptions exception explanation invalidpointerid pointerid does not match any of the active pointers. ...
Element: webkitmouseforcechanged event - Web APIs
kpad/touchscreen. bubbles unknown cancelable unknown interface mouseevent webkitmouseforcechanged is a proprietary, webkit-specific event introduced by apple to support their force touch events feature. this event first fires after the mousedown event and stops firing before the mouseup event. specifications not part of any specification. apple has a
description at the mac developer library. ...
Comparison of Event Targets - Web APIs
for the mouseout event, it holds the node that the mouse moved to. event type event.target event.relatedtarget mouseover the eventtarget which the pointing device entered the eventtarget which the pointing device exited mouseout the eventtarget which the pointing device exited the eventtarget which the pointing device entered todo: also needs
descriptions for dragenter and dragexit events. example <hbox id="outer"> <hbox id="inner" onmouseover="dump('mouseover ' + event.relatedtarget.id + ' > ' + event.target.id + '\n');" onmouseout="dump('mouseout ' + event.target.id + ' > ' + event.relatedtarget.id + '\n');" style="margin: 100px; border: 10px solid black; width: 100px; height: 100px;" /> </hbox> ...
Event.eventPhase - Web APIs
ates which phase of the event flow is currently being evaluated. syntax let phase = event.eventphase; value returns an integer value which specifies the current evaluation phase of the event flow. possible values are listed in event phase constants. constants event phase constants these values describe which phase the event flow is currently being evaluated. constant value
description event.none 0 no event is being processed at this time. event.capturing_phase 1 the event is being propagated through the target's ancestor objects. this process starts with the window, then document, then the htmlhtmlelement, and so on through the elements until the target's parent is reached. event listeners registered for capture mode when eventtarget.addeventl...
FileError - Web APIs
werful storage apis (such as file system, blobbuilder, and filereader) throw errors if you run the app locally from file://. when you're just testing your app, and you don't want to set up a web server, you can bypass the security restriction on chrome. just start chrome with the --allow-file-access-from-files flag. use the flag only for testing purposes. attribute attribute type
description code unsigned short the most appropriate error code for the condition. see error codes for possible values. error codes note: do not rely on the numeric values of the constants, which might change as the specifications continue to change. use the constant names instead. constant value
description encoding_err 5 the url is malformed. make s...
FileException - Web APIs
rrors occur, forward them to the main app using postmessage() as in the following: function onerror(e) { postmessage('error:' + e.tostring()); } try { //error is thrown if "log.txt" already exists. var fileentry = fs.root.getfile('log.txt', {create: true, exclusive:true}0; } catch (e) { onerrror(e); } the sample code was borrowed from html5rocks attribute attribute type
description code unsigned short the most appropriate error code for the condition. constants note: do not rely on the numeric values of the constants, which might change as the specifications continue to change. use the constant names instead. constant value
description encoding_err 5 the url is malformed. make sure that the url is complete and valid.
FileList - Web APIs
st on them which allows access to the items in this list. for example, if the html includes the following file input: <input id="fileitem" type="file"> the following line of code fetches the first file in the node's file list as a file object: var file = document.getelementbyid('fileitem').files[0]; method overview file item(index); properties attribute type
description length integer a read-only value indicating the number of files in the list. methods item() returns a file object representing the file at the specified index in the file list. file item( index ); parameters index the zero-based index of the file to retrieve from the list. return value the file representing the requested file. example this example iterates...
FileReader.readyState - Web APIs
none of the read methods called yet. 1 loading a read method has been called. 2 done the operation is complete. empty the filereader has been created, but no readas method was called yet. loading a readas method was invoked. a file or blob is being read, and no error has occurred yet. done the read operation is complete. ...
FileReader.result - Web APIs
he format of the data depends on which of the methods was used to initiate the read operation. syntax var file = instanceoffilereader.result value an appropiate string or arraybuffer based on which of the reading methods was used to initiate the read operation. the value is null if the reading is not yet complete or was unsuccessful. the result types are described below. method
description readasarraybuffer() the result is a javascript arraybuffer containing binary data. readasbinarystring() the result contains the raw binary data from the file in a string. readasdataurl() the result is a string with a data: url representing the file's data. readastext() the result is text in a string. example this example presents a funct...
FileSystemEntry - Web APIs
ers that are stored in the origin of your app. just use filesystem: scheme for the root directory of the origin of the app. for example, if your app is in http://www.html5rocks.com, open filesystem:http://www.html5rocks.com/temporary/ in a tab. chrome shows a read-only list of all the files and folders stored the origin of your app. example to see an example of how tourl() works, see the method
description. the snippet below shows you how you can remove a file by name. // taking care of the browser-specific prefixes. window.requestfilesystem = window.requestfilesystem || window.webkitrequestfilesystem; ... // opening a file system with temporary storage window.requestfilesystem(temporary, 1024*1024 /*1mb*/, function(fs) { fs.root.getfile('log.txt', {}, function(fileentry) { fileentry.rem...
FileSystemSync - Web APIs
2 and follows the w3c specifications (working draft) drafted on april 19, 2011. the specification is abandonned for the moment, failing to get significant traction. basic concepts the filesystemsync object is your gateway to the entire api and you will use it a lot. so once you have a reference, cache the object in a global variable or class property. attributes attribute type
description name readonly domstring name of the file system. the name must be unique across the list of exposed file systems. root readonly directoryentry the root directory of the file system. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/...
GeolocationPositionError.code - Web APIs
the geolocationpositionerror.code read-only property is an unsigned short representing the error code. syntax let typeerr = geolocationpositionerrorinstance.code value an unsigned short representing the error code. the following values are possible: value associated constant
description 1 permission_denied the acquisition of the geolocation information failed because the page didn't have the permission to do it. 2 position_unavailable the acquisition of the geolocation failed because one or several internal sources of position returned an internal error. 3 timeout the time allowed to acquire the geolocation, defined by positionoptions.timeout information that was reached before the information was obtained. specif...
GeolocationPositionError - Web APIs
the geolocationpositionerror interface represents the reason of an error occurring when using the geolocating device. properties the geolocationpositionerror interface doesn't inherit any property. geolocationpositionerror.code read only secure context returns an unsigned short representing the error code. the following values are possible: value associated constant
description 1 permission_denied the acquisition of the geolocation information failed because the page didn't have the permission to do it. 2 position_unavailable the acquisition of the geolocation failed because at least one internal source of position returned an internal error. 3 timeout the time allowed to acquire the geolocation, defined by pos...
GeometryUtils - Web APIs
om nodes. geometryutils is a raw interface and no object of this type can be created; it is implemented by text, element, csspseudoelement, and document objects. properties this interface does not implement any properties. methods geometryutils.getboxquads() returns a list of domquad objects representing the css fragments of the node. geometryutils.convertquadfromnode() fixme: needs a
description geometryutils.convertrectfromnode() fixme: needs a
description geometryutils.convertpointfromnode() fixme: needs a
description specifications specification status comment css object model (cssom) view modulethe definition of 'geometryutils' in that specification. working draft initial definition ...
GestureEvent - Web APIs
tward unpinch (zoom in). initial value: 1.0 methods this interface also inherits methods of its parents, uievent and event. gestureevent.initgestureevent() initializes the value of an gestureevent. if the event has already being dispatched, this method does nothing. gesture event types gesturestart gesturechange gestureend specifications not part of any specification. apple has a
description at the safari developer library. browser compatibility the compatibility table on 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 webviewchrome for androidfirefox for androidopera for androidsafari on ios...
GlobalEventHandlers.onanimationend - Web APIs
for information about why, and how to support running an animation more than once, see run an animation again in css animations tips and tricks. result assembled together, you get this: specification specification status comment css animationsthe definition of 'onanimationend' in that ...
GlobalEventHandlers.onanimationstart - Web APIs
for information about why, and how to support running an animation more than once, see run an animation again in css animations tips and tricks. result assembled together, you get this: specification specification status comment css animationsthe definition of 'onanimationstart' in tha...
msAudioDeviceType - Web APIs
nications" /> by default, audio on your system will output to your default speakers and be considered a foreground element, meaning that the audio will play only when the element is active in the app. for real-time communications, you can use the msaudiodevicetype property with the value console, multimedia, or communications to specify where the current audio should output. value include a
description of the property's value, including data type and what it represents. value
description console specifies that the audio output will be sent to the console device. multimedia specifies that the audio output will be sent to the multimedia device. communications specifies that the audio output will be sent to the communications device. se...
HTMLBodyElement - Web APIs
" text-anchor="middle" alignment-baseline="middle">htmlbodyelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement and from windoweventhandlers. htmlbodyelement.alink is a domstring that represents the color of active hyperlinks. htmlbodyelement.background is a domstring that represents the
description of the location of the background image resource. note that this is not an uri, though some older version of some browsers do expect it. htmlbodyelement.bgcolor is a domstring that represents the background color for the document. htmlbodyelement.link is a domstring that represents the color of unvisited links. htmlbodyelement.text is a domstring that represents the foreground color o...
HTMLButtonElement - Web APIs
candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmlbuttonelement.validity read only is a validitystate representing the validity states that this button is in. htmlbuttonelement.value is a domstring representing the current form control value of the button. methods inherits methods from its parent, htmlelement name return type
description checkvalidity() boolean not supported for reset or button elements. reportvalidity() boolean not supported for reset or button elements. setcustomvalidity(in domstring error) void not supported for reset or button elements. with gecko-based browser, use the :-moz-submit-invalid pseudo-class to style submit buttons based on the validation of ...
HTMLCanvasElement.toDataURL() - Web APIs
base64,/9j/4aaqskzjrgabaq...9oadambaairaxeapwd/ad/6ap/z" var mediumquality = canvas.todataurl('image/jpeg', 0.5); var lowquality = canvas.todataurl('image/jpeg', 0.1); example: dynamically change images you can use this technique in coordination with mouse events in order to dynamically change images (gray-scale vs. ...
HTMLFontElement.color - Web APIs
the obsolete htmlfontelement.color property is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb format. ...
HTMLFontElement.face - Web APIs
ma-separated list of one or more font names. the document text, in the default style, is rendered as the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. ...
HTMLFontElement.size - Web APIs
the obsolete htmlfontelement.size property is a domstring that reflects the size html attribute. it contains either an integer number in the range of 1-7 or a relative value to increase/decrease the value of the size attribute of the <basefont> element. ...
HTMLIFrameElement - Web APIs
ecifies the content security policy that an embedded document must agree to enforce upon itself. htmliframeelement.frameborder is a domstring that indicates whether to create borders between frames. htmliframeelement.height is a domstring that reflects the height html attribute, indicating the height of the frame. htmliframeelement.longdesc is a domstring that contains the uri of a long
description of the frame. htmliframeelement.marginheight is a domstring being the height of the frame margin. htmliframeelement.marginwidth is a domstring being the width of the frame margin. htmliframeelement.name is a domstring that reflects the name html attribute, containing a name by which to refer to the frame. htmliframeelement.featurepolicy read only returns the featurepolicy interface ...
HTMLImageElement - Web APIs
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 under constrained network conditions or on slow ...
HTMLKeygenElement - Web APIs
empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. validity read only is a validitystate representing the validity states that this element is in. willvalidate is a boolean that is always false because keygen objects are never candidates for constraint validation. methods name & arguments return
description checkvalidity() boolean always returns true because keygen objects are never candidates for constraint validation. setcustomvalidity(in domstring error) void sets a custom validity message for the element. if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate. ...
HTMLMediaElement: loadedmetadata event - Web APIs
the loadedmetadata event is fired when the metadata has been loaded. bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onloadedmetadata specification html5 media additional properties property type
description mozchannels read only int the number of channels. mozsamplerate read only int the sample rate per second. mozframebufferlength read only int the number of samples collected in all channels. examples these examples add an event listener for the htmlmediaelement's loadedmetadata event, then post a message when that event handler has reacted to the event firing. ...
HTMLMediaElement.networkState - Web APIs
also, readystate is have_nothing. network_idle 1 htmlmediaelement is active and has selected a resource, but is not using the network. network_loading 2 the browser is downloading htmlmediaelement data. ...
HTMLMediaElement.readyState - Web APIs
have_metadata 1 enough of the media resource has been retrieved that the metadata attributes are initialized. seeking will no longer raise an exception. ...
HTMLMediaElement - Web APIs
ough information to determine whether the media will play or not, or an empty string if the media cannot be played. htmlmediaelement.fastseek() directly seeks to the given time. htmlmediaelement.load() resets the media to the beginning and selects the best available source from the sources provided using the src attribute or the <source> element. htmlmediaelement.mozcapturestream() [enter
description] htmlmediaelement.mozcapturestreamuntilended() [enter
description] htmlmediaelement.mozgetmetadata() returns object, which contains properties that represent metadata from the playing media resource as {key: value} pairs. a separate copy of the data is returned each time the method is called. this method must be called after the loadedmetadata event fires. htmlmediaelement.pause() pause...
HTMLMetaElement - Web APIs
0" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmetaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. name type
description content domstring gets or sets the value of meta-data property. httpequiv domstring gets or sets the name of an http response header to define for a document. name domstring gets or sets the name of a meta-data property to define for a document. scheme domstring gets or sets the name of a scheme used to interpret the value of a met...
HTMLOptionsCollection - Web APIs
you can either remove options from the end by lowering the value, or add blank options at the end by raising the value. mozilla allows this, while other implementations could potentially throw a domexception. methods this interface inherits the methods of its parent, htmlcollection. ...
HTMLTableElement.summary - Web APIs
the htmltableelement.summary property represents the table
description. syntax htmltableelement.summary = string; varstring = htmltableelement.summary; example htmltableelement.summary = "usage statistics"; specification w3c dom 2 html specification ...
HTMLTableElement - Web APIs
n take one of the following values: "void", "above", "below", "hsides", "vsides", "lhs", "rhs", "box", or "border". htmltableelement.rules is a domstring containing the type of the internal borders of the table. it reflects the obsolete rules attribute and can take one of the following values: "none", "groups", "rows", "cols", or "all". htmltableelement.summary is a domstring containing a
description of the purpose or the structure of the table. it reflects the obsolete summary attribute. htmltableelement.width is a domstring containing the length in pixels or in percentage of the desired width fo the entire table. it reflects the obsolete width attribute. methods inherits methods from its parent, htmlelement. htmltableelement.createthead() returns an htmlelement representing the ...
HTMLTimeElement.dateTime - Web APIs
the htmltimeelement.datetime property is a domstring that reflects the datetime html attribute, containing a machine-readable form of the element's date and time value. ...
onMSVideoFormatChanged - Web APIs
ndards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. onmsvideoformatchanged is an event which occurs when the video format changes. this proprietary property is specific to internet explorer and microsoft edge. ...
onMSVideoFrameStepCompleted - Web APIs
ites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. onmsvideoframestepcompleted is an event which occurs when the video frame has been stepped forward or backward one frame. this proprietary property is specific to internet explorer and microsoft edge. ...
onMSVideoOptimalLayoutChanged - Web APIs
n production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. onmsvideooptimallayoutchanged is an event which occurs when the msislayoutoptimalforplayback state changes. this proprietary property is specific to internet explorer and microsoft edge. ...
HTML Drag and Drop API - Web APIs
droppable element, and drop them by releasing the mouse button. a translucent representation of the draggable elements follows the pointer during the drag operation. for web sites, extensions, and xul applications, you can customize which elements can become draggable, the type of feedback the draggable elements produce, and the droppable elements. this overview of html drag and drop includes a
description of the interfaces, basic steps to add drag-and-drop support to an application, and an interoperability summary of the interfaces. drag events html drag-and-drop uses the dom event model and drag events inherited from mouse events. a typical drag operation begins when a user selects a draggable element, drags the element to a droppable element, and then releases the dragged element. during drag...
History.pushState() - Web APIs
ll to pushstate(), but it might attempt to load the url later, for instance after the user restarts the browser. the new url does not need to be absolute; if it's relative, it's resolved relative to the current url. the new url must be of the same origin as the current url; otherwise, pushstate() will throw an exception. if this parameter isn't specified, it's set to the document's current url.
description in a sense, calling pushstate() is similar to setting window.location = "#foo", in that both will also create and activate another history entry associated with the current document. but pushstate() has a few advantages: the new url can be any url in the same origin as the current url. in contrast, setting window.location keeps you at the same document only if you modify only the hash. you d...
IDBCursor.advance() - Web APIs
the advance() method of the idbcursor interface sets the number of times a cursor should move its position forward. note: this feature is available in web workers. syntax cursor.advance(count); parameters count the number of times to move the cursor forward. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbcursor's transaction is inactive. typeerror the value passed into the count parameter was zero or a negative number. invalidstateerror the cursor is currently being iterated or has iterated past its end. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through the records in ...
IDBCursor.continue() - Web APIs
item whose key matches the optional key parameter. if no key is specified, the cursor advances to the immediate next position, based on its direction. note: this feature is available in web workers. syntax cursor.continue(key); parameters key optional the key to position the cursor at. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbcursor's transaction is inactive. dataerror the key parameter may have any of the following conditions: the key is not a valid key. the key is less than or equal to this cursor's position and the cursor's direction is next or nextunique. the key is greater than or equal to this cursor's position and this cursor...
IDBCursor.continuePrimaryKey() - Web APIs
m an index. using it for cursors coming from an object store will throw an error. note: this feature is available in web workers. syntax cursor.continueprimarykey(key, primarykey); parameters key the key to position the cursor at. primarykey the primary key to position the cursor at. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbcursor's transaction is inactive. dataerror the key parameter may have any of the following conditions: the key is not a valid key. the key is less than or equal to this cursor's position and the cursor's direction is next or nextunique. the key is greater than or equal to this cursor's position and this cursor...
IDBCursor.delete() - Web APIs
penkeycursor(). for such needs, you have to use idbindex.opencursor() instead. note: this feature is available in web workers. syntax myidbcursor.delete(); returns an idbrequest object on which subsequent events related to this operation are fired. the result attribute is set to undefined. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbcursor's transaction is inactive. readonlyerror the transaction mode is read-only. invalidstateerror the cursor was created using idbindex.openkeycursor, is currently being iterated, or has iterated past its end. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to i...
IDBCursor.direction - Web APIs
e direction of traversal of the cursor (set using idbobjectstore.opencursor for example). see the values section below for possible values. note: this feature is available in web workers. syntax var direction = cursor.direction; value a string (defined by the idbcursordirection enum) indicating the direction in which the cursor is traversing the data. possible values are: value
description next this direction causes the cursor to be opened at the start of the source. nextunique this direction causes the cursor to be opened at the start of the source. for every key with duplicate values, only the first record is yielded. prev this direction causes the cursor to be opened at the end of the source. prevunique this direction causes th...
IDBCursor.update() - Web APIs
ursor() instead. note: this feature is available in web workers. syntax var anidbrequest = myidbcursor.update(value); parameters value the new value to be stored at the current position. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbcursor's transaction is inactive. readonlyerror the transaction mode is read only. invalidstateerror the cursor was created using idbindex.openkeycursor, is currently being iterated, or has iterated past its end. dataerror the underlying object store uses in-line keys and the property in the value at the obj...
IDBDatabase.deleteObjectStore() - Web APIs
es that reference it. as with idbdatabase.createobjectstore, this method can be called only within a versionchange transaction. note: this feature is available in web workers. syntax dbinstance.deleteobjectstore(name); parameters name the name of the object store you want to delete. exceptions this method may raise a domexception of one of the following types: exception
description invalidstateerror occurs if the method was not called from a versionchange transaction callback. for older webkit browsers, you must call first. transactioninactiveerror occurs if a request is made on a source database that doesn't exist (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which w...
IDBDatabase.transaction() - Web APIs
readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.indexeddb.experimental pref is set to true in about:config. details optional dictionary of other settings, supported only by chrome: return value an idbtransaction object. exceptions this method may raise a domexception of one of the following types: exception
description invalidstateerror the close() method has previously been called on this idbdatabase instance. notfounderror an object store specified in in the storenames parameter has been deleted or removed. typeerror the value for the mode parameter is invalid. invalidaccesserror the function was called with an empty list of store names. ...
IDBDatabaseException - Web APIs
obsolete: this interface was removed from the specification and was replaced by usage of domexception. in the indexeddb api, an idbdatabaseexception object represents exception conditions that can be encountered while performing database operations. attributes attribute type
description code unsigned short the most appropriate error code for the condition. message domstring error message describing the exception raised. constants note: do not rely on the numeric values of the constants, which might change as the specifications continue to change. use the constant names instead. constant value
description abort_err 8 a request was aborted, for example, through a call to idbtransaction.abort. con...
IDBEnvironmentSync - Web APIs
ion of the indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the unimplemented idbenvironmentsync interface of the indexeddb api will be implemented by worker objects. attributes attribute type
description indexeddbsync readonly idbfactorysync provides a synchronous means of accessing the capabilities of indexed databases. note: until the indexed database api specification is finalized, this attribute should be accessed as moz_indexeddbsync. ...
IDBFactory.cmp() - Web APIs
ays are treated as equivalent). this throws an exception if either of the values is not a valid key. syntax var result = indexeddb.cmp(first, second); parameters first the first key to compare. second the second key to compare. return value an integer that indicates the result of the comparison; the table below lists the possible values and their meanings: returned value
description -1 1st key is less than the 2nd key 0 1st key is equal to the 2nd key 1 1st key is greater than the 2nd key exceptions this method may raise a domexception of the following types: attribute
description dataerror one of the supplied keys was not a valid key. example var a = 1; var b = 2; var result = window.indexeddb.cmp(...
databases - Web APIs
mited. syntax const promise = indexeddb.databases() parameters the method does not take in any parameters. return value a promise that resolves either to an error or a list of dictionaries, each with two elements, name and version. name the database name. version the database version. exceptions this method may raise a domexception of the following types: attribute
description securityerror the method is called from an opaque origin. other error specification does not describe all possible errors. example const promise = indexeddb.databases() promise.then(databases => { console.log(databases) }) specifications specification status comment indexed database api draftthe definition of 'databases()' in that sp...
IDBFactory.open() - Web APIs
age instead. note: you can find out more information on the different available storage types, and how firefox handles client-side data storage, at browser storage limits and eviction criteria. return value a idbopendbrequest object on which subsequent events related to this request are fired. exceptions this method may raise a domexception of the following types: exception
description typeerror the value of version is zero or a negative number or not a number. example example of calling open with the current specification's version parameter: var request = window.indexeddb.open("todolist", 4); in the following code snippet, we make a request to open a database, and include handlers for the success and error cases. for a full working example, see our t...
IDBIndex.count() - Web APIs
is available in web workers. syntax var request = myindex.count(); var request = myindex.count(key); parameters key optional the key or key range that identifies the record to be counted. return value a idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a ba...
IDBIndex.get() - Web APIs
est = myindex.get(key); parameters key optional a key or idbkeyrange that identifies the record to be retrieved. if this value is null or missing, the browser will use an unbound key range. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a ba...
IDBIndex.getAll() - Web APIs
rds to return. if this value exceeds the number of records in the query, the browser will only retrieve the first item. if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of the following types: exception
description transactioninactiveerror this idbindex's transaction is inactive. invalidstateerror the idbindex has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. example var myindex = objectstore.index('index'); var getallrequest = myindex.getall(); getallrequest.onsuccess = function() { console.log(get...
IDBIndex.getAllKeys() - Web APIs
rds to return. if this value exceeds the number of records in the query, the browser will only retrieve the first item. if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of the following types: exception
description transactioninactiveerror this idbindex's transaction is inactive. invalidstateerror the idbindex has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. example var myindex = objectstore.index('index'); var getallkeysrequest = myindex.getallkeys(); getallkeysrequest.onsuccess = function() {...
IDBIndex.getKey() - Web APIs
st = myindex.getkey(key); parameters key optional a key or idbkeyrange that identifies a record to be retrieved. if this value is null or missing, the browser will use an unbound key range. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a ba...
IDBIndex.openCursor() - Web APIs
f nothing is passed, this will default to a key range that selects all the records in this object store. direction optional the cursor's direction. see idbcursor constants for possible values. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbindex's transaction is inactive. typeerror the value for the direction parameter is invalid. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, the...
IDBIndex.openKeyCursor() - Web APIs
f nothing is passed, this will default to a key range that selects all the records in this object store. direction optional the cursor's direction. see idbcursor constants for possible values. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbindex's transaction is inactive. typeerror the value for the direction parameter is invalid. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, t...
IDBIndexSync - Web APIs
if this attribute is null, this index is not auto-populated. name readonly domstring the name of this index. storename readonly domstring this index's referenced object store. unique readonly boolean if true, a key can have only one value within the index; if false, a key can hav...
IDBKeyRange.bound() - Web APIs
per bound of the new key range. loweropen optional indicates whether the lower bound excludes the endpoint value. the default is false. upperopen optional indicates whether the upper bound excludes the endpoint value. the default is false. return value idbkeyrange: the newly created key range. exceptions this method may raise a domexception of the following type: exception
description dataerror the following conditions raise an exception: the lower or upper parameters were not passed a valid key. the lower key is greater than the upper key. the lower key and upper key match and either of the bounds are open. example the following example illustrates how you'd use a bound key range. here we declare a keyrangevalue = idb...
IDBKeyRange.includes() - Web APIs
interface returns a boolean indicating whether a specified key is inside the key range. note: this feature is available in web workers. syntax var isincluded = mykeyrange.includes(key) parameters key the key you want to check for in your key range. this can be any type. return value a boolean. exceptions this method may raise a domexception of the following type: attribute
description dataerror the supplied key was not a valid key. example var keyrangevalue = idbkeyrange.bound('a', 'k', false, false); var myresult = keyrangevalue.includes('f'); // returns true var myresult = keyrangevalue.includes('w'); // returns false polyfill the includes() method was added in the second edition of the indexed db specification. for browsers that do not support it, t...
IDBKeyRange.lowerBound() - Web APIs
bound(lower); var myidbkeyrange = idbkeyrange.lowerbound(lower, open); parameters lower specifies the lower bound of the new key range. open optional indicates whether the lower bound excludes the endpoint value. the default is false. return value idbkeyrange: the newly created key range. exceptions this method may raise a domexception of the following type: exception
description dataerror the value parameter passed was not a valid key. example the following example illustrates how you'd use a lower bound key range. here we declare keyrangevalue = idbkeyrange.lowerbound("f", false); — a range that includes the value "f" and everthing after it. we open a transaction (using idbtransaction) and an object store, and open a cursor with...
IDBKeyRange.only() - Web APIs
method of the idbkeyrange interface creates a new key range containing a single value. note: this feature is available in web workers. syntax var myidbkeyrange = idbkeyrange.only(value); parameters value is the value for the new key range. return value idbkeyrange: the newly created key range. exceptions this method may raise a domexception of the following types: exception
description dataerror the value parameter passed was not a valid key. example the following example illustrates how you'd use an only key range. here we declare a keyrangevalue = idbkeyrange.only("a"); — a range that only includes the value "a". we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declari...
IDBKeyRange.upperBound() - Web APIs
rs. syntax var myidbkeyrange = idbkeyrange.upperbound(upper[, open=false]) parameters bound specifies the upper bound of the new key range. open indicates whether the upper bound excludes the endpoint value. the default is false. optional return value idbkeyrange: the newly created key range. exceptions this method may raise a domexception of the following type: exception
description dataerror the value parameter passed was not a valid key. example the following example illustrates how you'd use an upper bound key range. here we declare keyrangevalue = idbkeyrange.upperbound("f"); — a range that includes the value "f" and everything before it. we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjects...
IDBObjectStore.add() - Web APIs
ctstore.add(value); var request = objectstore.add(value, key); parameters value the value to be stored. key optional the key to use to identify the record. if unspecified, it results to null. returns an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description readonlyerror the transaction associated with this operation is in read-only mode. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror any of the following conditions apply: the object store uses in-line keys or has a key generator, and a key parameter was provided. the object store uses out-of-line keys an...
IDBObjectStore.clear() - Web APIs
ore. to remove only some of the records in a store, use idbobjectstore.delete passing a key or idbkeyrange. note: this feature is available in web workers. syntax var request = objectstore.clear(); returns an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description readonlyerror the transaction associated with this operation is in read-only mode. transactioninactiveerror this idbobjectstore's transaction is inactive. example in the following code snippet, we open a read/write transaction on our database and clear all the current data out of the object store using clear(). for a full working example, see our to-do no...
IDBObjectStore.count() - Web APIs
yntax var request = objectstore.count(); var request = objectstore.count(query); parameters query optional a key or idbkeyrange object that specifies a range of records you want to count. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description invalidstateerror this idbobjectstore has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then count the number of records in the store using count() — when the success handle...
IDBObjectStore.delete() - Web APIs
t = objectstore.delete(keyrange); parameters key the key of the record to be deleted, or an idbkeyrange to delete all records with keys in range. return value an idbrequest object on which subsequent events related to this operation are fired. the request.result attribute is set to undefined. exceptions this method may raise a domexception of the following types: exception
description transactioninactiveerror this object store's transaction is inactive. readonlyerror the object store's transaction mode is read-only. invalidstateerror the object store has been deleted. dataerror the key is not a valid key or a key range. example in the following code snippet, we open a read/write transaction on our database an...
IDBObjectStore.deleteIndex() - Web APIs
saction mode callback. note that this method synchronously modifies the idbobjectstore.indexnames property. note: this feature is available in web workers. syntax objectstore.deleteindex(indexname); parameters indexname the name of the existing index to remove. return value undefined exceptions this method may raise a domexception of one of the following types: exception
description invalidstateerror occurs if the method was not called from a versionchange transaction mode callback. transactioninactiveerror occurs if the transaction this idbobjectstore belongs to is not active (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (s...
IDBObjectStore.get() - Web APIs
if it does not. note: this feature is available in web workers. syntax var request = objectstore.get(key); parameters key the key or key range that identifies the record to be retrieved. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. example in the following code snippet, we open a read/write transaction on our database and get one specific record from object store...
IDBObjectStore.getAll() - Web APIs
cords in this object store. count optional specifies the number of values to return if more than one is found. if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key or is null. invalidstateerror the idbobjectstore has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. specifications speci...
IDBObjectStore.getAllKeys() - Web APIs
resolves to an idbkeyrange. count optional specifies the number of values to return if more than one is found. if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key or is null. invalidstateerror the idbobjectstore has been deleted or removed. specifications specification status comment indexed database api draftthe definition of 'getallkey...
IDBObjectStore.getKey() - Web APIs
uest object. note: this feature is available in web workers. syntax var request = objectstore.getkey(key); parameters key the key or key range that identifies the record to be retrieved. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. example let openrequest = indexeddb.open("telemetry"); openrequest.onsuccess = (event) => { let db = event.target.result; let sto...
IDBObjectStore.index() - Web APIs
used to, for example, return a series of records sorted by that index using a cursor. note: this feature is available in web workers. syntax var index = objectstore.index(name); parameters name the name of the index to open. return value an idbindex object for accessing the index. exceptions this method may raise a domexception of one of the following types: exception
description invalidstateerror the source object store has been deleted, or the transaction for the object store has finished. notfounderror there is no index with the given name (case-sensitive) in the database. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cu...
IDBObjectStore.openCursor() - Web APIs
this object store. direction optional an idbcursordirection telling the cursor what direction to travel. valid values are "next", "nextunique", "prev", and "prevunique". the default is "next". return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description invalidstateerror this idbobjectstore or idbindex has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object st...
IDBObjectStore.openKeyCursor() - Web APIs
this object store. direction optional an idbcursordirection telling the cursor what direction to travel. valid values are "next", "nextunique", "prev", and "prevunique". the default is "next". return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description invalidstateerror this idbobjectstore or idbindex has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object st...
IDBObjectStore.put() - Web APIs
therefore the key is not in a field on the record object. in such cases, calling put(item) will always insert a new record, because it doesn't know what existing record you might want to modify. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception
description readonlyerror the transaction associated with this operation is in read-only mode. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror any of the following conditions apply: the object store uses in-line keys or has a key generator, and a key parameter was provided. the object store uses out-of-line keys an...
IDBTransaction.abort() - Web APIs
ction interface rolls back all the changes to objects in the database associated with this transaction. all pending idbrequest objects created during this transaction have their idbrequest.error attribute set to aborterror. note: this feature is available in web workers. syntax transaction.abort(); exceptions this method may raise a domexception of the following type: exception
description invalidstateerror the transaction has already been committed or aborted. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply abo...
IDBTransaction.commit() - Web APIs
requests have been made. commit() can be used to start the commit process without waiting for events from outstanding requests to be dispatched. if it is called on a transaction that is not active, it throws an invalidstateerror domexception. note: this feature is available in web workers. syntax transaction.commit(); parameters none. return value void. exceptions exception
description invalidstateerror the transaction state is not active. examples // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["mydb"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; tran...
IDBTransaction.objectStore() - Web APIs
t transaction object, a different idbobjectstore instance is returned. note: this feature is available in web workers. syntax idbtransaction.objectstore(name); parameters name the name of the requested object store. return value an idbobjectstore object for accessing an object store. exceptions this method may raise a domexception of one of the following types: exception
description notfounderror the requested object store is not in this transaction's scope. invalidstateerror the request was made on a source object that has been deleted or removed, or if the transaction has finished. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached...
IDBTransaction - Web APIs
complete property. error fired when a request returns an error and the event bubbles up to the transaction object. also available via the onerror property. mode constants these constants are no longer available — they were removed in gecko 25. you should use the string constants directly instead. (bug 888598) transactions can have one of three modes: constant value
description read_only "readonly" (0 in chrome) allows data to be read but not changed. read_write "readwrite" (1 in chrome) allows reading and writing of data in existing data stores to be changed. version_change "versionchange" (2 in chrome) allows any operation to be performed, including ones that delete and...
IDBTransactionSync - Web APIs
when an application creates an idbtransactionsync object, it blocks until the browser is able to reserve the require database objects. method overview void abort() raises (idbdatabaseexception); void commit() raises (idbdatabaseexception); idbobjectstoresync objectstore(in domstring name) raises (idbdatabaseexception); attributes attribute type
description db idbdatabasesync the database connection that this transaction is associated with. static boolean if true, this transaction is static; if false, this transaction is dynamic. methods abort() call this method to signal a need to cancel the effects of the operations performed by this transaction. when this method is called, the browser ignores all the cha...
IDBVersionChangeRequest - Web APIs
e the indexeddb api represents a request to change the version of a database. it is used only by the setversion() method of idbdatabase. methods inherits from: idbrequest idbversionchangerequest.setversion updates the version of the database. returns immediately and runs a versionchange transaction on the connected database in a separate thread. attributes attribute type
description onblocked function the event handler for the blocked event. browser compatibility the compatibility table on 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 webviewchrome for andr...
Using IndexedDB - Web APIs
ingle database can contain any number of object stores. whenever a value is stored in an object store, it is associated with a key. there are several different ways that a key can be supplied depending on whether the object store uses a key path or a key generator. the following table shows the different ways the keys are supplied: key path (keypath) key generator (autoincrement)
description no no this object store can hold any kind of value, even primitive values like numbers and strings. you must supply a separate key argument whenever you want to add a new value. yes no this object store can only hold javascript objects. the objects must have a property with the same name as the key path. no yes this object store can hold any kind o...
compareVersion - Web APIs
it is often used as a check against which to initiate the installation process. if registryname is not found in the client version registry or if registryname does not have version, registryname is assumed to have a version of 0.0.0.0. if registryname represents a file, compareversion checks ...
install - Web APIs
no longer invoked unless the website performing the installation is whitelisted. returns install returns true if the function succeeded and false if it did not, but these values are not always reliable as a determinant of the success of the operation. to surface detail about the status of the installation, use the optional callback function and its status parameter, as in the example below.
description in the example below, a special javascript object constructor is used to create an object that can be passed to the install() method. the { } constructor takes a comma-delimited set of label/value pairs. for installations, these pairs are the xpinstall confirm dialog display name and the path of the xpi, respectively. in the example below, a single installation object is created, but you can us...
installChrome - Web APIs
full or relative url to download name name is displayed in the dialog, but is also used to *select* the theme somust match exactly the name in the internal manifest.rdf file. returns a boolean value indicating false if the software install feature has been turned off, and true if it's on. note that this return value does not indicate anything about the success of the installation.
description installchrome is a special method for installing new chrome in netscape 6 and mozilla. the method performs a simplified installation of language packs or netscape 6/mozilla skins, and saves you the trouble of writing separate installation scripts in the xpi files or using the more sophisticated methods of the install and file objects. ...
startSoftwareUpdate - Web APIs
summary triggers the downloading and installation of the software at the specified url. method of installtrigger object syntax boolean startsoftwareupdate ( string url); parameters the startsoftwareupdate method has the following parameter: url a uniform resource locator specifying the location of the xpi file containing the software. returns true.
description the startsoftwareupdate method triggers a software download and install from the specified url. this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. note also that xpis installed with this method must have their own install.js files in which the full installation is defined. ...
IntersectionObserver.IntersectionObserver() - Web APIs
"0px 0px 0px 0px". threshold either a single number or an array of numbers between 0.0 and 1.0, specifying a ratio of intersection area to total bounding box area for the observed target. a value of 0.0 means that even a single visible pixel counts as the target being visible. 1.0 means that the entire target element is visible. see thresholds in intersection observer api for a more in-depth
description of how thresholds are used. the default is a threshold of 0.0. return value a new intersectionobserver which can be used to watch for the visibility of a target element within the specified root crossing through any of the specified visibility thresholds. call its observe() method to begin watching for the visibility changes on a given target. exceptions syntaxerror the specified root...
InterventionReportBody - Web APIs
user annoyance. so for example, a script was been stopped because it was significantly slowing down the browser, or the browser's autoplay policy blocked audio from playing without a user gesture to trigger it. properties id a string representing the intervention that generated the report. this can be used to group reports by deprecated feature. message a string containing a human-readable
description of the intervention, including information such how the intervention could be avoided. this typically matches the message a browser will display in its devtools console when an intervention is imposed, if one is available. sourcefile a string containing the path to the source file where the intervention occurred, if known, or null otherwise. linenumber a number representing the line in the so...
KeyboardEvent.location - Web APIs
the keyboardevent.location read-only property returns an unsigned long representing the location of the key on the keyboard or other input device. possible values are: constant value
description dom_key_location_standard 0 the key has only one version, or can't be distinguished between the left and right versions of the key, and was not pressed on the numeric keypad or a key that is considered to be part of the keypad. dom_key_location_left 1 the key was the left-hand version of the key; for example, the left-hand control key was pressed on a standard 101 key us keyboard. this value is only used for keys that have more than one possible location on the keyboard. dom_key_location_right 2 the key was the right-hand version of the key; for e...
KeyboardEvent - Web APIs
;} constructor keyboardevent() creates a new keyboardevent object. constants the keyboardevent interface defines the following constants. keyboard locations the following constants identify which part of the keyboard the key event originates from. they are accessed as keyboardevent.dom_key_location_standard and so forth. keyboard location identifiers constant value
description dom_key_location_standard 0x00 the key described by the event is not identified as being located in a particular area of the keyboard; it is not located on the numeric keypad (unless it's the numlock key), and for keys that are duplicated on the left and right sides of the keyboard, the key is, for whatever reason, not to be associated with that location. examples inc...
MSGestureEvent - Web APIs
ievent and event. msgestureevent.initgestureevent() initializes the value of an msgestureevent. if the event has already being dispatched, this method does nothing. this method is deprecated as of microsoft edge. gesture event types msgesturestart msgestureend msgesturetap msgesturehold msgesturechange msinertiastart specifications not part of any specification. microsoft has a
description on msdn. browser compatibility the compatibility table on 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 webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmsgestur...
MSManipulationEvent - Web APIs
on when contact is made to the screen and an element is manipulated. this proprietary method is specific to internet explorer. events msmanipulationstatechanged: event fires when the state of an element being manipulated has changed. methods msmanipulationevent.initmsmanipulationevent(): used to create a manipulation event that can be called from javascript. properties property
description currentstateread only returns the current state of a manipulation event. inertiadestinationxread only represents the predicted horizontal scroll offset after the inertia phase completes. inertiadestinationyread only represents the predicted vertical scroll offset after the inertia phase completes. laststateread only returns the last state af...
MediaError.code - Web APIs
lue which represents the kind of error that occurred on a media element. to get a text string with specific diagnostic information, see mediaerror.message. syntax var myerror = mediaerror.code; value a numeric value indicating the general type of error which occurred. the possible values are described below, in media error code constants. media error code constants name value
description media_err_aborted 1 the fetching of the associated resource was aborted by the user's request. media_err_network 2 some kind of network error occurred which prevented the media from being successfully fetched, despite having previously been available. media_err_decode 3 despite having previously been determined to be usable, an error occurred while...
MediaError.message - Web APIs
ns a human-readable string offering specific diagnostic details related to the error described by the mediaerror object, or an empty string ("") if no diagnostic information can be determined or provided. syntax var errormessage = mediaerror.message; value a domstring providing a detailed, specific explanation of what went wrong and possibly how it might be fixed. this is not simply a generic
description of the mediaerror.code property's value, but instead goes deeper into the specifics of this particular error and its circumstances. if no specific details are available, this string is empty. example this example creates a <audio> element, establishes an error handler for it, then lets the user click buttons to choose whether to assign a valid audio file or a missing file to the element's src a...
MediaError - Web APIs
, such as <audio> or <video>. a mediaerror object describes the error in general terms using a numeric code categorizing the kind of error, and a message, which provides specific diagnostics about what went wrong. properties this interface doesn't inherit any properties. mediaerror.code a number which represents the general type of error that occurred, as follows: name value
description media_err_aborted 1 the fetching of the associated resource was aborted by the user's request. media_err_network 2 some kind of network error occurred which prevented the media from being successfully fetched, despite having previously been available. media_err_decode 3 despite having previously been determined to be usable, an error occurred while...
MediaRecorderErrorEvent.error - Web APIs
hin the mediarecordererrorevent received by the mediarecorder's error event handler, onerror. syntax error = mediarecordererrorevent.error; value a domexception describing the error represented by the event. the error's name property's value may be any exception that makes sense during the handling of media recording, including these specifically identified by the specification. the
descriptions here are generic ones; you'll find more specific ones to various scenarios in which they may occur in the corresponding method references. invalidstateerror an operation was attempted in a context in which it isn't allowed, or a request has been made on an object that's deleted or removed. notsupportederror a mediarecorder couldn't be created because the specified options weren't valid. th...
MediaSession.setActionHandler() - Web APIs
esenting an action type to listen for. it will be one of play, pause, seekbackward, seekforward, seekto, skipad,previoustrack, or nexttrack. further details on the action types can be found below under media session actions. callback a function to call when the specified action type is invoked. the callback receives no input parameters, and should not return a value. return value undefined.
description to remove a previously-established action handler, call setactionhandler() again, specifying null as the callback. the action handler receives as input a single parameter: an object conforming to the mediasessionactiondetails dictionary, which provides both the action type (so the same function can handle multiple action types), as well as data needed in order to perform the action. media sess...
Media Session action types - Web APIs
value of true. this lets the browser know it can take steps to optimize repeated operations, and is likely to result in improved performance. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback entirely.
description a media session action may be generated by any media session action source; these sources include anything from ui widgets within the browser itself to media control keys on the user's keyboard to buttons on the user's headset or earbuds. examples adding action handlers this example implements seek forward and backward actions for an audio player by setting up the seekforward and seekbackward...
MediaSessionActionDetails - Web APIs
value of true. this lets the browser know it can take steps to optimize repeated operations, and is likely to result in improved performance. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback entirely.
description a media session action may be generated by any media session action source; these sources include anything from ui widgets within the browser itself to media control keys on the user's keyboard to buttons on the user's headset or earbuds. examples adding action handlers this example implements seek forward and backward actions for an audio player by setting up the seekforward and seekbackward...
MediaStreamTrack.stop() - Web APIs
since multiple tracks may use the same source (for example, if two tabs are using the device's microphone), the source itself isn't necessarily immediately stopped. it is instead disassociated from the track and the track object is stopped. once no media tracks are using the source, the source may actually be completely stopped. immediately after calling stop(), the readystate property is set to ended. ...
Transcoding assets for Media Source Extensions - Web APIs
files are comprised of a container and codec that users' browsers support. depending on the codec, you might need to fragment the file to comply with the iso bmff spec. (optional) if you decide to use dynamic adaptive streaming over http (dash) for adaptive bitrate streaming, you need to transcode your assets into multiple resolutions. most dash clients expect a corresponding media presentation
description (mpd) manifest file, which is typically generated while generating the multiple resolution asset files. below we'll cover all of these steps, but first let's look at a toolchain we can use to do this fairly easily. sample media if you're looking to follow the steps listed here, but don't have any media to experiment with, you can grab the trailer to big buck bunny [0] here. big buck bunny is ...
Microdata DOM API - Web APIs
18 months"> </section> ...it would result in the following output: name http://example.com/fn desc http://example.com/color img (the duplicate occurrence of "http://example.com/color" is not included in the list.) htmlpropertiescollection the htmlpropertiescollection interface is used for collections of elements that add name-value pairs to a particular item in the microdata model. interface
description language interface htmlpropertiescollection : htmlcollection { // inherits length and item() getter propertynodelist? nameditem(domstring name); // shadows inherited nameditem() readonly attribute domstring[] names; }; typedef sequence<any> propertyvaluearray; interface propertynodelist : nodelist { propertyvaluearray getvalues(); }; collection . length returns the number of elemen...
MouseWheelEvent - Web APIs
the mousewheelevent interface represents events that occur due to the user turning a mouse wheel. do not use this interface for wheel events. like mousescrollevent, this interface is non-standard and deprecated. it was used in non-gecko browsers only. instead use the standard wheelevent. properties attribute type
description wheeldelta read only long the distance in pixels (defined as so by msdn, but the actual usage is different, see mousewheel). wheeldeltax read only long? the value along horizontal axis of wheeldelta. wheeldeltay read only long? the value along vertical axis of wheeldelta. ...
MutationRecord - Web APIs
mutationrecord.target node returns the node the mutation affected, depending on the mutationrecord.type. for attributes, it is the element whose attribute changed. for characterdata, it is the characterdata node. ...
Navigator.sendBeacon() - Web APIs
rver. syntax navigator.sendbeacon(url, data); parameters url the url that will receive the data. can be relative or absolute. data a arraybuffer, arraybufferview, blob, domstring, formdata, or urlsearchparams object containing the data to send. return values the sendbeacon() method returns true if the user agent successfully queued the data for transfer. otherwise, it returns false.
description this method is for analytics and diagnostics that send data to a server before the document is unloaded, where sending the data any sooner may miss some possible data collection. for example, which link the user clicked before navigating away and unloading the page. ensuring that data has been sent during the unloading of a document has traditionally been difficult, because user agents typicall...
NavigatorPlugins.mimeTypes - Web APIs
r. note: named properties of mimetypearray objects are no longer enumerable in the latest browser versions. syntax var mimetypes[] = navigator.mimetypes; mimetypes is a mimetypearray object which has a length property as well as item(index) and nameditem(name) methods. example function isjavapresent() { return 'application/x-java-applet' in navigator.mimetypes; } function getjavaplugin
description() { var mimetype = navigator.mimetypes['application/x-java-applet']; if (mimetype === undefined) { // no java plugin present return undefined; } return mimetype.enabledplugin.
description; } specifications specification status comment html living standardthe definition of 'navigatorplugins.mimetypes' in that specification. living standard initia...
Node.textContent - Web APIs
the textcontent property of the node interface represents the text content of the node and its descendants. note: textcontent and htmlelement.innertext are easily confused, but the two properties are different in important ways. syntax let text = somenode.textcontent someothernode.textcontent = string value a string or null
description the value of textcontent depends on the situation: if the node is a document or a doctype, textcontent returns null. note: to get all of the text and cdata data for the whole document, one could use document.documentelement.textcontent. if the node is a cdata section, comment, processing instruction, or text node, textcontent returns the text inside the node, i.e., the node.nodevalue. for other node types, textcontent returns the concatenation of t...
Node - Web APIs
if callback is omitted, the function returns an array instead, which contains rootnode and all nodes contained within. if callback is provided, and it returns boolean false when called, the current recursion level is aborted, and the function resumes execution at the last parent's level. this can be ...
NodeFilter.acceptNode() - Web APIs
the nodefilter.acceptnode() method returns an unsigned short that will be used to tell if a given node must be accepted or not by the nodeiterator or treewalker iteration algorithm. this method is expected to be written by the user of a nodefilter. possible return values are: constant
description nodefilter.filter_accept value returned by the nodefilter.acceptnode() method when a node should be accepted. nodefilter.filter_reject value to be returned by the nodefilter.acceptnode() method when a node should be rejected. the children of rejected nodes are not visited by the nodeiterator or treewalker object; this value is treated as "skip this node and all its children". nodefilter.filter_skip value to be returned by nodefilter.acceptnode() for nodes to ...
NodeFilter - Web APIs
ther implements nor inherits any properties. methods this interface doesn't inherit any methods. nodefilter.acceptnode() returns an unsigned short that will be used to tell if a given node must be accepted or not by the nodeiterator or treewalker iteration algorithm. this method is expected to be written by the user of a nodefilter. possible return values are: constant
description filter_accept value returned by the nodefilter.acceptnode() method when a node should be accepted. filter_reject value to be returned by the nodefilter.acceptnode() method when a node should be rejected. for treewalker, child nodes are also rejected. for nodeiterator, this flag is synonymous with filter_skip. filter_skip va...
NodeIterator.whatToShow - Web APIs
the nodeiterator.whattoshow read-only property represents an unsigned integer representing a bitmask signifying what types of nodes should be returned by the nodeiterator. syntax var nodetypes = nodeiterator.whattoshow; the values that can be combined to form the bitmask are: constant numerical value
description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a nodeiterator or treewalker with an attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the d...
NodeIterator - Web APIs
returns a node representing the root node as specified when the nodeiterator was created. nodeiterator.whattoshow read only returns an unsigned long being a bitmask made of constants describing the types of node that must to be presented. non-matching nodes are skipped, but their children may be included, if relevant. the possible values are: constant numerical value
description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a nodeiterator with an attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes a...
Path2D() - Web APIs
h2d object, optionally with another path as an argument (creates a copy), or optionally with a string consisting of svg path data. syntax new path2d(); new path2d(path); new path2d(d); parameters path optional when invoked with another path2d object, a copy of the path argument is created. d optional when invoked with a string consisting of svg path data, a new path is created from that
description. examples creating and copying paths this example creates and copies a path2d path. <canvas id="canvas"></canvas> const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let path1 = new path2d(); path1.rect(10, 10, 100,100); let path2 = new path2d(path1); path2.moveto(220, 60); path2.arc(170, 60, 50, 0, 2 * math.pi); ctx.stroke(path2); using svg pa...
PaymentItem - Web APIs
the paymentitem dictionary is used by the payment request api to describe a single line item on a payment request. this might be an item or service being purchased or a tax or other charge. properties amount secure context a paymentcurrencyamount object describing the monetary value of the item. label secure context a string specifying a human-readable name or
description of the item or service being charged for. this may be displayed to the user by the user agent, depending on the design of the interface. pending secure context a boolean value which is true if the specified amount has not yet been finalized. this can be used to show items such as shipping or tax amounts that depend upon the selection of shipping address, shipping option, or so forth. the user agent may show this informat...
PaymentResponse.retry() - Web APIs
) method makes it possible to ask the user to retry a payment after an error occurs during processing. this lets your app gracefully deal with situations such as invalid shipping addresses or declined credit cards. syntax retrypromise = paymentrequest.retry(errorfields); parameters errorfields a paymentvalidationerrors object, with the following properties: error optional a general
description of a payment error from which the user may attempt to recover by retrying the payment, possibly after correcting mistakes in the payment information. error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to errors in specific fields in the payment form. payer option...
PaymentValidationErrors - Web APIs
all errors that occurred while processing a payment request. when validation of the paymentresponse returned by the paymentrequest.show() or paymentresponse.retry() methods fails, your code creates a paymentvalidationerrors object to pass into retry() so that the user agent knows what needs to be fixed and what if any error messages to display to the user. properties error optional a general
description of a payment error from which the user may attempt to recover by retrying the payment, possibly after correcting mistakes in the payment information. error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to errors in specific fields in the payment form. payer option...
PerformanceEntry.entryType - Web APIs
as, for example, "mark". this property is read only. note: this feature is available in web workers. syntax var type = entry.entrytype; return value the return value depends on the subtype of the performanceentry object and affects the value of the performanceentry.name property as shown by the table below. performance entry type names value subtype type of name property
description of name property frame, navigation performanceframetiming, performancenavigationtiming url the document's address. resource performanceresourcetiming url the resolved url of the requested resource. this value doesn't change even if the request is redirected. mark performancemark domstring the name used when the mark was created by calling ...
PerformanceEntry.name - Web APIs
urther specifies the value returned by the performanceentry.entrytype property. this property is read only. note: this feature is available in web workers. syntax var name = entry.name; return value the return value depends on the subtype of the performanceentry object and the value of performanceentry.entrytype, as shown by the table below. value subtype entrytype values
description url performanceframetiming, performancenavigationtiming frame, navigation the document's address. url performanceresourcetiming resource the resolved url of the requested resource. this value doesn't change even if the request is redirected. domstring performancemark mark the name used when the mark was created by calling performance.mark(...
Plugin - Web APIs
plugin.filename read only the filename of the plugin file. plugin.name read only the name of the plugin. plugin.version read only the plugin's version number string. methods plugin.item returns the mime type of a supported content type, given the index number into a list of supported types. plugin.nameditem returns the mime type of a supported item. ...
Pointer Lock API - Web APIs
r lock is different from mouse capture in the following ways: it is persistent: pointer lock does not release the mouse until an explicit api call is made or the user uses a specific release gesture. it is not limited by browser or screen boundaries. it continues to send events regardless of mouse button state. it hides the cursor. method/properties overview this section provides a brief
description of each property and method related to the pointer lock specification. requestpointerlock() the pointer lock api, similar to the fullscreen api, extends dom elements by adding a new method, requestpointerlock(). as it has recently unprefixed, you would currently declare it something like this, for example if you wanted to request pointer lock on a canvas element: canvas.requestpointerlock = ca...
PublicKeyCredentialCreationOptions.extensions - Web APIs
of march 2019) list of potential extensions which may be used during the registration operation. warning! as of june 2020, only appid (used during creation with publickeycredentialrequestoptions.extensions) 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 authnsel array of buffersource authenticator selection. restricts the list of authenticator models which may be used. if no matching authenticator is available, the credential is still generated with another available authenticator. exts boolean supported extensions. if true, the client outputs an array of strings containing the extensions which are supported by ...
PublicKeyCredentialRequestOptions.extensions - Web APIs
value an object with various keys 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 m...
RTCConfiguration.bundlePolicy - Web APIs
ible, only one media track is negotiated and the rest are ignored. this maximizes bundling at the risk of losing tracks if the remote peer can't do bundling. if any other value is specified, no configuration is specified when creating the rtcpeerconnection, or if the bundlepolicy property isn't included in the rtcconfiguration object specified when creating the connection, balanced is assumed.
description the bundlepolicy configuration option for an rtcpeerconnection specifies how the ice agent should handle negotiation if the remote peer isn't compatible with the sdp bundle standard. if the remote peer is bundle compatible, the policy is moot and all media tracks and the data channel are bundled onto a single rtcdtlstransport at the completion of the negotiation process. any other transports tha...
RTCConfiguration.certificates - Web APIs
.certificates; value an array of rtccertificate objects, each specifying one security certificate available for use when connecting to a remote peer. if this property isn't specified, the browser will automatically generate and use a certificate to secure the connection. see using certificates below for more information on why you might want to—or not to—explicitly provide certificates.
description if this property isn't included in the configuration, a set of certificates is automatically generated for each instance of rtcpeerconnection. although a given dtls connection only uses a single certificate, providing multiple options in the certificates list may improve the odds of establishing a connection by increasing the chances a mutually-compatible encryption algorithm and key size may be...
RTCConfiguration.iceServers - Web APIs
describes one stun or turn server for the ice agent to use during the connection's negotiation. each object must at least have an urls property, which is an array of one or more strings, each providing one server's url. if the array is empty, or if the iceservers option isn't specified, the ice agent will negotiate without the use of any servers, which will limit the connection to local peers.
description how the list of servers you provide is used is up to the implementation of the user agent. while it can be useful to provide a second server as a fallback in case the first is offline, listing too many servers can delay the user's connection being established, depending on the network's performance and how many servers get used for negotiation before a connection is established. if the list of ...
RTCDataChannel.readyState - Web APIs
rlying data connection. syntax var state = adatachannel.readystate; values a string which is one of the values in the rtcdatachannelstate enum, indicating the current state of the underlying data transport. rtcdatachannelstate enum the rtcdatachannelstate enum defines string constants which reflect the current status of the rtcdatachannel's underlying data connection. constant
description "connecting" the user agent (browser) is in the process of creating the underlying data transport; that is, whatever network level connection is used to link the two peers together is in the process of being set up. this is the state of a new rtcdatachannel after being created by rtcpeerconnection.createdatachannel() (on the peer which started the connection process). "op...
RTCDtlsTransport - Web APIs
fill: #0095dd; pointer-events: all;} propertiesicetransport read only the read-only rtcdtlstransport property icetransport contains a reference to the underlying rtcicetransport.state read only the state read-only property of the rtcdtlstransport interface provides information which describes a datagram transport layer security (dtls) transport state.methodsthis interface has no methods.
description allocation of dtls transports rtcdtlstransport objects are created when an app calls either setlocal
description() or setremote
description(). the number of dtls transports created and how they're used depends on the bundling mode used when creating the rtcpeerconnection. whether bundling is used depends on what the other endpoint is able to negotiate. all browsers support bundling, so when both...
RTCErrorEvent - Web APIs
nterface, rtcerrorevent also includes the following: error read only an rtcerror object specifying the error which occurred; this object includes the type of error that occurred, information about where the error occurred (such as which line number in the sdp or what sctp cause code was at issue). methods no additional methods are provided beyond any found on the parent interface, event.
description there are other data types used for error events in webrtc, as needed for errors with special information sharing requirements. the most common of these is probably rtcpeerconnectioniceerrorevent, used by the icecandidateerror event, which signals an error that has occurred while gathering ice candidates during connection negotiation. specifications specification status comment ...
RTCIceCandidate.sdpMLineIndex - Web APIs
value in the rtcicecandidateinit object when creating a new candidate with new rtcicecandidate(). if you instead call rtcicecandidate() with a string parameter containing the candidate m-line text, the value of sdpmlineindex is extracted from the m-line. syntax var sdpmlineindex = rtcicecandidate.sdpmlineindex; value a number containing a 0-based index into the set of m-lines providing media
descriptions, indicating which media source is associated with the candidate, or null if no such association is available. note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception. example ... specifications specification status comment webrtc 1.0: real-time communication between b...
RTCIceCandidate - Web APIs
ived. for host candidates, the relatedport property is null. sdpmid read only a domstring specifying the candidate's media stream identification tag which uniquely identifies the media stream within the component with which the candidate is associated, or null if no such association exists. sdpmlineindex read only if not null, sdpmlineindex indicates the zero-based index number of the media
description (as defined in rfc 4566) in the sdp with which the candidate is associated. tcptype read only if protocol is "tcp", tcptype represents the type of tcp candidate. otherwise, tcptype is null. type read only a domstring indicating the type of candidate as one of the strings from the rtcicecandidatetype enumerated type. usernamefragment read only a domstring containing a randomly-generated u...
RTCIceCandidateInit - Web APIs
t there are no further candidates (rather than representing a new candidate), this is the empty string (""). the default is the empty string. sdpmid optional the identification tag of the media stream with which the candidate is associated, or null if there is no associated media stream. the default is null. sdpmlineindex optional the zero-based index of the m-line within the sdp of the media
description with which the candidate is associated, or null if no such associated exists. the default is null. usernamefragment optional a domstring containing a string which uniquely identifies the remote peer. this string is generated by webrtc at the beginning of the session, and at least 24 bits worth of the string contain random data. the string may be up to 256 characters long. this property has no d...
RTCIceCandidatePair - Web APIs
it is used as the return value from rtcicetransport.getselectedcandidatepair() to identify the currently-selected candidate pair identified by the ice agent. properties local an rtcicecandidate describing the configuration of the local end of the connection. remote the rtcicecandidate describing the configuration of the remote end of the connection. example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair. ...
RTCPeerConnection() - Web APIs
t integer value which specifies the size of the prefetched ice candidate pool. the default value is 0 (meaning no candidate prefetching will occur). you may find in some cases that connections can be established more quickly by allowing the ice agent to start fetching ice candidates before you start trying to connect, so that they're already available for inspection when rtcpeerconnection.setlocal
description() is called. changing the size of the ice candidate pool may trigger the beginning of ice gathering. iceservers optional an array of rtciceserver objects, each describing one server which may be used by the ice agent; these are typically stun and/or turn servers. if this isn't specified, the connection attempt will be made with no stun or turn server available, which limits the connection to...
RTCPeerConnection.connectionState - Web APIs
onstate. rtcpeerconnectionstate enum the rtcpeerconnectionstate enum defines string constants which describe states in which the rtcpeerconnection may be. these values are returned by the connectionstate property. this state essentially represents the aggregate state of all ice transports (which are of type rtcicetransport or rtcdtlstransport) being used by the connection. constant
description "new" at least one of the connection's ice transports (rtcicetransports or rtcdtlstransports) are in the "new" state, and none of them are in one of the following states: "connecting", "checking", "failed", or "disconnected", or all of the connection's transports are in the "closed" state. "connecting" one or more of the ice transports are currently in the process of e...
RTCPeerConnection.iceConnectionState - Web APIs
eerconnection.iceconnectionstate; value the current state of the ice agent and its connection. the value is one of the strings in the rtciceconnectionstate enum. rtciceconnectionstate enum the rtciceconnectionstate enum defines the string constants used to describe the current state of the ice agent and its connection to the ice server (that is, the stun or turn server). constant
description "new" the ice agent is gathering addresses or is waiting to be given remote candidates through calls to rtcpeerconnection.addicecandidate() (or both). "checking" the ice agent has been given one or more remote candidates and is checking pairs of local and remote candidates against one another to try to find a compatible match, but has not yet found a pair which will al...
RTCPeerConnection.iceGatheringState - Web APIs
value the possible values are those of an enum of type rtcicegatheringstate. rtcicegatheringstate enum the rtcicegatheringstate enum defines string constants which reflect the current status of ice gathering, as returned using the rtcpeerconnection.icegatheringstate property. you can detect when this value changes by watching for an event of type icegatheringstatechange. constant
description "new" the peer connection was just created and hasn't done any networking yet. "gathering" the ice agent is in the process of gathering candidates for the connection. "complete" the ice agent has finished gathering candidates. if something happens that requires collecting new candidates, such as a new interface being added or the addition of a new ice serve...
RTCPeerConnection: icecandidate event - Web APIs
an icecandidate event is sent to an rtcpeerconnection when an rtcicecandidate has been identified and added to the local peer by a call to rtcpeerconnection.setlocal
description(). the event handler should transmit the candidate to the remote peer over the signaling channel so the remote peer can add it to its set of remote candidates. bubbles no cancelable no interface rtcpeerconnectioniceevent event handler property rtcpeerconnection.onicecandidate
description there are three reasons why the icecandidate event is fired on an rtcpeerconnection. sharing a new candidate the majority of icecandidate events are fired to indicate that a new candidate has been gathered. this candidate needs to be delivered to the remote peer over the signaling ch...
RTCPeerConnection: icecandidateerror event - Web APIs
if an error occurs while performing ice negotiations through a stun or turn server. the event object is of type rtcpeerconnectioniceerrorevent, and contains information describing the error in some amount of detail. bubbles no cancelable no interface rtcpeerconnectioniceerrorevent event handler property rtcpeerconnection.onicecandidateerror
description the error object's errorcode property is one of the numeric stun error codes. there is one additional, webrtc-specific, error which lies outside the valid stun error code range: 701. error 701 indicates that none of the ice candidates were able to successfully make contact with the stun or turn server. the 701 error is fired only once per server url from the list of available stun or turn serve...
RTCPeerConnection.onnegotiationneeded - Web APIs
amining the properties of the rtcpeerconnection. example this example, derived from the example in signaling and video calling, establishes a handler for negotiationneeded events to handle creating an offer, configuring the local end of the connection, and sending the offer to the remote peer. pc.onnegotiationneeded = function() { pc.createoffer().then(function(offer) { return pc.setlocal
description(offer); }) .then(function() { // send the offer to the remote peer through the signaling server }); }) .catch(reporterror); } first, it creates the offer by calling createoffer(). when that succeeds, the offer is passed into setlocal
description() to set the local
description for the connection. once that's succeeded in turn, the offer can be sent to the signaling server for del...
RTCPeerConnection.peerIdentity - Web APIs
if an error occcurs while attempting to validate an incoming identity assertion (that is, the information describing a peer's identity), the promise is rejected. if there isn't already a target peer identity, peeridentity is set to a newly created promise and the process begins again, until the process succeeds or no further attempts to authenticate occur. note: the promise returned by setremote
description() cannot resolve until any target peer identity that's been set is validated. if the identity hasn't been validated yet, the promise returned by setremote
description() will be rejected. if there's no target peer identity, setremote
description() doesn't need to wait for validation to occur before it resolves. example in this example, a function, getidentityassertion(), is created which asynchro...
RTCPeerConnection.restartIce() - Web APIs
lowing the same method to be used by either the caller or the receiver to trigger an ice restart. after restartice() returns, the offer returned by the next call to createoffer() is automatically configured to trigger ice restart on both the local peer (once the local peer has been set) and on the remote peer, once the offer is sent across your signaling mechanism and the remote peer has set its
description as well. restartice() causes the negotiationneeded event to be fired on the rtcpeerconnection to inform the application that it should perform negotiation using its signaling channel. if negotiation fails to complete—either due to rollback or because incoming offers are in the process of being negotiated—the rtcpeerconnection will remember that you requested ice restart. the next time the c...
RTCRtcpParameters - Web APIs
this property cannot be changed once initialized. reducedsize a boolean value indicating whether or not reduced size rtcp is configured. ...
RTCRtpCapabilities - Web APIs
s, each describing one of the codecs supported by the rtcrtpsender or rtcrtpreceiver. there are some special entries in this array, described below in the section the codecs array. headerextensions an array of objects conforming to the rtcrtpheaderextensioncapability dictionary. each object contains a single domstring, uri, specifying the uri of the header extension, as described in rfc 5285.
description the codecs array the codecs array is an array of objects conforming to the dictionary rtcrtpcodeccapability. each of these objects describes a single codec and its basic capabilities. its properties are: the browser will only report distinct capability combinations separately. if two sets of capabilities can be described as one, they will be. that means that, for instance, if there are two e...
RTCRtpCodecCapability - Web APIs
tes. mimetype a domstring indicating the codec's mime media type and subtype. see codecs used by webrtc for details about potential codecs that might be referenced here. sdpfmtpline optional a domstring giving the format specific parameters field from the a=fmtp line in the sdp which corresponds to the codec, if such a line exists. if there is no parameters field, this property is left out.
description rtcrtpcodeccapabilities describes the basic parameters for a single codec supported by the user's device. an array of objects of this type is returned in the codecs property of the rtcrtpcapabilities object returned in response to a call to either of the static functions rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities(). examples tbd specifications specification ...
RTCRtpReceiver.getCapabilities() static function - Web APIs
dicating the type of media for which you wish to get the device's capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrtpcapabilities object stating what capabilities the browser has for receiving the specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is null.
description as a static function, this is always called using the form: capabilities = rtcrtpreceiver.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list. it is entirely possible that certain combinations of options may fail to work when you actually try to use them. calling rtcrtpreceiver.getcapabilities() doesn't prime the browser in any way to handle media. ...
RTCRtpReceiver.transport - Web APIs
real-time transport control protocol (rtcp) packets. this transport is responsible for receiving the data for the media on the receiver's track. syntax let transport = rtcrtpreceiver.transport; value an rtcdtlstransport object representing the underlying transport being used by the receiver to exchange packets with the remote peer, or null if the receiver isn't yet connected to a transport.
description when the rtcrtpreceiver is first created, the value of transport is null. this is replaced with an rtcdtlstransport once the receiver's transport has been established. note that when bundling is in effect—that is, when the rtcpeerconnection was created with an rtcconfiguration object whose bundlepolicy is max-compat or max-bundle—multiple receivers may be sharing the same transport; in this...
RTCRtpSender.getCapabilities() static function - Web APIs
indicating the type of media for which you wish to get the sender's capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrtpcapabilities object stating what capabilities the browser has for sending the specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is null.
description as a static function, this is always called using the form: capabilities = rtcrtpsender.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list. it is entirely possible that certain combinations of options may fail to work when you actually try to use them. calling rtcrtpsender.getcapabilities() doesn't prime the browser in any way to handle media. noth...
RTCRtpSender.setStreams() - Web APIs
streams([mediastream...]); parameters mediastream or [mediastream...] optional an mediastream object—or an array of multiple mediastream objects—identifying the streams to which the rtcrtpsender's track belongs. if this parameter isn't specified, no new streams will be associated with the track. return value none. exceptions invalidstateerror the sender's connection is closed.
description setstreams() is purely additive. it doesn't remove the track from any streams; it simply adds it to new ones. if you specify streams to which the track already belongs, that stream is unaffected. once the track has been added to all of the streams, renegotiation of the connection will be triggered by the negotiationneeded event being dispatched to the rtcpeerconnection to which the sender belon...
RTCRtpSender.transport - Web APIs
hanging real-time transport control protocol (rtcp) packets. this transport is responsible for receiving the data for the media on the sender's track. syntax let transport = rtcrtpsender.transport; value an rtcdtlstransport object representing the underlying transport being used by the sender to exchange packets with the remote peer, or null if the sender isn't yet connected to a transport.
description when the rtcrtpsender is first created, the value of transport is null. this is replaced with an rtcdtlstransport once the sender's transport has been established. note that when bundling is in effect—that is, when the rtcpeerconnection was created with an rtcconfiguration object whose bundlepolicy is max-compat or max-bundle—multiple senders may be sharing the same transport; in this case,...
RTCRtpTransceiver.stopped - Web APIs
the read-only stopped property on the rtcrtptransceiver interface indicates whether or not the transceiver's associated sender and receiver have both been stopped. the transceiver is stopped if the stop() method has been called or if a change to either the local or the remote
description has caused the transceiver to be stopped for some reason. syntax var isstopped = rtcrtptransceiver.stopped; value a boolean value which is true if the transceiver's sender will no longer send data, and its receiver will no longer receive data. if either or both are still at work, the result is false. usage notes this property is deprecated and will be removed in the future. instead, look at the value of currentdirection. its value is stopped if the transceiver has stopped. note: currently only firefox imp...
RTCRtpTransceiver - Web APIs
t directionality, or null if the transceiver is stopped or has never participated in an exchange of offers and answers. direction a string from the enum rtcrtptransceiverdirection which is used to set the transceiver's desired direction. mid read only the media id of the m-line associated with this transceiver. this association is established, when possible, whenever either a local or remote
description is applied. this field is null if neither a local or remote
description has been applied, or if its associated m-line is rejected by either a remote offer or any answer. receiver read only the rtcrtpreceiver object that handles receiving and decoding incoming media. sender read only the rtcrtpsender object responsible for encoding and sending data to the remote peer. stopped indicates whe...
Request() - Web APIs
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. example in our fetch request example (see fetch request live) we create a new request object using the constructor, then fetch it using a globalfetch.fetch call. since we are fetching an image, we run body.blob on the response to give it the pr...
SVGAnimatedAngle - Web APIs
animated angle interface the svganimatedangle interface is used for attributes of basic type <angle> which can be animated. interface overview also implement none methods none properties readonly svgangle baseval readonly svgangle animval normative document svg 1.1 (2nd edition) properties name type
description baseval svgangle the base value of the given attribute before applying any animations. animval svgangle a read only svgangle representing the current animated value of the given attribute. if the given attribute is not currently being animated, then the svgangle will have the same contents as baseval. the object referenced by animval will always be distinct from ...
SVGAnimatedBoolean - Web APIs
svg animated boolean interface the svganimatedboolean interface is used for attributes of type boolean which can be animated. interface overview also implement none methods none properties readonly boolean baseval readonly boolean animval normative document svg 1.1 (2nd edition) properties name type
description baseval boolean the base value of the given attribute before applying any animations. animval boolean if the given attribute or property is being animated, contains the current animated value of the attribute or property. if the given attribute or property is not currently being animated, contains the same value as baseval. methods the svganimatedboolean ...
SVGAnimatedEnumeration - Web APIs
interface is used for attributes whose value must be a constant from a particular enumeration and which can be animated. interface overview also implement none methods none properties unsigned short baseval readonly unsigned short animval normative document svg 1.1 (2nd edition) properties name type
description baseval unsigned short the base value of the given attribute before applying any animations. animval unsigned short if the given attribute or property is being animated, contains the current animated value of the attribute or property. if the given attribute or property is not currently being animated, contains the same value as baseval. methods the svgan...
SVGAnimatedInteger - Web APIs
g animated integer interface the svganimatedinteger interface is used for attributes of basic type <integer> which can be animated. interface overview also implement none methods none properties readonly long baseval readonly long animval normative document svg 1.1 (2nd edition) properties name type
description baseval long the base value of the given attribute before applying any animations. animval long if the given attribute or property is being animated, contains the current animated value of the attribute or property. if the given attribute or property is not currently being animated, contains the same value as baseval. methods the svganimatedinteger interf...
SVGAnimatedLength - Web APIs
ted length interface the svganimatedlength interface is used for attributes of basic type <length> which can be animated. interface overview also implement none methods none properties readonly svglength baseval readonly svglength animval normative document svg 1.1 (2nd edition) properties name type
description baseval svglength the base value of the given attribute before applying any animations. animval svglength if the given attribute or property is being animated, contains the current animated value of the attribute or property. if the given attribute or property is not currently being animated, contains the same value as baseval. methods the svganimatedleng...
SVGAnimatedLengthList - Web APIs
interface the svganimatedlengthlist interface is used for attributes of type svglengthlist which can be animated. interface overview also implement none methods none properties readonly svglengthlist baseval readonly svglengthlist animval normative document svg 1.1 (2nd edition) properties name type
description baseval svglengthlist the base value of the given attribute before applying any animations. animval svglengthlist a read only svglengthlist representing the current animated value of the given attribute. if the given attribute is not currently being animated, then the svglengthlist will have the same contents as baseval. the object referenced by animval will alwa...
SVGAnimatedNumber - Web APIs
svg animated number interface the svganimatednumber interface is used for attributes of basic type <number> which can be animated. interface overview also implement none methods none properties float baseval readonly float animval normative document svg 1.1 (2nd edition) properties name type
description baseval float the base value of the given attribute before applying any animations. animval float if the given attribute or property is being animated, contains the current animated value of the attribute or property. if the given attribute or property is not currently being animated, contains the same value as baseval. methods the svganimatednumber interface do...
SVGAnimatedPathData - Web APIs
dpathseglist svgpathseglist normalizedpathseglist svgpathseglist pathseglist normative document svg 1.1 (2nd edition) properties this interface also inherits properties from its parent, svgpathelement. ...
SVGAnimatedPoints - Web APIs
using the getattribute() method call) will reflect any changes made to the svganimatedpoints.points attribut. interface overview also implement none methods none properties readonly svgpointlist points readonly svgpointlist animatedpoints normative document svg 1.1 (2nd edition) properties name type
description points svgpointlist provides access to the base (i.e., static) contents of the points attribute. animatedpoints svgpointlist provides access to the current animated contents of the points attribute. if the given attribute or property is being animated, contains the current animated value of the attribute or property. if the given attribute or property is not curr...
SVGAnimatedRect - Web APIs
the svganimatedrect interface is used for attributes of basic svgrect which can be animated. interface overview also implement none methods none properties readonly svgrect baseval readonly svgrect animval normative document svg 1.1 (2nd edition) properties name type
description baseval svgrect the base value of the given attribute before applying any animations. animval svgrect a read only svgrect representing the current animated value of the given attribute. if the given attribute is not currently being animated, then the svgrect will have the same contents as baseval. the object referenced by animval will always be distinct from the one referenced by baseval, even w...
SVGAnimatedTransformList - Web APIs
imatedtransformlist interface is used for attributes which take a list of numbers and which can be animated. interface overview also implement none methods none properties readonly svgtransformlist baseval readonly svgtransformlist animval normative document svg 1.1 (2nd edition) properties name type
description baseval svgtransformlist the base value of the given attribute before applying any animations. animval svgtransformlist a read only svgtransformlist representing the current animated value of the given attribute. if the given attribute is not currently being animated, then the svgtransformlist will have the same contents as baseval. the object referenced by animv...
SVGComponentTransferFunctionElement - Web APIs
it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_fecomponenttransfer_type_identity 1 corresponds to the value identity. svg_fecomponenttransfer_type_table 2 corresponds to the value table. svg_f...
SVGDocument - Web APIs
referrer domstring returns the uri of the page that linked to this page. the value is an empty string if the user navigated to the page di...
SVGZoomAndPan - Web APIs
it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_zoomandpan_disable 1 corresponds to the value disable. svg_zoomandpan_magnify 2 corresponds to the value magnify. properties svgzoomandpan.zoomandpan an unsi...
Selection.toString() - Web APIs
in javascript, this method is called automatically when a function the selection object is passed to requires a string: alert(window.getselection()) // what is called alert(window.getselection().tostring()) // what is actually being effectively called. ...
SourceBuffer.abort() - Web APIs
fer interface aborts the current segment and resets the segment parser. syntax sourcebuffer.abort(); parameters none. return value undefined. exceptions exception explanation invalidstateerror the mediasource.readystate property of the parent media source is not equal to open, or this sourcebuffer has been removed from the mediasource. example the spec
description of abort() is somewhat confusing — consider for example step 1 of reset parser state. the mse api is fully asynchronous, but this step seems to suggest a synchronous (blocking) operation, which doesn't make sense. saying that, current implementations can be useful in certain situations, when you want to stop the current append (or whatever) operation occuring on a sourcebuffer, and then immedi...
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 removed from the storage. read only. oldvalue domstring the original valu...
Storage Access API - Web APIs
in safari the storage access grants are phased out after 30 days of browser usage passed without user interaction. this is currently a limitation of the firefox implementation, which we may address in a future version. in safari, successful use of the storage access api resets this counter. documentation for firefox's new storage access policy for blocking tracking cookies includes a detailed
description of the scope of storage access grants. storage access api methods the storage api methods are implemented on the document interface: document.hasstorageaccess() returns a promise that resolves with a boolean value indicating whether the document has access to its first-party storage. document.requeststorageaccess() returns a promise that resolves if the access to first-party storage was g...
TextTrack.mode - Web APIs
, you'll have to change the mode to either hidden or showing in order to trigger loading of the cues. when the mode is showing, text tracks are performed. the exact appearance and manner of that performance varies depending on each text track's kind. in general: tracks whose kind is "subtitles" or "captions" are rendered with the cues overlaid over the top of the video. tracks whose kind is "
descriptions" are presented in a non-visual form (for example, the text might be spoken to describe the action in the video). tracks whose kind is "chapters" are used by the user agent or the web site or web app to construct and present an interface for navigating the named chapters, where each cue in the list represents a chapter in the media. the user can then navigate to the desired chapter, which begins...
TreeWalker - Web APIs
read only returns a node representing the root node as specified when the treewalker was created. treewalker.whattoshow read only returns an unsigned long being a bitmask made of constants describing the types of node that must be presented. non-matching nodes are skipped, but their children may be included, if relevant. the possible values are: constant numerical value
description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a treewalker with an attr node as its root. in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are...
UIEvent.cancelBubble - Web APIs
t from bubbling up the dom. not all events are allowed to bubble up the dom. use event.stoppropagation() instead of this non-standard method. syntax event.cancelbubble = bool; var bool = event.cancelbubble; specifications this property is not part of any specification. although the similar event.cancelbubble property was included in an old working draft of w3c dom level 2. microsoft has a
description of it on msdn. ...
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
a type of each component in the array. must be one of: gl.byte, gl.unsigned_byte, gl.short, gl.unsigned_short, gl.int, or gl.unsigned_int. stride a glsizei specifying the offset in bytes between the beginning of consecutive vertex attributes. offset a glintptr specifying an offset in bytes of the first component in the vertex attribute array. must be a multiple of type. return value none.
description very similar to webglrenderingcontext.vertexattribpointer(). the main difference is that while values specified by vertexattribpointer are always interpreted as floating-point values in the shader (even if they were originally specified as integers in the buffer), this method allows specifying values which are interpreted as integers in the shader. examples linear blend skinning //describe t...
WebGLBuffer - Web APIs
the webglbuffer interface is part of the webgl api and represents an opaque buffer object storing data such as vertices or colors.
description the webglbuffer object does not define any methods or properties of its own and its content is not directly accessible. when working with webglbuffer objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindbuffer() webglrenderingcontext.createbuffer() webglrenderingcontext.deletebuffer() webglrenderingcontext.isbuffer() examples creating a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); specifications specification status comment webgl 1.0the definition of 'webglbuffer' in that specification. recommend...
WebGLFramebuffer - Web APIs
the webglframebuffer interface is part of the webgl api and represents a collection of buffers that serve as a rendering destination.
description the webglframebuffer object does not define any methods or properties of its own and its content is not directly accessible. when working with webglframebuffer objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindframebuffer() webglrenderingcontext.createframebuffer() webglrenderingcontext.deleteframebuffer() webglrenderingcontext.isframebuffer() examples creating a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createframebuffer(); specifications specification status comment webgl 1.0the definition of 'webg...
WebGLRenderbuffer - Web APIs
the webglrenderbuffer interface is part of the webgl api and represents a buffer that can contain an image, or can be source or target of an rendering operation.
description the webglrenderbuffer object does not define any methods or properties of its own and its content is not directly accessible. when working with webglrenderbuffer objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindrenderbuffer() webglrenderingcontext.createrenderbuffer() webglrenderingcontext.deleterenderbuffer() webglrenderingcontext.isrenderbuffer() examples creating a render buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createrenderbuffer(); specifications specification status comment ...
WebGLRenderingContext.blendFunc() - Web APIs
t color and a constant alpha value are used together as source and destination factors, a gl.invalid_enum error is thrown. constants the following constants can be used for sfactor and dfactor. the formula for the blending color can be described like this: color(rgba) = (sourcecolor * sfactor) + (destinationcolor * dfactor). the rbga values are between 0 and 1. constant factor
description gl.zero 0,0,0,0 multiplies all colors by 0. gl.one 1,1,1,1 multiplies all colors by 1. gl.src_color rs, gs, bs, as multiplies all colors by the source colors. gl.one_minus_src_color 1-rs, 1-gs, 1-bs, 1-as multiplies all colors by 1 minus each source color. gl.dst_color rd, gd, bd, ad multiplies all colors by the destin...
WebGLRenderingContext.blendFuncSeparate() - Web APIs
is thrown. constants the following constants can be used for srcrgb, dstrgb, srcalpha, and dstalpha the formulas for the blending factors can be described like this (all rgba values are between 0 and 1): color(rgb) = (sourcecolor * srcrgb) + (destinationcolor * dstrgb) color(a) = (sourcealpha * srcalpha) + (destinationalpha * dstalpha) constant rgb factor alpha factor
description gl.zero 0,0,0 0 multiplies all colors by 0. gl.one 1,1,1,1 1 multiplies all colors by 1. gl.src_color rs, gs, bs as multiplies all colors by the source colors. gl.one_minus_src_color 1-rs, 1-gs, 1-bs 1-as multiplies all colors by 1 minus each source color. gl.dst_color rd, gd, bd ad multiplies all colors...
WebGLRenderingContext.getError() - Web APIs
the value of this constant is 0. gl.invalid_enum an unacceptable value has been specified for an enumerated argument. the command is ignored and the error flag is set. gl.invalid_value a numeric argument is out of range. the command is ignored and the error flag is set. gl.invalid_operation the specified command is not allowed for the current state. ...
WebGLRenderingContext.getTexParameter() - Web APIs
gl.texture_2d: a two-dimensional texture. gl.texture_cube_map: a cube-mapped texture. when using a webgl 2 context, the following values are available additionally: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. pname a glenum specifying the information to query. possible values: pname return type
description possible return values available in a webgl 1 context gl.texture_mag_filter glenum texture magnification filter gl.linear (default value), gl.nearest. gl.texture_min_filter glenum texture minification filter gl.linear, gl.nearest, gl.nearest_mipmap_nearest, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear (default value), gl.
WebGLRenderingContext.texParameter[fi]() - Web APIs
ture. when using a webgl 2 context, the following values are available additionally: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. the pname parameter is a glenum specifying the texture parameter to set. the param parameter is a glfloat or glint specifying the value for the specified parameter pname. pname
description param available in webgl 1 gl.texture_mag_filter texture magnification filter gl.linear (default value), gl.nearest. gl.texture_min_filter texture minification filter gl.linear, gl.nearest, gl.nearest_mipmap_nearest, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear (default value), gl.linear_mipmap_linear. gl.texture_wrap_s wrapping func...
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
dex, value); void gl.vertexattrib2fv(index, value); void gl.vertexattrib3fv(index, value); void gl.vertexattrib4fv(index, value); parameters index a gluint specifying the position of the vertex attribute to be modified. v0, v1, v2, v3 a floating point number for the vertex attribute value. value a float32array for floating point vector vertex attribute values. return value none.
description while vertex attributes are usually used to specify values which are different for each vertex (using vertexattribpointer), it can be useful to specify a constant value. for example, if you have a shader which has a color vertex attribute, but you want to draw everything in a single color, you can use vertexattrib to achieve that without creating a buffer filled with only one value or having to ...
WebGLRenderingContext.vertexAttribPointer() - Web APIs
is negative. a gl.invalid_operation error is thrown if stride and offset are not multiples of the size of the data type. a gl.invalid_operation error is thrown if no webglbuffer is bound to the array_buffer target. when using a webgl 2 context, a gl.invalid_operation error is thrown if this vertex attribute is defined as a integer in the vertex shader (e.g. uvec4 or ivec4, instead of vec4).
description let's assume we want to render some 3d geometry, and for that we will need to supply our vertices to the vertex shader. each vertex has a few attributes, like position, normal vector, or texture coordinate, that are defined in an arraybuffer and will be supplied to the vertex buffer object (vbo). first, we need to bind the webglbuffer we want to use to gl.array_buffer, then, with this method, gl...
WebGLShader - Web APIs
at this point the webglshader is still not in a usable form and must still be attached to a webglprogram. ...
WebGLTexture - Web APIs
the webgltexture interface is part of the webgl api and represents an opaque texture object providing storage and state for texturing operations.
description the webgltexture object does not define any methods or properties of its own and its content is not directly accessible. when working with webgltexture objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindtexture() webglrenderingcontext.createtexture() webglrenderingcontext.deletetexture() webglrenderingcontext.istexture() examples creating a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); specifications specification status comment webgl 1.0the definition of 'webgltexture' in that sp...
WebGLUniformLocation - Web APIs
the webgluniformlocation interface is part of the webgl api and represents the location of a uniform variable in a shader program.
description the webgluniformlocation object does not define any methods or properties of its own and its content is not directly accessible. when working with webgluniformlocation objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.getuniformlocation() webglrenderingcontext.uniform() examples getting an uniform location var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var location = gl.getuniformlocation(webglprogram, 'uniformname'); specifications specification status comment webgl 1.0the definition of 'webgluniformlocation' in that specification. recomm...
Lifetime of a WebRTC session - Web APIs
e call between them can be identified by the code on the signaling server. the exact contents and form of this identifier is up to you. each peer connects to an agreed-upon signaling server, such as a websocket server they both know how to exchange messages with. each peer tells the signaling server that they want to join the same webrtc session (identified by the token established in step 4).
descriptions, candidates, etc. -- more coming up ice restart sometimes, during the lifetime of a webrtc session, network conditions change. one of the users might transition from a cellular to a wifi network, or the network might become congested, for example. when this happens, the ice agent may choose to perform ice restart. this is a process by which the network connection is renegotiated, exactly the ...
WebRTC Statistics API - Web APIs
you get an object containing the corresponding data. the table below shows the statistic categories and the corresponding dictionaries; for each statistic category, the full hierarchy of rtcstats-based dictionaries are listed, so you can easily find all the available values. mapping of statistic category names to the dictionaries they implement statistic category name (rtcstatstype)
description dictionaries implemented candidate-pair statistics describing the change from one rtcicetransport to another, such as during an ice restart. rtcicecandidatepairstats rtcstats certificate statistics about a certificate being used by an rtcicetransport. rtccertificatestats rtcstats ...
WebSocket.readyState - Web APIs
the connection is not yet open. 1 open the connection is open and ready to communicate. 2 closing the connection is in the process of closing. ...
Geometry and reference spaces in WebXR - Web APIs
is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype
description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underly...
Web Authentication API - Web APIs
gistration actions in figure 1. the primary differences between registration and authentication are that: 1) authentication doesn't require user or relying party information; and 2) authentication creates an assertion using the previously generated key pair for the service rather than creating an attestation with the key pair that was burned into the authenticator during manufacturing. again, the
description of authentication below is a broad overview rather than getting into all the options and features of the web authentication api. the specific options for authenticating can be found in the publickeycredentialrequestoptions dictionary, and the resulting data can be found in the publickeycredential interface (where publickeycredential.response is the authenticatorassertionresponse interface) . f...
WheelEvent() - Web APIs
to 0.0, is a double representing the vertical scroll amount in the deltamode unit. "deltaz", optional and defaulting to 0.0, is a double representing the scroll amount for the z-axis in the deltamode unit. "deltamode", optional and defaulting to 0, is a unsigned long representing the unit of the delta values scroll amount. permitted values are: constant value
description dom_delta_pixel 0x00 the delta values are specified in pixels. dom_delta_line 0x01 the delta values are specified in lines. dom_delta_page 0x02 the delta values are specified in pages. the wheeleventinit dictionary also accepts fields from the mouseeventinit, uieventinit and eventinit...
WheelEvent.deltaMode - Web APIs
dom_delta_line 0x01 the delta values are specified in lines. dom_delta_page 0x02 the delta values are specified in pages. ...
WheelEvent - Web APIs
representing the horizontal scroll amount. wheelevent.deltayread only returns a double representing the vertical scroll amount. wheelevent.deltazread only returns a double representing the scroll amount for the z-axis. wheelevent.deltamoderead only returns an unsigned long representing the unit of the delta* values' scroll amount. permitted values are: constant value
description wheelevent.dom_delta_pixel 0x00 the delta* values are specified in pixels. wheelevent.dom_delta_line 0x01 the delta* values are specified in lines. wheelevent.dom_delta_page 0x02 the delta* values are specified in pages. methods this interface doesn't define any specific methods, but inherits methods from its ancestor...
Window.external - Web APIs
the external property of the window api returns an instance of the external interface, which was intended to contain functions related to adding external search providers to the browser. however, this is now deprecated, and the contained methods are now dummy functions that do nothing as per spec. methods the external object has the following methods: method
description addsearchprovider(
descriptionurl) dummy function; does nothing. see autodiscovery of search plugins. issearchproviderinstalled() dummy function; does nothing. specifications specification status html living standardthe definition of 'external' in that specification. living standard ...
Window.getComputedStyle() - Web APIs
however, the two objects have different purposes: the object from getcomputedstyle is read-only, and should be used to inspect the element's style — including those set by a <style> element or an external stylesheet. the element.style object should be used to set styles on tha...
Window.open() - Web APIs
ed. return value a windowproxy object, which is basically a thin wrapper for the window object representing the newly created window, and has all its features available. if the window couldn't be opened, the returned value is instead null. the returned reference can be used to access properties and methods of the new window as long as it complies with same-origin policy security requirements.
description the open() method creates a new secondary browser window, similar to choosing new window from the file menu. the url parameter specifies the url to be fetched and loaded in the new window. if url is an empty string, then a new blank, empty window (url about:blank) is created with the default toolbars of the main window. note that remote urls won't load immediately. when window.open() returns, t...
Window.openDialog() - Web APIs
ser has closed the dialog, supply modal as a windowfeatures parameter. note that this also means the user won't be able to interact with the opener window until he closes the modal dialog. syntax newwindow = opendialog(url, name, features, arg1, arg2, ...) newwindow the opened window url the url to be loaded in the newly opened window. name the window name (optional). see window.open()
description for detailed information. features see window.open() for details. arg1, arg2, ... the arguments to be passed to the new window (optional). example var win = opendialog("http://example.tld/zzz.xul", "dlg", "", "pizza", 6.98); notes new features all - initially activates (or deactivates ("all=no")) all chrome (except the behavior flags chrome, dialog and modal). these can be overridden (...
Window.showModalDialog() - Web APIs
as set by the document specified by uri. uri is the url of the document to display in the dialog. arguments is an optional variant containing values passed to the dialog; these are made available in the window object's window.dialogarguments property. options is an optional string specifying window ornamentation for the dialog, using one or more semicolon delimited values: syntax
description center: {on | off | yes | no | 1 | 0 } if on, yes, or 1, the dialog window is centered on the desktop; otherwise it's hidden. default is yes. dialogheight: height the height of the dialog box in pixels. dialogleft: left distance of the dialog box from the left edge of the desktop. dialogwidth: width the width of the dialog box in pixels. di...
WindowEventHandlers.onhashchange - Web APIs
hash has changed!'); } window.addeventlistener('hashchange', hashhandler, false); overriding the hash this function sets a new hash dynamically, setting it randomly to one of two values. function changehash() { location.hash = (math.random() > 0.5) ? 'location1' : 'location2'; } the hashchange event the dispatched hashchange event has the following properties: field type
description newurl domstring the new url to which the window is navigating. oldurl domstring the previous url from which the window was navigated. polyfill for event.newurl and event.oldurl // let this snippet run before your hashchange event binding code if (!window.hashchangeevent)(function(){ var lasturl = document.url; window.addeventlistener("hashchange", functi...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
his.backw === bbackw && (this.isatend() || !this.paused)) { return; } this.backw = bbackw; this.paused = false; this.synchronize(); }; minidaemon passes arguments to the callback function. if you want to work on it with browsers that natively do not support this feature, use one of the methods proposed above. syntax var mydaemon = new minidaemon(thisobject, callback[, rate[, length]]);
description returns a javascript object containing all information needed by an animation (like the this object, the callback function, the length, the frame-rate). arguments thisobject the this object on which the callback function is called. it can be an object or null. callback the function that is repeatedly invoked . it is called with three arguments: index (the iterative index of each invocatio...
Worklet - Web APIs
de to do graphics rendering or audio processing where high performance is required. worklet types worklets are restricted to specific use cases; they cannot be used for arbitrary computations like web workers. the worklet interface abstracts properties and methods common to all kind of worklets, and cannot be created directly. instead, you can use one of the following classes: name
description location specification paintworklet for programmatically generating an image where a css property expects a file. access this interface through css.paintworklet. chrome: main thread gecko: paint thread css painting api audioworklet for audio processing with custom audionodes. web audio render thread web audio api animationworklet...
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
); } else if ((secinfo.securitystate & ci.nsiwebprogresslistener.state_is_insecure) == ci.nsiwebprogresslistener.state_is_insecure) { dump("insecure connection\n"); } else if ((secinfo.securitystate & ci.nsiwebprogresslistener.state_is_broken) == ci.nsiwebprogresslistener.state_is_broken) { dump("unknown\n"); dump("\tsecurity
description: " + secinfo.shortsecurity
description + "\n"); dump("\tsecurity error message: " + secinfo.errormessage + "\n"); } } else { dump("\tno security info available for this channel\n"); } // print ssl certificate details if (secinfo instanceof ci.nsisslstatusprovider) { var cert = secinfo.queryinterface(ci.nsisslstatusprovider) .sslsta...
XMLHttpRequest.readyState - Web APIs
open() not called yet. 1 opened open() has been called. 2 headers_received send() has been called, and headers and status are available. 3 loading downloading; responsetext holds partial data. 4 done the operation is complete. unsent the xmlhttprequest client has been created, but the open() method hasn't been called yet. ...
XMLHttpRequest.send() - Web APIs
equestbodyinit, 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 request is complete. networkerror the resource type to be fetched is a blob, and the method is not get. example: get var xhr = new xmlhttprequest(); xhr.open('get', '/server', true); xhr.onload = function () { // request finished. do processing here. }; xhr.send(null); // xhr.send...
XMLHttpRequest.upload - Web APIs
the xmlhttprequest upload property returns an xmlhttprequestupload object that can be observed to monitor an upload's progress. it is an opaque object, but because it's also an xmlhttprequesteventtarget, event listeners can be attached to track its process. the following events can be triggered on an upload object and used to monitor the upload: event event listener
description loadstart onloadstart the upload has begun. progress onprogress periodically delivered to indicate the amount of progress made so far. abort onabort the upload operation was aborted. error onerror the upload failed due to an error. load onload the upload completed successfully. timeout ontimeout the upload timed out beca...
XPathException - Web APIs
in the dom xpath api the xpathexception interface represents exception conditions that can be encountered while performing xpath operations. properties xpathexception.code read only returns a short that contains one of the error code constants. constants constant value
description invalid_expression_err 51 if the expression has a syntax error or otherwise is not a legal expression according to the rules of the specific xpathevaluator or contains specialized extension functions or variables not supported by this implementation. type_err 52 if the expression cannot be converted to return the specified type. specifications specification status comment document object model (dom) level 3 xpath specificationthe defi...
XPathResult.resultType - Web APIs
the read-only resulttype property of the xpathresult interface represents the type of the result, as defined by the type constants. note: this feature is available in web workers. syntax var resulttype = result.resulttype; return value an integer value representing the type of the result, as defined by the type constants. constants result type defined constant value
description any_type 0 a result set containing whatever type naturally results from evaluation of the expression. note that if the result is a node-set then unordered_node_iterator_type is always the resulting type. number_type 1 a result containing a single number. this is useful for example, in an xpath expression using the count() function. string_type 2 a result ...
XPathResult - Web APIs
it and returns the next node from it or null if there are no more nodes. xpathresult.snapshotitem() returns an item of the snapshot collection or null in case the index is not within the range of nodes. unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated. constants result type defined constant value
description any_type 0 a result set containing whatever type naturally results from evaluation of the expression. note that if the result is a node-set then unordered_node_iterator_type is always the resulting type. number_type 1 a result containing a single number. this is useful for example, in an xpath expression using the count() function. string_type 2 a ...
XRPermissionDescriptor.optionalFeatures - Web APIs
is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype
description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underly...
XRPermissionDescriptor.requiredFeatures - Web APIs
pe enumerated type, indicating the reference space types that your app would like permission to use, but can operate without. future editions of webxr may add more recognized features. the permitted values are: the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype
description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underly...
XRPermissionStatus.granted - Web APIs
n array of domstring objects, each identifying a single webxr feature which the app or site has been granted permission to use. currently, all of these strings come from the xrreferencespacetype enumerated type. the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype
description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underly...
XRReferenceSpace - Web APIs
is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype
description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underly...
XRReferenceSpaceType - Web APIs
is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype
description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underly...
XRRenderState.baseLayer - Web APIs
this property is read-only; however, you can indirectly change its value using xrsession.updaterenderstate. syntax var xrwebgllayer = xrrenderstate.baselayer; value a xrwebgllayer object which is used as the source of the world's contents when rendering each frame of the scene. see the examples below to see how to use updaterenderstate() to set the current xrwebgllayer used for rendering the scene. ...
XRSession.requestReferenceSpace() - Web APIs
is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype
description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underly...
XRSession - Web APIs
rror if the requested space type isn't supported by the device. updaterenderstate() updates the properties of the session's render state to match the values specified in the specified xrrenderstateinit dictionary. any properties not included in the given dictionary are left unchanged from their current values. events the following events are delivered to xrsession objects. event
description end sent to the xrsession object after the webxr session has ended and all hardware-related functions have completed. the event is represented by an object of type xrsessionevent. also available through the onend event handler property. inputsourceschange an event of type xrinputsourceschangeevent sent to the xrsession when the list of active xr input sources has c...
XRView - Web APIs
a 3d frame will involve two views, one for each eye, separated by an appropriate distance which approximates the distance between the viewer's eyes. this allows the two views, when projected in isolation into the appropriate eyes, to simulate a 3d world. ...
msCaching - Web APIs
also be large incompatibilities between implementations and the behavior may change in the future. the mscaching read/write property specifies whether stream data downloaded using xmlhttprequestis cached to disk or not. this proprietary method is specific to internet explorer and microsoft edge. syntax cachestate = object.mscaching values type: domstring property value
description auto disables caching for stream or ms-stream data. enabled enables caching for stream or ms-stream data. disabled disables caching for any data. see also mscachingenabled microsoft api extensions ...
Web APIs
nt rtcremoteoutboundrtpstreamstats rtcrtcpparameters rtcrtpcapabilities rtcrtpcodeccapability rtcrtpcodecparameters rtcrtpcontributingsource rtcrtpencodingparameters rtcrtpparameters rtcrtpreceiveparameters rtcrtpreceiver rtcrtpsendparameters rtcrtpsender rtcrtpstreamstats rtcrtpsynchronizationsource rtcrtptransceiver rtcrtptransceiverdirection rtcrtptransceiverinit rtcsctptransport rtcsession
description rtcsession
descriptioncallback rtcstats rtcstatsicecandidatepairstate rtcstatsreport rtcstatstype rtctrackevent rtctrackeventinit radionodelist range readablebytestreamcontroller readablestream readablestreambyobreader readablestreambyobrequest readablestreamdefaultcontroller readablestreamdefaultreader relativeorientationsensor renderingcontext report reportingobserver reportingobse...
Using the alert role - Accessibility
the alert role is used to communicate an important and usually time-sensitive message to the user. when this role is added to an element, the browser will send out an accessible alert event to assistive technology products which can then notify the user about it. ...
Using the aria-activedescendant attribute - Accessibility
it makes do with the overhead of having all or more than one child focusable. as the name specifies, it helps in managing the current active child of the composite widget. possible effects on user agents and assistive technology the user agent, which is any software that retrieves, renders and facilitates end user interaction with web content, uses the aria-activedescendant property to inform the assistive technology about the active child which has focus. ...
Using the aria-hidden attribute - Accessibility
this can improve the experience for assistive technology users by hiding: purely decorative content, such as icons or images duplicated content, such as repeated text offscreen or collapsed content, such as menus according to the fourth rule of aria, aria-hidden="true" should not be used on a focusable element. ...
Using the aria-invalid attribute - Accessibility
the aria-invalid attribute is used to indicate that the value entered into an input field does not conform to the format expected by the application.this may include formats such as email addresses or telephone numbers. aria-invalid can also be used to indicate that a required field has not been filled in.the attribute should be programmatically set as a result of a validation process. this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned. values vocabulary: false (default) no errors detected grammar a grammatical error has been detected. spelling a spelling error has been detected. true the value has failed validation. ...
Using the aria-labelledby attribute - Accessibility
description the aria-labelledby attribute establishes relationships between objects and their label(s), and its value should be one or more element ids, which refer to elements that have the text needed for labeling. list multiple element ids in a space delimited fashion. this idea is similar to how the "for" attribute is used to link a label to an input. assistive technology, such as screen readers, use this attribute to catalog the objects in a document so that users can navigate between them. without an element id, the assistive technology cannot catalog the object. aria-labelledby is very similar to aria-describedby: a label provides essential information about an object, while a
description provides extended information that the user might need. in addition to form elements, you c...
Using the aria-required attribute - Accessibility
this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned. html5 now has the required attribute, but aria-required is still useful for user agents that do not yet support html5. value true or false (default: false) possible effects on user agents and assistive technology screen readers should announce the field as required. note that this attribute will not automatically change the presentation of the field. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. ...
Using the aria-valuemax attribute - Accessibility
if the aria-valuenow has a known maximum and minimum, the author should provide properties for aria-valuemax and aria-valuemin. the value of aria-valuemax must be greater than or equal to the value of aria-valuemin. aria-valuemax is a required attribute of role slider, scrollbar and spinbutton. value string representation of a number possible effects on user agents and assistive technology if the aria-valuemax is indeterminate, or if aria-valuemin is not less than or equal to the value of aria-valuemax, this creates an error condition that will be handled by the assistive technology. ...
Using the log role - Accessibility
the log role is used to identify an element that creates a live region where new information is added in a meaningful order and old information may disappear. for example, chat logs, messaging history or an error log. in contrast to other types of live region, this role is sequentially ordered and new information is only added to the end of the log. when this role is added to an element, the browser will send out an accessible log event to assistive technology products which can then notify the user about it. by default updates contain only the changes to the live region and these are announced when the user is idle. ...
Using the radio role - Accessibility
possible effects on user agents and assistive technology note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: example from the basic form hints mdn page. ...
Using the status role - Accessibility
the status role is a type of live region and a container whose content is advisory information for the user that is not important enough to justify an alert, and is often presented as a status bar. when the role is added to an element, the browser will send out an accessible status event to assistive technology products which can then notify the user about it. status information content must be provided within a status object, and it should be ensured that this object does not receive focus. if another part of the page controls what appears in the status, the relationship should be made explicit via the aria-controls attribute. ...
Using the toolbar role - Accessibility
possible effects on user agents and assistive technology note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. ...
ARIA: tabpanel role - Accessibility
the first rule of aria use is you can use a native feature with the semantics and behavior you require already built in, instead of re-purposing an element and adding an aria role, state or property to make it accessible, then do so. then post full details in best practices section below. ...
ARIA: alert role - Accessibility
the alert role can be used to tell the user an element has been dynamically updated. screen readers will instantly start reading out the updated content when the role is added. if the user is expected to close the alert, then the alertdialog role should be used instead.
description one of the five live region roles, the alert role is used to provide the user with important, and usually time-sensitive, information, and often to tell the user an element has been dynamically updated. the alert role is added to the node containing an alert message, not the element causing the alert to be triggered. alerts are assertive live regions. setting role="alert" is equivalent to setting aria-live="assertive" and aria-atomic="true". they don't receive focus, and therefore focus does not need to be managed and ...
ARIA: article role - Accessibility
y and are related. instead of a div with an article role, use the <article> element. always use native element if available. instead of using role="article", the <article> element can be used. <article> <h2>heading of the segment</h2> <p>paragraph for the segment.</p> <p>another paragraph.</p> ... controls to interact with the article, share it, etc. ... </article> <article> ... </article>
description the article role denotes a section of a document, page, or site that, if it were standing on its own, could be viewed as a complete document, page or site. the aim of a set of article sections is to indicate their relationship to one another. articles are not considered a navigational landmark, but many assistive technologies that support landmarks also support a means to navigate among article...
ARIA: banner role - Accessibility
g of the page. this usually includes a logo, company name, search icon, photo related to the page, or slogan. <div role="banner"> <img src="companylogo.svg" alt="my company name" /> <h1>title</h1> <h2>subtitle</h2> </div> by default, the html5 <header> element has an identical meaning to the banner landmark, unless it is a descendant of <aside>, <article>, <main>, <nav>, or <section>.
description a banner landmark role converts the container element upon which it is applied into a header. it should be reserved for the site header content that is common across the site generally at the top of every page. the banner is typically includes things a logo or corporate identity, possibly a site-specific search tool, and is generally what your marketing team would call the header or top banner ...
ARIA: cell role - Accessibility
in column or row header information. to be supported, the cell must be nested in an element with the role of row. <div role="row"> <span role="cell">france</span> <span role="cell">67 million</span> </div> a better, more semantic way of writing the cells above would be to use the semantic <td> element. <tr role="row"> <td role="cell">france</td> <td role="cell">67 million</td> </tr>
description the element with role="cell" is a cell within a row, optionally within a rowgroup, within a grid, table or treegrid within a static tabular structure. using native html <td> elements, whenever possible, is strongly encouraged. each element with role="cell" must be nested in a container element with role="row". that row, in turn, can be nested within an element with role="rowgroup", and should ...
ARIA: document role - Accessibility
se the document mode to read the content contained within this element. <div role="dialog"> ... <div id="infotext" role="document" tabindex="0"> <p>some informational text goes here.</p> </div> ... <button>close</button> </div> this example shows a dialog widget with some controls and a section with some informational text that the assistive technology user can read when tabbing to it.
description by default, web pages are treated as documents; assistive technologies (at) enter browse or read mode when entering a new web page. this mode can be altered through various roles, including the widget and application roles. the document role brings the at back into browse or read mode. generally placed within an application role or other interactive widget role, the document role is used to in...
ARIA: grid role - Accessibility
while it does not imply a specific visual presentation, it implies a relationship among elements. uses fall into two categories: presenting tabular information (data grids) and grouping other widgets (layout grids). even though both data grids and layout grids employ the same aria roles, s...
ARIA: gridcell role - Accessibility
div role="gridcell">smith</div> <div role="gridcell">496-619-5098</div> … </div> the first rule of aria is if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding aria. instead use the native html td element in conjunction with the and contenteditable attribute: <td>potato</td> <td>cabbage</td> <td>onion</td>
description gridcells with dynamically added, hidden, or removed rows and columns any element with a role="gridcell" applied to it should use aria to describe its order in the table-style grouping, provided the table, grid, or treegrid has the ability to have rows and/or columns dynamically added, hidden, or removed. use aria-colindex to describe a gridcell's order in the list of columns, and aria-rowinde...
ARIA: List role - Accessibility
the aria list role can be used to identify a list of items. it is normally used in conjunction with the listitem role, which is used to identify a list item contained inside the list. <section role="list"> <div role="listitem">list item 1</div> <div role="listitem">list item 2</div> <div role="listitem">list item 3</div> </section>
description any content that consists of an outer container with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively. a list must have one or more listitem children, or, alternatively, have one or more groups as children, with each group having one or more listitems as children. there are no hard and fast rules about which elements you should use to markup the list and list items, but you ...
ARIA: Listitem role - Accessibility
the aria listitem role can be used to identify an item inside a list of items. it is normally used in conjunction with the list role, which is used to identify a list container. <section role="list"> <div role="listitem">list item 1</div> <div role="listitem">list item 2</div> <div role="listitem">list item 3</div> </section>
description any content that consists of an outer container with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively. there are no hard and fast rules about which elements you should use to markup the list and list items, but you should make sure that the list items make sense in the context of a list, e.g. a shopping list, recipe steps, driving directions. warning: if at all possible in your ...
ARIA: Main role - Accessibility
of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application. <div id="main" role="main"> <h1>avocados</h1> <!-- main section content --> </div> this is the main section of a document that discusses avocados. subsections of this document could discuss their history, the different types, regions where they grow, etc.
description the main role is a navigational landmark role identifying the main content of a document. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. by classifying and labeling sections of a page, structural information conveyed visually through layout can be represented programmatically. screen readers use landmark roles to provide keyboard...
ARIA: row role - Accessibility
using native html <tr> elements, whenever possible, is strongly encouraged. to create an aria row, add role="row" to the container element. that row should be nested within a grid...
ARIA: rowgroup role - Accessibility
there is, however, no differentiation between different types of rowgroups. their elements must be contained in, or owned by, elements with either the table or grid role. using the native <thead>, <tfoot> , and <tbody> html elements, whenever possible, is ...
ARIA: switch role - Accessibility
ed" and "unchecked" states, which are fairly generic in meaning, the switch role represents the states "on" and "off." this example creates a widget and assigns the aria switch role to it. <button type="button" role="switch" aria-checked="true" id="speakerpower" class="switch"> <span>off</span> <span>on</span> </button> <label for="speakerpower" class="switch">speaker power</label>
description the aria switch role is identical to the checkbox role, except instead of being "checked" or "unchecked", it is either "on" and "off." like the checkbox role, the aria-checked attribute is required. the two possible values are true and false. unlike a <checkbox> or role="checkbox", there is no indeterminate or mixed state. the switch role does not support the value mixed for the aria-checked at...
ARIA: tab role - Accessibility
the common user experience pattern is a group of visual tabs above, or to the side of, a content area, and selecting a different tab changes the content and makes the selected tab more prominent than the other tabs. ...
ARIA: checkbox role - Accessibility
nces</label> the first rule of aria is if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding aria. instead use the native html checkbox of <input type="checkbox">, which natively provides all the functionality required: <input type="checkbox" id="chk1-label"> <label for="chk1-label">remember my preferences</label>
description the native html checkbox form control can only have two checked states ("checked" or "not checked"), with an indeterminate state settable via javascript. similarly, an element with role="checkbox" can expose three states through the aria-checked attribute: true, false, or mixed. since a checkbox is an interactive control, it must be focusable and keyboard accessible. if the role is applied to...
ARIA: heading role - Accessibility
the heading role defines this element as a heading to a page or section. to give the page more structure, a level should also be provided to indicate relationships between sections. <div role="heading" aria-level="1">this is a main page heading</div> this defines the text in the div to be the main heading of the page, indicated by being level 1 via the aria-level attribute.
description the heading role indicates to assistive technologies that this element should be treated like a heading. screen readers would read the text and indicate that it is formatted like a heading. in addition, the level tells assistive technologies which part of the page structure this heading represents. a level 1 heading usually indicates the main heading of a page, a level 2 heading the first subsection, a ...
HTML To MSAA - Accessibility
r click event listener is registered state_system_ traversed if link is traversed n/a "jump" if @href is valid n/a br role_system_ whitespace '\n' (new line char) state_system_ readonly n/a n/a n/a button role_system_ pushbutton from child nodes n/a state_system_ focusable state_system_ default if @type attribute has value "submit" n/a "press" n/a caption bstr role n/a n/a n/a
description_for (0x100f), points to table element div bstr role n/a n/a n/a n/a n/a n/a fieldset role_system_ grouping text equivalent from child legend element n/a n/a labelled_by (1003), points to legend element n/a n/a hr role_system_ separator n/a n/a n/a n/a n/a n/a img, input @type=image role_system_ graphic from @alt attribute, empty @alt attribute means name can't be calculated a...
Accessibility documentation index - Accessibility
scendant property. 18 using the aria-describedby attribute aria, accessibility, attribute the aria-describedby attribute is used to indicate the ids of the elements that describe the object. it is used to establish a relationship between widgets or groups and text that described them. this is very similar to aria-labelledby: a label describes the essence of an object, while a
description provides more information that the user might need. 19 using the aria-hidden attribute aria, accessibility, attribute, codingscripting, html, javascript, needscontent, role(2), agent, alert, user, useragent this technique demonstrates how to use the aria-hidden attribute. the aria-hidden attribute can either expose or hide non-interactive content from the accessibility api. ...
Accessibility Information for Web Authors - Accessibility
in a clear and well structured table where each and all checkpoints are identified and described (along with an helpful clickable link to the related reference guideline) into logical groups and according to measurable results: passed, warning, failed for automated verification, warning for manual verification, not selected, not available, not related, etc. accessibility valet from webthing
description and summary to be written. wave 4.0 beta (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 4.0 beta is another powerful, free online webpage accessibility validation service that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines. its p...
Keyboard-navigable JavaScript widgets - Accessibility
components that use interactive elements that do not exist in html. grouping controls for grouping widgets such as menus, tablists, grids, or tree views, the parent element should be in the tab order (tabindex="0"), and each descendent choice/tab/cell/row should be removed from the tab order (tabindex="-1"). users should be able to navigate the descendent elements using arrow keys. (for a full
description of the keyboard support that is normally expected for typical widgets, see the wai-aria authoring practices.) the example below shows this technique used with a nested menu control. once keyboard focus lands on the containing <ul> element, the javascript developer must programmatically manage focus and respond to arrow keys. for techniques for managing focus within widgets, see "managing focus i...
Color contrast - Accessibility
as video or animation, you should follow 1.4.11 (again, see below). to check your contrast as you make your color choices, use a tool such as webaim's color contrast checker. you can also check color contrast on the fly using firefox's developer tools — see our accessibility inspector guide, and in particular the section check for accessibility issues. try using it on the live examples in the
description section. related wcag success criteria 1.4.3 minimum contrast (aa) the color contrast between background and foreground content should be at a minimum level to ensure legibility: text and its background should have a contrast ratio of at least 4.5:1. heading (or just larger) text should have a ratio of at least 3:1. larger text is defined as at least 18pt, or 14pt bold. 1.4.6 enha...
Robust - Accessibility
to be used as intended, e.g. not only by sighted mouse users, but also by screenreader users, keyboard-only users, etc. see html: a good basis for accessibility and wai-aria basics. 4.1.3 status messages (aa) added in 2.1 assistive technology users are made aware of new status messages added to the page. understanding status messages note: also see the wcag
description for guideline 4.1: compatible: maximize compatibility with current and future user agents, including assistive technologies. see also wcag perceivable operable understandable robust ...
-moz-image-rect - CSS: Cascading Style Sheets
or <percentage>, of the sub-image within the specified image. right the right edge, specified as an <integer> or <percentage>, of the sub-image within the specified image. bottom the bottom edge, specified as an <integer> or <percentage>, of the sub-image within the specified image. left the left edge, specified as an <integer> or <percentage>, of the sub-image within the specified image.
description this property allows you to, for example, use different parts of one larger image as backgrounds in different parts of your content. this works very similarly to the -moz-image-region property, which is used with the list-style-image property to use parts of an image as the bullets in lists. however, this can be used for any css background. the syntax for the rectangle is similar to the rect()...
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
does not. </p> </div> css div { width: 100%; overflow: auto; } p { width: 200%; background: #f5f9fa; border: 2px solid #eaf2f4; padding: 10px; } .scroll-touch { -webkit-overflow-scrolling: touch; /* lets it scroll lazy */ } .scroll-auto { -webkit-overflow-scrolling: auto; /* stops scrolling immediately */ } results specifications not part of any standard. apple has a
description in the safari css reference. ...
:has() - CSS: Cascading Style Sheets
in earlier revisions of the css selectors level 4 specification, :has had a limitation that it couldn't be used within stylesheets. instead, it could only be used with functions like document.queryselector(); this was due to performance concerns. this limitation has been removed because no browser implemented it that way. ins...
:not() - CSS: Cascading Style Sheets
since pseudo-elements are not simple selectors, they are not valid arguments to :not(); thus, selectors like :not(p::before) will not work. useless selectors can be written using this pseudo-class. ...
negative - CSS: Cascading Style Sheets
egative. syntax /* <symbol> values */ negative: "-"; /* prepends '-' if value is negative */ negative: "(" ")"; /* surrounds value by '(' and ')' if it is negative */ values first <symbol> this symbol will be prepended to the representation when the counter is negative. second <symbol> if present, this symbol will be appended to the representation when the counter is negative.
description if the counter value is negative, the symbol provided as value for the descriptor is prepended to the counter representation; and a second symbol if specified, will be appended to the representation. the negative descriptor has effect only if the system value is symbolic, alphabetic, numeric, additive, or extends, if the extended counter style itself uses a negative sign. if the negative descrip...
pad - CSS: Cascading Style Sheets
iptor can be used with custom counter style definitions when you need the marker representations to have a minimum length. syntax pad: 3 "0"; values <integer> && <symbol> the <integer> specifies a minimum length that all counter representations must reach. the value must be non-negative. if the minimum length is not reached, the representation will be padded with the specified <symbol>.
description if a marker representation is smaller than the specified pad length, then the marker will be padded with the specified pad symbol. marker representations longer than the pad length are constructed as normal. pad descriptor takes the minimum marker length as an integer and a symbol to be used for padding as the second parameter. a common usage of the pad descriptor is when you need your list to s...
range - CSS: Cascading Style Sheets
ns both, the lower and upper bound numbers. if infinite is used as the first value in a range, it represents negative infinity; if it is used as the second value, it represents positive infinity. the range of the counter style is the union of all the ranges defined in the list. if the lower bound of any range is higher than the upper bound, the entire descriptor is invalid and will be ignored.
description the value of the range descriptor can be either auto or a comma separated list of lower and upper bounds specified as integers. if value is auto, then for cyclic, numeric, and fixed system, the range will be from negative infinity to positive infinity. for alphabetic and symbolic systems, range will be from 1 to positive infinity. for additive systems, auto will result in the range 0 to positiv...
symbols - CSS: Cascading Style Sheets
counter system will use to construct counter representations. syntax the symbols descriptor is specified as one or more <symbol>s. values <symbol> represents a symbol used within the counter system. this must be one of the following data types: <string> <image> (note: this value is "at risk" and may be removed from the specification. it is not yet implemented.) <custom-ident>
description a symbol can be a string, image, or identifier. it is used within the @counter-style at-rule. symbols: a b c d e; symbols: "\24b6" "\24b7" "\24b8" d e; symbols: "0" "1" "2" "4" "5" "6" "7" "8" "9"; symbols: url('first.svg') url('second.svg') url('third.svg'); symbols: indic-numbers; the symbols descriptor must be specified when the value of the system descriptor is cyclic, numeric, alphabetic...
font-display - CSS: Cascading Style Sheets
uto the font display strategy is defined by the user agent. block gives the font face a short block period and an infinite swap period. swap gives the font face an extremely small block period and an infinite swap period. fallback gives the font face an extremely small block period and a short swap period. optional gives the font face an extremely small block period and no swap period.
description the font display timeline the font display timeline is based on a timer that begins the moment the user agent attempts to use a given downloaded font face. the timeline is divided into the three periods below which dictate the rendering behavior of any elements using the font face. font block period if the font face is not loaded, any element attempting to use it must render an invisible fa...
src - CSS: Cascading Style Sheets
font formats. if a user agent doesn't support the specified formats, it skips downloading the font resource. if no format hints are supplied, the font resource is always downloaded. <font-face-name> specifies the name of a locally-installed font face using the local() function, which uniquely identifies a single font face within a larger family. the name can optionally be enclosed in quotes.
description the value of this descriptor is a prioritized, comma-separated list of external references or locally-installed font face names. when a font is needed the user agent iterates over the set of references listed using the first one it can successfully activate. fonts containing invalid data or local font faces that are not found are ignored and the user agent loads the next font in the list. as wi...
unicode-range - CSS: Cascading Style Sheets
codepoint a single unicode character code point, for example u+26. codepoint range a range of unicode code points. so for example, u+0025-00ff means include all characters in the range u+0025 to u+00ff. wildcard range a range of unicode code points containing wildcard characters, that is using the '?' character, so for example u+4?? means include all characters in the range u+400 to u+4ff.
description the purpose of this descriptor is to allow the font resources to be segmented so that a browser only needs to download the font resource needed for the text content of a particular page. for example, a site with many localizations could provide separate font resources for english, greek and japanese. for users viewing the english version of a page, the font resources for greek and japanese fonts...
@font-face - CSS: Cascading Style Sheets
resource is — so it can select a suitable one — it is possible to include a format type inside a format() function: src: url(ideal-sans-serif.woff) format("woff"), url(basic-sans-serif.ttf) format("truetype"); the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". unicode-range the range of unicode code points to be used from the font.
description if the local() function is provided, specifying a font name to look for on the user's computer, and the user agent finds a match, that local font is used. otherwise, the font resource specified using the url() function is downloaded and used. by allowing authors to provide their own fonts, @font-face makes it possible to design content without being limited to the so-called "web-safe" fonts (th...
@import - CSS: Cascading Style Sheets
te file is chosen automatically (e.g. chrome://communicator/skin/). see here for more information. list-of-media-queries is a comma-separated list of media queries conditioning the application of the css rules defined in the linked url. if the browser does not support any these queries, it does not load the linked resource. supports-query is either a <supports-condition> or a <declaration>.
description imported rules must precede all other types of rules, except @charset rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules. so that user agents can avoid retrieving resources for unsupported media types, authors may specify media-dependent @import rules. these conditional imports specify comma-separated media queries after the url. in the absence of a...
@keyframes - CSS: Cascading Style Sheets
in { from { transform: translatex(0%); } to { transform: translatex(100%); } } values <custom-ident> a name identifying the keyframe list. this must match the identifier production in css syntax. from a starting offset of 0%. to an ending offset of 100%. <percentage> a percentage of the time through the animation sequence at which the specified keyframe should occur.
description javascript can access the @keyframes at-rule with the css object model interface csskeyframesrule. to use keyframes, create a @keyframes rule with a name that is then used by the animation-name property to match an animation to its keyframe declaration. each @keyframes rule contains a style list of keyframe selectors, which specify percentages along the animation when the keyframe occurs, and a...
-webkit-animation - CSS: Cascading Style Sheets
note: this media feature is only supported by webkit. if possible, use an @supports feature query instead. syntax the -webkit-animation media feature is a boolean whose value is true if the vendor-prefixed css animation properties are supported. values true the browser supports -webkit prefixed css animations. ...
-webkit-transform-2d - CSS: Cascading Style Sheets
syntax -webkit-transform-2d is a boolean css media feature whose value is true if the browser supports -webkit prefixed css 2d transforms. values true the browser supports the 2d css transforms with the -webkit prefix. false the 2d css transforms prefixed with -webkit are not supported by the browser. ...
display-mode - CSS: Cascading Style Sheets
site from a url and launching it from a desktop icon. this feature corresponds to the web app manifest's display member. both apply to the top-level browsing context and any child browsing contexts. the feature query applies regardless of whether a web app manifest is present. syntax the display-mode feature is specified as a keyword value chosen from the list below. display mode
description fallback display mode fullscreen all of the available display area is used and no user agent chrome is shown. standalone standalone the application will look and feel like a standalone application. this can include the application having a different window, its own icon in the application launcher, etc. in this mode, the user agent will exclude ui elements for co...
@media - CSS: Cascading Style Sheets
side any other conditional group at-rule. /* at the top level of your code */ @media screen and (min-width: 900px) { article { padding: 1rem 3rem; } } /* nested within another conditional at-rule */ @supports (display: flex) { @media screen and (min-width: 900px) { article { display: flex; } } } for a discussion of media query syntax, please see using media queries.
description media types media types describe the general category of a device. except when using the not or only logical operators, the media type is optional and the all type will be implied. all suitable for all devices. print intended for paged material and documents viewed on a screen in print preview mode. (please see paged media for information about formatting issues that are specific to these...
@namespace - CSS: Cascading Style Sheets
@namespace is an at-rule that defines xml namespaces to be used in a css style sheet. syntax /* default namespace */ @namespace url(xml-namespace-url); @namespace "xml-namespace-url"; /* prefixed namespace */ @namespace prefix url(xml-namespace-url); @namespace prefix "xml-namespace-url";
description the defined namespaces can be used to restrict the universal, type, and attribute selectors to only select elements within that namespace. the @namespace rule is generally only useful when dealing with documents containing multiple namespaces—such as html5 with inline svg or mathml, or xml that mixes multiple vocabularies. any @namespace rules must follow all @charset and @import rules, and precede all other at-rules and style declarations in a style sheet. @namespace can be used to define the ...
@page - CSS: Cascading Style Sheets
: 2cm; } descriptors size specifies the target size and orientation of the page box’s containing block. in the general case, where one page box is rendered onto one page sheet, it also indicates the size of the destination page sheet. marks adds crop and/or registration marks to the document. bleed specifies the extent beyond the page box at which the page rendering is clipped.
description you can't change all css properties with @page. you can only change the margins, orphans, widows, and page breaks of the document. attempts to change any other css properties will be ignored. the @page at-rule can be accessed via the css object model interface csspagerule. note: the w3c is discussing how to handle viewport-related <length> units, vh, vw, vmin, and vmax. meanwhile do not use th...
Detecting CSS animation support - CSS: Cascading Style Sheets
lection. however, adding keyframes is trickier, since they're not defined using traditional css syntax (which makes them more flexible, but harder to define from script). to define our keyframes using javascript, we need to write them out as a css string. all we do is set up a keyframes variable, prefixing each attribute as it's constructed. this variable, once constructed, contains the complete
description of all the keyframes needed by our animation sequence. the next task is to actually add the keyframes to the page's css. the first thing to do is look to see if there's already a style sheet on the document; if so, we simply insert the keyframe
description into that stylesheet; this is done in lines 13-15. if there isn't already a style sheet, a new <style> element is created, and its content i...
CSS Animations tips and tricks - CSS: Cascading Style Sheets
px; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } @keyframes colorchange { 0% { background: yellow } 100% { background: blue } } .box { width: 100px; height: 100px; border: 1px solid black; } .changing { animation: colorchange 2s; } there are two classes here. the "box" class is the basic
description of the box's appearance, without any animation information included. the animation details are included in the "changing" class, which says that the @keyframes named "colorchange" should be used over the course of two seconds to animate the box. note that because of this, the box doesn't start with any animation effects in place, so it won't be animating. javascript content next we'll look at ...
Basic concepts of flexbox - CSS: Cascading Style Sheets
and left-to-right writing modes. modern layout methods encompass the range of writing modes and so we no longer assume that a line of text will start at the top left of a document and run towards the right hand side, with new lines appearing one under the other. you can read more about the relationship between flexbox and the writing modes specification in a later article; however, the following
description should help explain why we do not talk about left and right and top and bottom when we describe the direction that our flex items flow in. if the flex-direction is row and i am working in english, then the start edge of the main axis will be on the left, the end edge on the right. if i were to work in arabic, then the start edge of my main axis would be on the right and the end edge on the le...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
ware of how this will impact our flex layouts as writing mode changes the direction that blocks are laid out in our document. understanding block and inline directions is key to new layout methods. it is worth noting that we might want to change the writing mode of our document for reasons other than publishing content in a language that uses a different writing mode. see this article for a full
description of writing modes and ways to use them, both for content in other languages and for creative reasons. the writing modes the writing modes specification defines the following values of the writing-mode property, which serve to change the direction that blocks are laid out on the page, to match the direction that blocks lay out when content is formatted in that particular writing mode. you can ch...
Typical use cases of Flexbox - CSS: Cascading Style Sheets
the footer then moves up to sit directly under the content. media objects the media object is a common pattern in web design — this pattern has an image or other element to one side and text to the right. ideally a media object should be able to be flipped — moving the image from left to right. we see this pattern everywhere, used for comments, and anywhere we need to display images and
descriptions. with flexbox we can allow the part of the media object containing the image to take its sizing information from the image, and then the body of the media object flexes to take up the remaining space. in the live example below you can see our media object. i have used the alignment properties to align the items on the cross axis to flex-start, and then set the .content flex item to flex: 1. as ...
Basic Shapes - CSS: Cascading Style Sheets
he different parts of the box model, for example to use the border. .shape { shape-outside: circle(50%) border-box; } what is worth noting is that the margin-box will clip the shape, therefore shapes created in reference to other shapes which extend past the margin box will have the shape clipped to the margin box. we will see this in the following examples of basic shapes. for an excellent
description of references boxes as they apply to css shapes see understanding reference boxes for css shapes. inset() the inset() type defines a rectangle, which may not seem very useful as simply floating an item will give you a rectangular shape around it. however the inset() types enables the definition of offsets, thus pulling the content in over the shape. therefore inset() takes four values for the ...
Cookbook template - CSS: Cascading Style Sheets
requirements what does this pattern need to include, or what problems does it need to solve? list that here. recipe change the path to the example below to point to your merged example. the last parameter is the live example height, which you can change as needed. ...
CSS Layout cookbook - CSS: Cascading Style Sheets
can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer. note: if you are new to css layout then you might first like to take a look at our css layout learning module, as this will give you the basic grounding you need to make use of the recipes here. the recipes recipe
description layout methods media objects a two-column box with an image on one side and descriptive text on the other, e.g. a facebook post or tweet. css grid, float fallback, fit-content() sizing columns when to choose multi-column layout, flexbox or grid for your columns. css grid, multicol, flexbox center an element how to center an item horizontally and ve...
Shorthand properties - CSS: Cascading Style Sheets
t happens when you make changes. playing with code really is the best way to get to grips with html and css. for example: the second list item has the class my-class-1 applied. this sets the color of the <a> element nested inside to inherit. if you remove the rule how does it change the color of the link? do you understand why the third and fourth links are the color that they are? check the
description of the values above if not. which of the links will change color if you define a new color for the <a> element — for example a { color: red; }? see cascade and inheritance or introducing the css cascade for more information about how inheritance works in css. see also css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual...
Syntax - CSS: Cascading Style Sheets
pseudo-class, the whole selector is invalid and therefore the entire rule is ignored (as invalid too). css statements rulesets are the main building blocks of a style sheet, which often consists of only a big list of them. but there is other information that a web author wants to convey in the style sheet, like the character set, other external style sheets to import, font face or list counter
descriptions and many more. it will use other and specific kinds of statements to do that. a statement is a building block that begins with any non-space characters and ends at the first closing brace or semi-colon (outside a string, non-escaped and not included into another {}, () or [] pair). there are two kinds of statements: rulesets (or rules) that, as seen, associate a collection of css declarat...
CSS Tutorials - CSS: Cascading Style Sheets
they are grouped by complexity so that you can choose the most appropriate for your level. editor's note: we should look at using "difficulty level" tags on the tutorial/guide pages so that difficulty-based lists can be automatically built. ...
Value definition syntax - CSS: Cascading Style Sheets
tted, at least one component value must not be omitted. [ bold? smaller? ]! this example matches the following values: bold smaller bold smaller but not: neither bold nor smaller, as one of them must appear. smaller bold, as bold is juxtaposed and must appear before the smaller keyword. bold smaller bold, as bold and smaller may only appear once. summary sign name
description example combinators juxtaposition components are mandatory and should appear in that order solid <length> && double ampersand components are mandatory but may appear in any order <length> && <string> || double bar at least one of the components must be present, and they may appear in any order. <'border-image-outset'> || <'bor...
<basic-shape> - CSS: Cascading Style Sheets
f the shape to the closest side of the reference box. for circles, this is the closest side in any dimension. for ellipses, this is the closest side in the radius dimension. farthest-side uses the length from the center of the shape to the farthest side of the reference box. for circles, this is the farthest side in any dimension. for ellipses, this is the farthest side in the radius dimension.
description computed values of basic shapes the values in a <basic-shape> function are computed as specified, with these exceptions: omitted values are included and compute to their defaults. a <position> value in circle() or ellipse() is computed as a pair of offsets (horizontal then vertical) from the top left origin, each given as a combination of an absolute length and a percentage. a <border-radi...
<blend-mode> - CSS: Cascading Style Sheets
the top color, while using the hue and saturation of the bottom color. this blend mode is equivalent to color, but with the layers swapped. <div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: luminosity; }
description for each pixel among the layers to which it is applied, a blend mode takes the colors of the foreground and the background, perfoms a calculation on them, and returns a new color value. changes between blend modes are not interpolated. any change occurs immediately. examples blend mode comparison in the following example, we have a <div> with two background images set on it — a firefox log...
border - CSS: Cascading Style Sheets
e: the border will be invisible if its style is not defined. this is because the style defaults to none. values <line-width> sets the thickness of the border. defaults to medium if absent. see border-width. <line-style> sets the style of the border. defaults to none if absent. see border-style. <color> sets the color of the border. defaults to currentcolor if absent. see border-color.
description as with all shorthand properties, any omitted sub-values will be set to their initial value. importantly, border cannot be used to specify a custom value for border-image, but instead sets it to its initial value, i.e., none. the border shorthand is especially useful when you want all four borders to be the same. to make them different from each other, however, you can use the longhand border-w...
box-orient - CSS: Cascading Style Sheets
values horizontal the box lays out its contents horizontally. vertical the box lays out its contents vertically. inline-axis (html) the box displays its children along the inline axis. block-axis (html) the box displays its children along the block axis. the inline and block axes are the writing-mode dependent keywords which, in english, map to horizontal and vertical respectively.
description html dom elements lay out their contents along the inline-axis by default. this css property will only apply to html elements with a css display value of box or inline-box. formal definition initial valueinline-axis (horizontal in xul)applies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax horizontal | vertical...
conic-gradient() - CSS: Cascading Style Sheets
defining how the gradient progresses between adjacent color stops. the length defines at which point between two color stops the gradient color should reach the midpoint of the color transition. if omitted, the midpoint of the color transition is the midpoint between two color stops. note: rendering of color stops in css gradients follows the same rules as color stops in svg gradients.
description as with any gradient, a conic gradient has no intrinsic dimensions; i.e., it has no natural or preferred size, nor a preferred ratio. its concrete size will match the size of the element it applies to, or size of the <image> is set to something other than the element size. to create a conic gradient that repeats so as to fill a 360 degree rotation, use the repeating-conic-gradient() function in...
cursor - CSS: Cascading Style Sheets
ted. a non-url fallback (one or more of the keyword values) must be at the end of the fallback list. see using url values for the cursor property for more details. <x> <y> optional x- and y-coordinates. two unitless nonnegative numbers less than 32. keyword values move your mouse over values to see their live appearance in your browser: category css value example
description general auto the ua will determine the cursor to display based on the current context. e.g., equivalent to text when hovering text. default the platform-dependent default cursor. typically an arrow. none no cursor is rendered. links & status context-menu a context menu is available. help ...
display - CSS: Cascading Style Sheets
you might specify an inline flex container as follows: .container { display: inline flex; } this can currently be specified using a single value. .container { display: inline-flex; } for more information on these changes to the specification, see the article adapting to the new two-value syntax of display. global /* global values */ display: inherit; display: initial; display: unset;
description the individual pages for the different types of value that display can have set on it feature multiple examples of those values in action — see the syntax section. in addition, see the following material, which covers the various values of display in depth. adapting to the new two-value syntax of display css flow layout (display: block, display: inline) block and inline layout in norma...
flex-grow - CSS: Cascading Style Sheets
the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <number> values */ flex-grow: 3; flex-grow: 0.6; /* global values */ flex-grow: inherit; flex-grow: initial; flex-grow: unset; the flex-grow property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 0.
description this property specifies how much of the remaining space in the flex container should be assigned to the item (the flex grow factor). the main size is either width or height of the item which is dependent on the flex-direction value. the remaining space is the size of the flex container minus the size of all flex items' sizes together. if all sibling items have the same flex grow factor, then a...
flex - CSS: Cascading Style Sheets
the flex-grow of the flex item. negative values are considered invalid. defaults to 1 when omitted. <'flex-shrink'> defines the flex-shrink of the flex item. negative values are considered invalid. defaults to 1 when omitted. <'flex-basis'> defines the flex-basis of the flex item. a preferred size of 0 must have a unit to avoid being interpreted as a flexibility. defaults to 0 when omitted.
description for most purposes, authors should set flex to one of the following values: auto, initial, none, or a positive unitless number. to see the effect of these values, try resizing the flex containers below: <div class="flex-container"> <div class="item auto">auto</div> <div class="item auto">auto</div> <div class="item auto">auto</div> </div> <div class="flex-container"> <div class="item a...
font-optical-sizing - CSS: Cascading Style Sheets
les and send us a pull request. syntax /* keyword values */ font-optical-sizing: none; font-optical-sizing: auto; /* default */ /* global values */ font-optical-sizing: inherit; font-optical-sizing: initial; font-optical-sizing: unset; values none the browser will not modify the shape of glyphs for optimal viewing. auto the browser will modify the shape of glyphs for optimal viewing.
description optical sizing is enabled by default for fonts that have an optical size variation axis. the optical size variation axis is represented by opsz in font-variation-settings. when optical sizing is used, small text sizes are often rendered with thicker strokes and larger serifs, whereas larger text is often rendered more delicately with more contrast between thicker and thinner strokes. formal de...
font-size - CSS: Cascading Style Sheets
o the parent element's font size. for font-relative units that are root-based (such as rem), the font size is relative to the size of the font used by the <html> (root) element. <percentage> a positive <percentage> value, relative to the parent element's font size. note: to maximize accessibility, it is generally best to use values that are relative to the user's default font size.
description there are several ways to specify the font size, including with keywords or numerical values for pixels or ems. choose the appropriate method based on the needs for the particular web page. keywords keywords are a good way to set the size of fonts on the web. by setting a keyword font size on the <body> element, you can set relative font-sizing everywhere else on the page, giving you the abili...
font-stretch - CSS: Cascading Style Sheets
you can use font-stretch to select a condensed or expanded face from such fonts. if the font you are using does not offer condensed or expanded faces, this property has no effect. font face selection the face selected for a give...
font-synthesis - CSS: Cascading Style Sheets
s property can take any one of the following forms: the keyword value none. either of the keyword values weight and style. both the keyword values weight and style. values none indicates that neither bold nor italic typeface may be synthesized. weight indicates that a bold typeface may be synthesized if needed. style indicates that an italic typeface may be synthesized if needed.
description most standard western fonts include italic and bold variants, but many novelty fonts do not. fonts used for chinese, japanese, korean and other logographic scripts tend not to include these variants, and synthesizing them may impede the legibility of the text. in these cases, it may be desirable to switch off the browser's default font-synthesis. formal definition initial valueweight styleappl...
font-variation-settings - CSS: Cascading Style Sheets
lways one or more pairs consisting of a <string> of 4 ascii characters followed by a <number> indicating the axis value to set. if the <string> has more or fewer characters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid. the <number> can be fractional or negative, depending on the value range available in your font, as defined by the font designer.
description this property is a low-level mechanism designed to set variable font features where no other way to enable or access those features exist. you should only use it when no basic properties exist to set those features (e.g. font-weight, font-style). font characteristics set using font-variation-settings will always override those set using the corresponding basic font properties, e.g. font-weight,...
<frequency-percentage> - CSS: Cascading Style Sheets
the <frequency-percentage> css data type represents a value that can be either a <frequency> or a <percentage>. frequency values, e.g. the pitch of a speaking voice, are not currently used in any css properties. syntax the value of a <frequency-percentage> is either a <frequency> or a <percentage>; see their individual reference pages for details about their syntaxes.
description use in calc() where a <frequency-percentage> is specified as an allowable type, this means that the percentage resolves to a frequency and therefore can be used in a calc() expression. examples valid percentage values 90% positive percentage +90% positive percentage with leading + -90% negative percentage — not valid for all properties that use percentages invalid percentage values 90 % no space is all...
image-orientation - CSS: Cascading Style Sheets
exif information contained in the image will be used to rotate the image appropriately. <angle> obsolete since gecko 63 the <angle> of rotation to apply to the image. it is rounded to the nearest 90deg (0.25turn). flip obsolete since gecko 63 the image is flipped horizontally (i.e., reflected) after the rotation given by the <angle> value is applied. if no <angle> is given, 0deg is used.
description this property is intended only to be used for the purpose of correcting the orientation of images which were shot with the camera rotated. it should not be used for arbitrary rotations. for any purpose other than correcting an image's orientation due to how it was shot or scanned, use a transform property with the rotate keyword to specify rotation. this includes any user-directed changes to the...
<image> - CSS: Cascading Style Sheets
ted with any of the following: an image denoted by the <url> data type a <gradient> data type a part of the webpage, defined by the element() function an image, image fragment or solid patch of color, defined by the image() function a blending of two or more images defined by the cross-fade() function. a selection of images chosed based on resolution defined by the image-set() function.
description css can handle the following kinds of images: images with intrinsic dimensions (a natural size), like a jpeg, png, or other raster format. images with multiple intrinsic dimensions, existing in multiple versions inside a single file, like some .ico formats. (in this case, the intrinsic dimensions will be those of the image largest in area and the aspect ratio most similar to the containing b...
ime-mode - CSS: Cascading Style Sheets
supported by internet explorer. active the input method editor is initially active; text entry is performed through it unless the user specifically dismisses it. not supported on linux. inactive the input method editor is initially inactive, but the user may activate it if they wish. not supported on linux. disabled the input method editor is disabled and may not be activated by the user.
description unlike internet explorer, firefox's implementation of ime-mode allows this property on <input type="password">. however, this makes for a bad user experience, and password fields should not enable the ime. users may correct the inappropriate behavior of sites that don't follow this recommendation by placing the following css into their user stylesheet: input[type=password] { ime-mode: auto !i...
left - CSS: Cascading Style Sheets
ts, the distance of the element from its normal position is based on the right property; or if right is also auto, the element is not moved horizontally at all. inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block). this computed value is then handled as if it were a <length>, <percentage>, or the auto keyword.
description the effect of left depends on how the element is positioned (i.e., the value of the position property): when position is set to absolute or fixed, the left property specifies the distance between the element's left edge and the left edge of its containing block. (the containing block is the ancestor to which the element is relatively positioned.) when position is set to relative, the left p...
linear-gradient() - CSS: Cascading Style Sheets
midpoint of the color transition is the midpoint between two color stops. note: rendering of color stops in css gradients follows the same rules as color stops in svg gradients. note also that the first example above does not exactly render as depicted in mozilla firefox (particularly version 80.0b3). you'll have to set the html height property to 100% or 100vh to render as depicted.
description as with any gradient, a linear gradient has no intrinsic dimensions; i.e., it has no natural or preferred size, nor a preferred ratio. its concrete size will match the size of the element it applies to. to create a linear gradient that repeats so as to fill its container, use the repeating-linear-gradient() function instead. because <gradient>s belong to the <image> data type, they can only be...
mask-border-slice - CSS: Cascading Style Sheets
lement's size, not the size of the source image, so percentages are generally preferable in these cases. <percentage> represents an edge offset as a percentage of the source image's size: the width of the image for horizontal offsets, the height for vertical offsets. fill preserves the middle image region. its width and height are sized to match the top and left image regions, respectively.
description the slicing process creates nine regions in total: four corners, four edges, and a middle region. four slice lines, set a given distance from their respective sides, control the size of the regions. the above diagram illustrates the location of each region. zones 1-4 are corner regions. each one is used a single time to form the corners of the final border image. zones 5-8 are edge region...
offset-path - CSS: Cascading Style Sheets
o farthest-corner, and the keyterm contain. url() references the id of an svg shape -- circle, ellipse, line, path, polygon, polyline, or rect -- using the shape's geometry as the path. <basic-shape> specifies a css shape including circle(), ellipse(), inset(), polygon(), or path(). path() a path string defined with svg coordinate syntax. none specifies no motion path at all.
description this property defines a path an animated element can follow. an offset path is either a specified path with one or multiple sub-paths or the geometry of a not-styled basic shape. the element’s exact position on the offset path is determined by the offset-distance property. each shape or path must define an initial position for the computed value of 0 for offset-distance and an initial directio...
opacity - CSS: Cascading Style Sheets
interval, though valid, is clamped to the nearest limit in the range. value meaning 0 the element is fully transparent (that is, invisible). any <number> strictly between 0 and 1 the element is translucent (that is, content behind the element can be seen). 1 (default value) the element is fully opaque (visually solid).
description opacity applies to the element as a whole, including its contents, even though the value is not inherited by child elements. thus, the element and its children all have the same opacity relative to the element's background, even if they have different opacities relative to one another. using opacity with a value other than 1 places the element in a new stacking context. if you do not want to a...
outline-color - CSS: Cascading Style Sheets
; outline-color: initial; outline-color: unset; the outline-color property is specified as any one of the values listed below. values <color> the color of the outline, specified as a <color>. invert to ensure the outline is visible, performs a color inversion of the background. note that browsers are not required to support this value; if they don't, this keyword is considered invalid.
description an outline is a line that is drawn around an element, outside the border. unlike the element's border, the outline is drawn outside the element's frame, and may overlap other content. the border, on the other hand, will actually alter the page's layout to ensure that it fits without overlapping anything else (unless you explicitly set it to overlap). it is often more convenient to use the short...
outline-offset - CSS: Cascading Style Sheets
est. syntax /* <length> values */ outline-offset: 3px; outline-offset: 0.2em; /* global values */ outline-offset: inherit; outline-offset: initial; outline-offset: unset; values <length> the width of the space between the element and its outline. a negative value places the outline inside the element. a value of 0 places the outline so that there is no space between it and the element.
description an outline is a line that is drawn around an element, outside the border edge. the space between an element and its outline is transparent. in other words, it is the same as the parent element's background. formal definition initial value0applies toall elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length formal syntax ...
outline - CSS: Cascading Style Sheets
able exception is input elements, which are given default styling by browsers. values <'outline-color'> sets the color of the outline. defaults to currentcolor if absent. see outline-color. <'outline-style'> sets the style of the outline. defaults to none if absent. see outline-style. <'outline-width'> sets the thickness of the outline. defaults to medium if absent. see outline-width.
description borders and outlines are very similar. however, outlines differ from borders in the following ways: outlines never take up space, as they are drawn outside of an element's content. according to the spec, outlines don't have to be rectangular, although they usually are. as with all shorthand properties, any omitted sub-values will be set to their initial value. accessibility concerns assi...
overflow - CSS: Cascading Style Sheets
and overflow-y: scroll, or overflow: scroll hidden instead. -moz-hidden-unscrollable intended mainly for internal use and by themes. disables scrolling of xml root elements, <html>, and <body> with the keyboard's arrow keys and the mouse wheel. [1] as of firefox 63, this feature is behind a feature preference setting. in about:config, set layout.css.overflow.moz-scrollbars.enabled to true
description overflow options include clipping, showing scrollbars, or displaying the content flowing out of its container into the surrounding area. specifying a value other than visible (the default) creates a new block formatting context. this is necessary for technical reasons — if a float intersected with the scrolling element it would forcibly rewrap the content after each scroll step, leading to a ...
padding-block-end - CSS: Cascading Style Sheets
absolute length */ padding-block-end: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-block-end: 5%; /* a padding relative to the block container's width */ /* global values */ padding-block-end: inherit; padding-block-end: initial; padding-block-end: unset; values the padding-block-end property takes the same values as the padding-left property.
description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-inline-start, and padding-inline-end, which define the other paddings of the element. formal definition initial value0applies toall elementsinheritednopercentageslogic...
padding-block-start - CSS: Cascading Style Sheets
ngth */ padding-block-start: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-block-start: 5%; /* a padding relative to the block container's width */ /* global values */ padding-block-start: inherit; padding-block-start: initial; padding-block-start: unset; values the padding-block-start property takes the same values as the padding-left property.
description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-end, padding-inline-start, and padding-inline-end, which define the other paddings of the element. formal definition initial value0applies toall elementsinheritednopercentageslogical...
padding-inline-end - CSS: Cascading Style Sheets
absolute length */ padding-inline-end: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-inline-end: 5%; /* a padding relative to the block container's width */ /* global values */ padding-inline-end: inherit; padding-inline-end: initial; padding-inline-end: unset; values the padding-inline-end property takes the same values as the padding-left property.
description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-start, which define the other paddings of the element. formal definition initial value0applies toall elementsinheritednopercentageslogica...
padding-inline-start - CSS: Cascading Style Sheets
gth */ padding-inline-start: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-inline-start: 5%; /* a padding relative to the block container's width */ /* global values */ padding-inline-start: inherit; padding-inline-start: initial; padding-inline-start: unset; values the padding-inline-start property takes the same values as the padding-left property.
description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-end, which define the other paddings of the element. formal definition initial value0applies toall elementsinheritednopercentageslogical-...
padding-inline - CSS: Cascading Style Sheets
ding-inline: 5% 2%; /* relative to the nearest block container's width */ /* global values */ padding-inline: inherit; padding-inline: initial; padding-inline: unset; constituent properties this property is a shorthand for the following css properties: padding-inline-end padding-inline-start syntax values the padding-inline property takes the same values as the padding-left property.
description values for this property correspond to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typediscrete formal syntax <'padding-left'>{1,2}...
perspective - CSS: Cascading Style Sheets
e: 3.5em; /* global values */ perspective: inherit; perspective: initial; perspective: unset; values none indicates that no perspective transform is to be applied. <length> a <length> giving the distance from the user to the z=0 plane. it is used to apply a perspective transform to the element and its content. if the value is 0 or a negative number, no perspective transform is applied.
description each 3d element with z>0 becomes larger; each 3d-element with z<0 becomes smaller. the strength of the effect is determined by the value of this property. the parts of the 3d elements that are behind the user — i.e. their z-axis coordinates are greater than the value of the perspective css property — are not drawn. the vanishing point is by default placed at the center of the element, but ...
pointer-events - CSS: Cascading Style Sheets
(i.e., stroke) of the element. the values of the stroke and visibility properties do not affect event processing. all svg only (experimental for html). the element can only be the target of a pointer event when the pointer is over the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. the values of the fill, stroke, and visibility properties do not affect event processing.
description when this property is unspecified, the same characteristics of the visiblepainted value apply to svg content. in addition to indicating that the element is not the target of pointer events, the value none instructs the pointer event to go "through" the element and target whatever is "underneath" that element instead. note that preventing an element from being the target of pointer events by us...
position - CSS: Cascading Style Sheets
ct the position of any other elements. this value always creates a new stacking context. note that a sticky element "sticks" to its nearest ancestor that has a "scrolling mechanism" (created when overflow is hidden, scroll, auto, or overlay), even if that ancestor isn't the nearest actually scrolling ancestor. this effectively inhibits any "sticky" behavior (see the github issue on w3c csswg).
description types of positioning a positioned element is an element whose computed position value is either relative, absolute, fixed, or sticky. (in other words, it's anything except static.) a relatively positioned element is an element whose computed position value is relative. the top and bottom properties specify the vertical offset from its normal position; the left and right properties specify th...
repeating-conic-gradient() - CSS: Cascading Style Sheets
defining how the gradient progresses between adjacent color stops. the length defines at which point between two color stops the gradient color should reach the midpoint of the color transition. if omitted, the midpoint of the color transition is the midpoint between two color stops. note: rendering of color stops in css gradients follows the same rules as color stops in svg gradients.
description example repeating conic gradients include starbursts. the result of the repeating-conic-gradient() function is an object of the <gradient> data type, which is a special kind of <image>. if neither the first nor the last color stops include include a a color stop angle greater than 0deg or less than 360 degrees respectively, the conic-gradient will not repeat. as with any gradient, a repeating-...
repeating-radial-gradient() - CSS: Cascading Style Sheets
igin. if unspecified, it defaults to center. <shape> the gradient's shape. the value can be circle (meaning that the gradient's shape is a circle with constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). if unspecified, it defaults to ellipse. <extent-keyword> a keyword describing how big the ending shape must be. the possible values are: keyword
description closest-side the gradient's ending shape meets the side of the box closest to its center (for circles) or meets both the vertical and horizontal sides closest to the center (for ellipses). closest-corner the gradient's ending shape is sized so that it exactly meets the closest corner of the box from its center. farthest-side similar to closest-side,...
right - CSS: Cascading Style Sheets
ents, the distance of the element from its normal position is based on the left property; or if left is also auto, the element is not moved horizontally at all. inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block). this computed value is then handled as if it were a <length>, <percentage>, or the auto keyword.
description the effect of right depends on how the element is positioned (i.e., the value of the position property): when position is set to absolute or fixed, the right property specifies the distance between the element's right edge and the right edge of its containing block. when position is set to relative, the right property specifies the distance the element's right edge is moved to the left from ...
scroll-margin-block - CSS: Cascading Style Sheets
property is a shorthand for the following css properties: scroll-margin-block-end scroll-margin-block-start syntax /* <length> values */ scroll-margin-block: 10px; scroll-margin-block: 1em .5em ; /* global values */ scroll-margin-block: inherit; scroll-margin-block: initial; scroll-margin-block: unset; values <length> an outset from the corresponding edge of the scroll container.
description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets. formal definition initial value0applies toall elementsinheritedno...
scroll-margin-inline - CSS: Cascading Style Sheets
ty is a shorthand for the following css properties: scroll-margin-inline-end scroll-margin-inline-start syntax /* <length> values */ scroll-margin-inline: 10px; scroll-margin-inline: 1em .5em ; /* global values */ scroll-margin-inline: inherit; scroll-margin-inline: initial; scroll-margin-inline: unset; values <length> an outset from the corresponding edge of the scroll container.
description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets. formal definition initial value0applies toall elementsinheritedno...
scroll-margin - CSS: Cascading Style Sheets
ty is a shorthand for the following css properties: scroll-margin-bottom scroll-margin-left scroll-margin-right scroll-margin-top syntax /* <length> values */ scroll-margin: 10px; scroll-margin: 1em .5em 1em 1em; /* global values */ scroll-margin: inherit; scroll-margin: initial; scroll-margin: unset; values <length> an outset from the corresponding edge of the scroll container.
description you can see the effect of scroll-margin by scrolling to a point partway between two of the "pages" of the example's content. the value specified for scroll-margin determines how much of the page that's primarily outside the snapport should remain visible. thus, the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. the scroll...
text-emphasis-position - CSS: Cascading Style Sheets
* global values */ text-emphasis-position: inherit; text-emphasis-position: initial; text-emphasis-position: unset; syntax values over draw marks over the text in horizontal writing mode. under draw marks under the text in horizontal writing mode. right draws marks to the right of the text in vertical writing mode. left draw marks to the left of the text in vertical writing mode.
description the preferred position of emphasis marks depends on the language. in japanese for example, the preferred position is over right. in chinese, on the other hand, the preferred position is under right. the informative table below summarizes the preferred emphasis mark positions for chinese, mongolian and japanese: preferred emphasis mark and ruby position language preferred position ...
<transform-function> - CSS: Cascading Style Sheets
ne. skewx() skews an element in the horizontal direction. skewy() skews an element in the vertical direction. translation (moving) translate() translates an element on the 2d plane. translate3d() translates an element in 3d space. translatex() translates an element horizontally. translatey() translates an element vertically. translatez() translates an element along the z-axis.
description various coordinate models can be used to describe an html element's size and shape, as well as any transformations applied to it. the most common is the cartesian coordinate system, although homogeneous coordinates are also sometimes used. cartesian coordinates in the cartesian coordinate system, a two-dimensional point is described using two values: an x coordinate (abscissa) and a y coordi...
transition - CSS: Cascading Style Sheets
r one <single-transition-timing-function> value representing the timing function to use zero, one, or two <time> values. the first value that can be parsed as a time is assigned to the transition-duration, and the second value that can be parsed as a time is assigned to transition-delay. see how things are handled when lists of property values aren't the same length. in short, extra transition
descriptions beyond the number of properties actually being animated are ignored. formal definition initial valueas each of the properties of the shorthand:transition-delay: 0stransition-duration: 0stransition-property: alltransition-timing-function: easeapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas each of the properties of the shorthand:transition-delay: as speci...
Event reference
the wheel button of a pointing device is rotated. mozaudioavailable event mozilla specific the audio buffer is full and the corresponding raw samples are available. mozbeforeresize mozilla specific a window is about to be resized. mozbrowseractivitydone firefox os browser api-specific sent when some activity has been completed (complete
description tbd.) mozbrowserasyncscroll firefox os browser api-specific sent when the scroll position within a browser <iframe> changes. mozbrowseraudioplaybackchange firefox os browser api-specific sent when audio starts or stops playing within the browser <iframe> content. mozbrowsercaretstatechanged firefox os browser api-specific sent when the text...
Getting Started - Developer guides
. to mitigate this problem, you could wrap your if...then statement in a try...catch: function alertcontents() { try { if (httprequest.readystate === xmlhttprequest.done) { if (httprequest.status === 200) { alert(httprequest.responsetext); } else { alert('there was a problem with the request.'); } } } catch( e ) { alert('caught exception: ' + e.
description); } } step 4 – working with the xml response in the previous example, after receiving the response to the http request we used the request object's responsetext property , which contained the contents of the test.html file. now let's try the responsexml property. first off, let's create a valid xml document that we'll request later on. the document (test.xml) contains the following: <?xm...
Setting up adaptive streaming media sources - Developer guides
oken into segments and placed in appropriate server folders — we have to provide our media players with a link to lookup files or playlists specifying the name and location of these stream folders. mpeg-dash encoding mpeg-dash is an adaptive bitrate streaming technique that enables streaming of media content over the internet delivered from conventional http web servers. a media presentation
description (mpd) file is used to hold the information on the various streams and the bandwidths they are associated with. in your video source (src) attribute you point to the mpd instead of to the media file as you would with non-adaptive media. the mpd file tells the browser where the various pieces of media are located, it also includes meta data such as mimetype and codecs and there are other details s...
Audio and Video Delivery - Developer guides
aelement.currenttime = 122; // seek to 122 seconds mediaelement.played.end(0); // returns the number of seconds the browser has played specifying playback range when specifying the uri of media for an <audio> or <video> element, you can optionally include additional information to specify the portion of the media to play. to do this, append a hash mark ("#") followed by the media fragment
description. a time range is specified using the syntax: #t=[starttime][,endtime] the time can be specified as a number of seconds (as a floating-point value) or as an hours/minutes/seconds time separated with colons (such as 2:05:01 for 2 hours, 5 minutes, and 1 second). a few examples: http://example.com/video.ogv#t=10,20 specifies that the video should play the range 10 seconds through 20 seconds.
Media events - Developer guides
canplay sent when enough data is available that the media can be played, at least for a couple of frames. this corresponds to the have_future_data readystate. ...
HTML5 Parser - Developer guides
ew parser introduces these major improvements: you can now use svg and mathml inline in html5 pages, without xml namespace syntax. parsing is now done in a separate thread from firefox’s main ui thread, improving overall browser responsiveness. calls to innerhtml are a lot faster. dozens of long-standing parser related bugs are now fixed. the html5 specification provides a more detailed
description than previous html standards of how to turn a stream of bytes into a dom tree. this will result in more consistent behavior across browser implementations. in other words, in supporting html5, gecko, webkit, and internet explorer (ie) will behave more consistently with each other. changed parser behaviors some changes to the way that the gecko 2 parser behaves, as compared to earlier versions o...
HTML attribute: capture - HTML: Hypertext Markup Language
ld be used to capture that new media of a type defined by the accept attribute. values include user and environment. the capture attribute is supported on the file input type. the capture attribute takes as it's value a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types. value
description user the user-facing camera and/or microphone should be used. environment the outward-facing camera and/or microphone should be used note: capture was previously a boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input. examples when set on a file inpu...
HTML attribute: crossorigin - HTML: Hypertext Markup Language
ors, defining how the element handles crossorigin requests, thereby enabling the configuration of the cors requests for the element's fetched data. depending on the element, the attribute can be a cors settings attribute. the crossorigin content attribute on media elements is a cors settings attribute. these attributes are enumerated, and have the following possible values: keyword
description anonymous cors requests for this element will have the credentials flag set to 'same-origin'. use-credentials cors requests for this element will have the credentials flag set to 'include'. "" setting the attribute name to an empty value, like crossorigin or crossorigin="", is the same as anonymous. by default (that is, when the attribute is not specifie...
HTML attribute: pattern - HTML: Hypertext Markup Language
tory text nearby. some of the input types supporting the pattern attribute, notably the email and url input types, have expected value syntaxes that must be matched. if the pattern attribute isn't present, and the value doesn't match the expected syntax for that value type, the validitystate object's read-only typemismatch property will be true. usability when including a pattern, provide a
description of the pattern in visible text near the control. additionally, include a title attribute which gives a
description of the pattern. user agents may use the title contents during constraint validation to tell the user that the pattern is not matched. some browsers show a tooltip with title contents, improving usability for sighted users. additionally, assistive technology may read the title aloud w...
Block-level elements - HTML: Hypertext Markup Language
teractive content. elements the following is a complete list of all html "block-level" elements (although "block-level" is not technically defined for elements that are new in html5). <address> contact information. <article> article content. <aside> aside content. <blockquote> long ("block") quotation. <details> disclosure widget. <dialog> dialog box. <dd> describes a term in a
description list. <div> document division. <dl>
description list. <dt>
description list term. <fieldset> field set label. <figcaption> figure caption. <figure> groups media content with a caption (see <figcaption>). <footer> section or page footer. <form> input form. <h1>, <h2>, <h3>, <h4>, <h5>, <h6> heading levels 1-6. <header> section or page header. <hgroup> groups header informatio...
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
odify your web page to point to the dash manifest first, instead of directly to a particular video file: <video> <source src="movie.mpd"> <source src="movie.webm"> your browser does not support the video tag. </video> that's it! if dash is supported by the browser, your video will now stream adaptively. links webm dash specification at the webm project dash industry forum webm project
description of how to create dash files with ffmpeg ...
Date and time formats used in HTML - HTML: Hypertext Markup Language
-01t00:00:01-04:00 1 second past midnight eastern standard time (est) on january 1, 1901 [details] basics before looking at the various formats of date and time related strings used by html elements, it is helpful to understand a few fundamental facts about the way they're defined. html uses a variation of the iso 8601 standard for its date and time strings. it's worth reviewing the
descriptions of the formats you're using in order to ensure that your strings are in fact compatible with html, as the html specification includes algorithms for parsing these strings that is actually more precise than iso 8601, so there can be subtle differences in how date and time strings are expected to look. character set dates and times in html are always strings which use the ascii character set. y...
<a>: The Anchor element - HTML: Hypertext Markup Language
eventlistener('click', event => event.target.href = canvas.todataurl() ); result security and privacy <a> elements can have consequences for users’ security and privacy. see referer header: privacy and security concerns for information. using target="_blank" without rel="noreferrer" and rel="noopener" makes the website vulnerable to window.opener api exploitation attacks (vulnerability
description), although note that, in newer browser versions (e.g. firefox 79+) setting target="_blank" implicitly provides the same protection as setting rel="noopener". accessibility strong link text the content inside a link should indicate where the link goes, even out of context. inaccessible, weak link text a sadly common mistake is to only link the words “click here” or “here”: <p> lear...
<area> - HTML: Hypertext Markup Language
lue is x,y,r where x,y is a pair specifying the center of the circle and r is a value for the radius. poly or polygon: the value is a set of x,y pairs for each point in the polygon: x1,y1,x2,y2,x3,y3, and so on. the values are numbers of css pixels. download this attribute, if present, indicates that the author intends the hyperlink to be used for downloading a resource. see <a> for a full
description of the download attribute. href the hyperlink target for the area. its value is a valid url. this attribute may be omitted; if so, the <area> element does not represent a hyperlink. hreflang indicates the language of the linked resource. allowed values are determined by bcp47. use this attribute only if the href attribute is present. ping contains a space-separated list of urls to which, wh...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
upported: <audio controls> <source src="myaudio.mp3" type="audio/mpeg"> <source src="myaudio.ogg" type="audio/ogg"> <p> your browser doesn't support html5 audio. here is a <a href="myaudio.mp4">link to download the audio</a> instead. </p> </audio> mdn adding captions and subtitles to html5 video web video text tracks format (webvtt) webaim: captions, transcripts, and audio
descriptions mdn understanding wcag, guideline 1.2 explanations understanding success criterion 1.2.1 | w3c understanding wcag 2.0 understanding success criterion 1.2.2 | w3c understanding wcag 2.0 technical summary content categories flow content, phrasing content, embedded content. if it has a controls attribute: interactive content and palpable content. permitted content if t...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
should not use them in new content, and try to remove them from existing content. align the alignment of this element with respect to the surrounding context. frameborder the value 1 (the default) draws a border around this frame. the value 0 removes the border around this frame, but you should instead use the css property border to control <iframe> borders. longdesc a url of a long
description of the frame's content. due to widespread misuse, this is not helpful for non-visual browsers. marginheight the amount of space in pixels between the frame's content and its top and bottom borders. marginwidth the amount of space in pixels between the frame's content and its left and right borders. scrolling indicates when the browser should provide a scrollbar for the frame: auto...
<input type="checkbox"> - HTML: Hypertext Markup Language
bmitted to the server at all. if you wanted to submit a default value for the checkbox when it is unchecked, you could include an <input type="hidden"> inside the form with the same name and value, generated by javascript perhaps. ...
<input type="hidden"> - HTML: Hypertext Markup Language
tools. important: while the value isn't displayed to the user in the page's content, it is visible—and can be edited—using any browser's developer tools or "view source" functionality. do not rely on hidden inputs as a form of security. additional attributes in addition to the attributes common to all <input> elements, hidden inputs offer the following attributes: attribute
description name like all input types, the name of the input to report when submitting the form; the special value _charset_ causes the hidden input's value to be reported as the character encoding used to submit the form name this is actually one of the common attributes, but it has a special meaning available for hidden inputs. normally, the name attribute functions on hidden inputs...
<input type="radio"> - HTML: Hypertext Markup Language
t entry of data) { output = output + entry[0] + "=" + entry[1] + "\r"; }; log.innertext = output; event.preventdefault(); }, false); try this example out and see how there's never more than one result for the contact group. additional attributes in addition to the common attributes shared by all <input> elements, radio inputs support the following attributes: attribute
description checked a boolean indicating whether or not this radio button is the currently-selected item in the group value the string to use as the value of the radio when submitting the form, if the radio is currently toggled on checked a boolean attribute which, if present, indicates that this radio button is the currently selected one in the group. unlike other browse...
<input type="submit"> - HTML: Hypertext Markup Language
l have a default label, chosen by the user agent. this label is likely to be something along the lines of "submit" or "submit query." here's an example of a submit button with a default label in your browser: <input type="submit"> additional attributes in addition to the attributes shared by all <input> elements, submit button inputs support the following attributes: attribute
description formaction the url to which to submit the form's data; overrides the form's action attribute, if any formenctype a string specifying the encoding type to use for the form data formmethod the http method (get or post) to use when submitting the form. formnovalidate a boolean which, if present, means the form's fields will not be subjected to cons...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
choose the "new document" option in the "file" menu using html that looks like this: <p>to create a new file, choose the menu option <kbd><kbd><samp>file</samp></kbd>⇒<kbd><samp>new document</samp></kbd></kbd>.</p> <p>don't forget to click the <kbd><samp>ok</samp></kbd> button to confirm once you've entered the name of the new file.</p> this does some interesting nesting. for the menu option
description, the entire input is enclosed in a <kbd> element. then, inside that, both the menu and menu item names are contained within both <kbd> and <samp>, indicating an input which is selected from a screen widget. result specifications specification status comment html living standardthe definition of '<kbd>' in that specification. living standard html5t...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
ion. see subresource integrity. media this attribute specifies the media that the linked resource applies to. its value must be a media type / media query. this attribute is mainly useful when linking to external stylesheets — it allows the user agent to pick the best adapted one for the device it runs on. notes: in html 4, this can only be a simple white-space-separated list of media
description literals, i.e., media types and groups, where defined and allowed as values for this attribute, such as print, screen, aural, braille. html5 extended this to any kind of media queries, which are a superset of the allowed values of html 4. browsers not supporting css3 media queries won't necessarily recognize the adequate link; do not forget to set fallback links, the restricted set of media que...
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
contains a non-negative integer value that indicates for how many rows the cell extends. its default value is 1; if its value is set to 0, it extends until the end of the table section (<thead>, <tbody>, <tfoot>, even if implicitly defined), that the cell belongs to. values higher than 65534 are clipped down to 65534. deprecated attributes abbr this attribute contains a short abbreviated
description of the cell's content. some user-agents, such as speech readers, may present this
description before the content itself. note: do not use this attribute as it is obsolete in the latest standard. alternatively, you can put the abbreviated
description inside the cell and place the long content in the title attribute. align this enumerated attribute specifies how the cell content's horizontal...
<th> - HTML: Hypertext Markup Language
ly followed by a <th> or <td> element or if there are no more data in its parent element. permitted parents a <tr> element. implicit aria role columnheader or rowheader permitted aria roles any dom interface htmltableheadercellelement attributes this element includes the global attributes. abbr this attribute contains a short abbreviated
description of the cell's content. some user-agents, such as speech readers, may present this
description before the content itself. colspan this attribute contains a non-negative integer value that indicates for how many columns the cell extends. its default value is 1. values higher than 1000 will be considered as incorrect and will be set to the default value (1). headers this attribute contains a lis...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
s it has been deprecated; use the css list-style-type property instead. usage notes the <ul> element is for grouping a collection of items that do not have a numerical ordering, and their order in the list is meaningless. typically, unordered-list items are displayed with a bullet, which can be of several forms, like a dot, a circle, or a square. the bullet style is not defined in the html
description of the page, but in its associated css, using the list-style-type property. the <ul> and <ol> elements may be nested as deeply as desired. moreover, the nested lists may alternate between <ol> and <ul> without restriction. the <ol> and <ul> elements both represent a list of items. they differ in that, with the <ol> element, the order is meaningful. as a rule of thumb to determine which one to u...
<video>: The Video Embed element - HTML: Hypertext Markup Language
ispering] what's that off in the distance? 16 00:03:22 --> 00:03:24 it's… it's a… 16 00:03:25 --> 00:03:32 [loud thumping] [dishes clattering] captions should not obstruct the main subject of the video. they can be positioned using the align vtt cue setting. mdn adding captions and subtitles to html5 video web video text tracks format (webvtt) webaim: captions, transcripts, and audio
descriptions mdn understanding wcag, guideline 1.2 explanations understanding success criterion 1.2.1 | w3c understanding wcag 2.0 understanding success criterion 1.2.2 | w3c understanding wcag 2.0 technical summary content categories flow content, phrasing content, embedded content. if it has a controls attribute: interactive content and palpable content. permitted content ...
hidden - HTML: Hypertext Markup Language
elements can still submit. elements and scripts may, however, refer to elements that are hidden in other contexts. for example, it would be incorrect to use the href attribute to link to a section marked with the hidden attribute. if the content is not applicable or relevant, then there is no reason to link to it. it would be fine, however, to use the aria aria-describedby attribute to refer to
descriptions that are themselves hidden. while hiding the
descriptions implies that they are not useful on their own, they could be written in such a way that they are useful in the specific context of being referenced from the element that they describe. similarly, a canvas element with the hidden attribute could be used by a scripted graphics engine as an off-screen buffer, and a form control could refer ...
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
the doctype, like a comment or an xml declaration will trigger quirks mode in internet explorer 9 and older. in html5, the only purpose of the doctype is to activate full standards mode. older versions of the html standard gave additional meaning to the doctype, but no browser has ever used the doctype for anything other than switching between quirks mode and standards mode. see also a detailed
description of when different browsers choose various modes. xhtml if you serve your page as xhtml using the application/xhtml+xml mime type in the content-type http header, you do not need a doctype to enable standards mode, as such documents always use full standards mode. note however that serving your pages as application/xhtml+xml will cause internet explorer 8 to show a download dialog box for an unk...
Using the application cache - HTML: Hypertext Markup Language
ed by zero or more characters of comment text. comments may only be used on their own lines (after the initial cache manifest line), and cannot be appended to other lines. this means that you cannot specify fragment identifiers. section header section headers specify which section of the cache manifest is being manipulated. there are three possible section headers: section header
description cache: switches to the explicit section of the cache manifest (this is the default section). network: switches to the online whitelist section of the cache manifest. fallback: switches to the fallback section of the cache manifest. the section header line may include whitespaces, but must include the colon (:) in the section name. section data the f...
Evolution of HTTP - HTTP
ted to the server). get /mypage.html the response is extremely simple too: it only consisted of the file itself. <html> a very simple html page </html> unlike subsequent evolutions, there were no http headers, meaning that only html files could be transmitted, but no other type of documents. there were no status or error codes: in case of a problem, a specific html file was send back with the
description of the problem contained in it, for human consumption. http/1.0 – building extensibility http/0.9 was very limited and both browsers and servers quickly extended it to be more versatile: versioning information is now sent within each request (http/1.0 is appended to the get line) a status code line is also sent at the beginning of the response, allowing the browser itself to understand th...
Identifying resources on the Web - HTTP
tocol http:// is the protocol. it indicates which protocol the browser must use. usually it is the http protocol or its secured version, https. the web requires one of these two, but browsers also know how to handle other protocols such as mailto: (to open a mail client) or ftp: to handle file transfer, so don't be surprised if you see such protocols. ...
MIME types (IANA media types) - HTTP
audio and video types as is the case for images, html doesn't mandate that web browsers support any specific file and codec types for the <audio> and <video> elements, so it's important to consider your ta...
Content Security Policy (CSP) - HTTP
ng the policy directives describing your content security policy. writing a policy a policy is described using a series of policy directives, each of which describes the policy for a certain resource type or policy area. your policy should include a default-src policy directive, which is a fallback for other resource types when they don't have policies of their own (for a complete list, see the
description of the default-src directive). a policy needs to include a default-src or script-src directive to prevent inline scripts from running, as well as blocking the use of eval(). a policy needs to include a default-src or style-src directive to restrict inline styles from being applied from a <style> element or a style attribute. there are specific directives for a wide variety of types of items, so t...
Index - HTTP
r is sent from server to client to inform that server is willing to initiate a websocket connection. 98 server http, reference, header the server header contains information about the software used by the origin server to handle the request. 99 server-timing http, performance, reference, header the server-timing header communicates one or more metrics and
descriptions for a given request-response cycle. it is used to surface any backend server timing metrics (e.g. database read/write, cpu time, file system access, etc.) in the developer tools in the user's browser or in the performanceservertiming interface. 100 set-cookie cookies, http, reference, response, header the set-cookie http response header is used to send cookies from the serve...
Proxy-Authenticate - HTTP
wing it to transmit the request further. the proxy-authenticate header is sent along with a 407 proxy authentication required. header type response header forbidden header name no syntax proxy-authenticate: <type> realm=<realm> directives <type> authentication type. a common type is "basic". iana maintains a list of authentication schemes. realm=<realm> a
description of the protected area, the realm. if no realm is specified, clients often display a formatted host name instead. examples proxy-authenticate: basic proxy-authenticate: basic realm="access to the internal site" specifications specification title rfc 7235, section 4.3: proxy-authenticate http/1.1: authentication rfc 7617 the 'basic' http authentication sch...
Strict-Transport-Security - HTTP
<expire-time>; preload directives max-age=<expire-time> the time, in seconds, that the browser should remember that a site is only to be accessed using https. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. preload optional see preloading strict transport security for details. not part of the specification.
description if a website accepts a connection through http and redirects to https, visitors may initially communicate with the non-encrypted version of the site before being redirected, if, for example, the visitor types http://www.foo.com/ or even just foo.com. this creates an opportunity for a man-in-the-middle attack. the redirect could be exploited to direct visitors to a malicious site instead of the s...
WWW-Authenticate - HTTP
sed to gain access to a resource. the www-authenticate header is sent along with a 401 unauthorized response. header type response header forbidden header name no syntax www-authenticate: <type> realm=<realm>[, charset="utf-8"] directives <type> authentication type. a common type is "basic". iana maintains a list of authentication schemes. realm=<realm> a
description of the protected area. if no realm is specified, clients often display a formatted hostname instead. charset=<charset> tells the client the server's prefered encoding scheme when submitting a username and password. the only allowed value is the case insensitive string "utf-8". this does not relate to the encoding of the realm string. examples typically, a server response contains a www-authe...
Warning - HTTP
the name or pseudonym of the server or software adding the warning header (might be "-" when the agent is unknown). <warn-text> advisory text describing the error. <warn-date> optional. if more than one warning header is sent, include a date that matches the date header. warning codes the http warn codes registry at iana.org defines the namespace for warn codes. code text
description 110 response is stale a response provided by a cache is stale (the expiration time set for it has passed). 111 revalidation failed an attempt to validate the response failed, due to an inability to reach the server. 112 disconnected operation the cache is disconnected from the rest of the network. 113 heuristic expiration sent if a c...
X-DNS-Prefetch-Control - HTTP
r forbidden header name no syntax x-dns-prefetch-control: on x-dns-prefetch-control: off directives on enables dns prefetching. this is what browsers do, if they support the feature, when this header is not present off disables dns prefetching. this is useful if you don't control the link on the pages, or know that you don't want to leak information to these domains.
description dns requests are very small in terms of bandwidth, but latency can be quite high, especially on mobile networks. by speculatively prefetching dns results, latency can be reduced significantly at certain times, such as when the user clicks the link. in some cases, latency can be reduced by a second. the implementation of this prefetching in some browsers allows domain name resolution to occur in...
HTTP headers - HTTP
ing a follow-up request. signature the signature header field conveys a list of signatures for an exchange, each one accompanied by information about how to determine the authority of and refresh that signature. signed-headers the signed-headers header field identifies an ordered list of response header fields to include in a signature. server-timing communicates one or more metrics and
descriptions for the given request-response cycle. service-worker-allowed used to remove the path restriction by including this header in the response of the service worker script. sourcemap links generated code to a source map. upgrade the relevant rfc document for the upgrade header field is rfc 7230, section 6.7. the standard establishes rules for upgrading or changing to a different protocol on the...
HTTP Messages - HTTP
erent bit of information. this is typically associated with html forms. http responses status line the start line of an http response, called the status line, contains the following information: the protocol version, usually http/1.1. a status code, indicating success or failure of the request. common status codes are 200, 404, or 302 a status text. a brief, purely informational, textual
description of the status code to help a human understand the http message. a typical status line looks like: http/1.1 404 not found. headers http headers for responses follow the same structure as any other header: a case-insensitive string followed by a colon (':') and a value whose structure depends upon the type of the header. the whole header, including its value, presents as a single line. there a...
PATCH - HTTP
ats accepted by the server. request has body yes successful response has body yes safe no idempotent no cacheable no allowed in html forms no syntax patch /file.txt http/1.1 example request patch /file.txt http/1.1 host: www.example.com content-type: application/example if-match: "e0023aa4e" content-length: 100 [
description of changes] response a successful response is indicated by any 2xx status code. in the example below a 204 response code is used, because the response does not carry a payload body. a 200 response could have contained a payload body. http/1.1 204 no content content-location: /file.txt etag: "e0023aa4f" specifications specification title rfc 5789: patch patch meth...
HTTP
t. for instance, an html page from domain a (http://domaina.example/) makes a request for an image on domain b (http://domainb.foo/image.jpg) via the img element. web pages today very commonly load cross-site resources, including css stylesheets, images, scripts, and other resources. cors allows web developers to control how their site reacts to cross-site requests. evolution of http a brief
description of the changes between the early versions of http, to the modern http/2, the emergent http/3 and beyond. mozilla web security guidelines a collection of tips to help operational teams with creating secure web applications. http messages describes the type and structure of the different kind of messages of http/1.x and http/2. a typical http session shows and explains the flow of a usual ...
A re-introduction to JavaScript (JS tutorial) - JavaScript
y of iterating over an array that was added with ecmascript 5 is foreach(): ['dog', 'cat', 'hen'].foreach(function(currentvalue, index, array) { // do something with currentvalue or array[index] }); if you want to append an item to an array simply do it like this: a.push(item); arrays come with a number of methods. see also the full documentation for array methods. method name
description a.tostring() returns a string with the tostring() of each element separated by commas. a.tolocalestring() returns a string with the tolocalestring() of each element separated by commas. a.concat(item1[, item2[, ...[, itemn]]]) returns a new array with the items added on to it. a.join(sep) converts the array to a string — with values delimited ...
Indexed collections - JavaScript
ontents of the buffer. typed array views typed array views have self descriptive names and provide views for all the usual numeric types like int8, uint32, float64 and so forth. there is one special typed array view, {jsxref("uint8clampedarray")}}, which clamps the values between 0 and 255. this is useful for canvas data processing, for example. ...
Introduction - JavaScript
ent standards-compliant language features in your ecmascript implementation or engine (such as spidermonkey in firefox, or v8 in chrome). the ecmascript document is not intended to help script programmers. use the javascript documentation for information when writing scripts. the ecmascript specification uses terminology and syntax that may be unfamiliar to a javascript programmer. although the
description of the language may differ in ecmascript, the language itself remains the same. javascript supports all functionality outlined in the ecmascript specification. the javascript documentation describes aspects of the language that are appropriate for a javascript programmer. getting started with javascript getting started with javascript is easy: all you need is a modern web browser. this guide i...
Text formatting - JavaScript
ode standard. (examples should be added to this page after mdn bug 857438 is fixed.) see also string.fromcodepoint() or string.prototype.codepointat(). a string object has a variety of methods: for example those that return a variation on the string itself, such as substring and touppercase. the following table summarizes the methods of string objects. methods of string method
description charat, charcodeat, codepointat return the character or character code at the specified position in string. indexof, lastindexof return the position of specified substring in the string or last position of specified substring, respectively. startswith, endswith, includes returns whether or not the string starts, ends or contains a specified string. ...
JavaScript language resources - JavaScript
ecmascript is the scripting language that forms the basis of javascript. ecmascript standardized by the ecma international standards organization in the ecma-262 and ecma-402 specifications. ...
constructor - JavaScript
the constructor method is a special method of a class for creating and initializing an object of that class. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax constructor([arguments]) { ... }
description a constructor enables you to provide any custom initialization that must be done before any other methods can be called on an instantiated object. class person { constructor(name) { this.name = name; } introduce() { console.log(`hello, my name is ${this.name}`); } } const otto = new person('otto'); otto.introduce(); if you don't provide your own constructor, then a default constructor will be...
extends - JavaScript
xtends keyword is used in class declarations or class expressions to create a class that is a child of another class. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax class childclass extends parentclass { ... }
description the extends keyword can be used to subclass custom classes as well as built-in objects. the .prototype of the extension must be an object or null. examples using extends the first example creates a class called square from a class called polygon. this example is extracted from this live demo (source). class square extends polygon { constructor(length) { // here, it calls the parent cl...
SyntaxError: invalid regular expression flag "x" - JavaScript
sh. they can also be defined in the constructor function of the regexp object (second parameter). regular expression flags can be used separately or together in any order, but there are only six of them in ecmascript. to include a flag with the regular expression, use this syntax: var re = /pattern/flags; or var re = new regexp('pattern', 'flags'); regular expression flags flag
description g global search. i case-insensitive search. m multi-line search. s allow . to match newlines (added in ecmascript 2018) u unicode; treat pattern as a sequence of unicode code points y perform a "sticky" search that matches starting at the current position in the target string. see sticky examples there are only si...
Arrow function expressions - JavaScript
two factors influenced the introduction of arrow functions: the need for shorter functions and the behavior of the this keyword. shorter functions var elements = [ 'hydrogen', 'helium', 'lithium', 'beryllium' ]; // this statement returns the array: [8, 6, 7, 9] elements.map(function(element) { return element.length; });...
Default parameters - JavaScript
tialized with default values if no value or undefined is passed. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax function [name]([param1[ = defaultvalue1 ][, ..., paramn[ = defaultvaluen ]]]) { statements }
description in javascript, function parameters default to undefined. however, it's often useful to set a different default value. this is where default parameters can help. in the past, the general strategy for setting defaults was to test parameter values in the function body and assign a value if they are undefined. in the following example, if no value is provided for b when multiply is called, b's val...
Method definitions - JavaScript
given the following code: const obj = { foo: function() { // ... }, bar: function() { // ... } } you are now able to shorten this to: const obj = { foo() { // ... }, bar() { // ... } } generator methods generator methods can be defined using the shorthand syntax...
arguments.callee - JavaScript
it can be used to refer to the currently executing function inside the function body of that function. this is useful when the name of the function is unknown, such as within a function expression with no name (also called "anonymous functions"). warning: the 5th edition of ecmascript (es5) forbids use of arguments.callee() in strict mode. avoid using arguments.callee() by either giving function expressions a name or use a function declaration where a function must call itself. ...
arguments.length - JavaScript
this can be more or less than the defined parameter's count (see function.length). examples using arguments.length in this example we define a function that can add two or more numbers together. function adder(base /*, n2, ... ...
The arguments object - JavaScript
arguments is an array-like object accessible inside functions that contains the values of the arguments passed to that function. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description note: if you're writing es6 compatible code, then rest parameters should be preferred. note: “array-like” means that arguments has a length property and properties indexed from zero, but it doesn't have array's built-in methods like foreach() or map(). see §
description for details. the arguments object is a local variable available within all non-arrow functions. you can refer to a function's arguments inside that function by...
getter - JavaScript
bute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax {get prop() { ... } } {get [expression]() { ... } } parameters prop the name of the property to bind to the given function. expression starting with ecmascript 2015, you can also use expressions for a computed property name to bind to the given function.
description sometimes it is desirable to allow access to a property that returns a dynamically computed value, or you may want to reflect the status of an internal variable without requiring the use of explicit method calls. in javascript, this can be accomplished with the use of a getter. it is not possible to simultaneously have a getter bound to a property and have that property actually hold a value, a...
Rest parameters - JavaScript
the rest parameter syntax allows us to represent an indefinite number of arguments as an array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax function f(a, b, ...theargs) { // ... }
description a function's last parameter can be prefixed with ... which will cause all remaining (user supplied) arguments to be placed within a "standard" javascript array. only the last parameter can be a "rest parameter". function myfun(a, b, ...manymoreargs) { console.log("a", a) console.log("b", b) console.log("manymoreargs", manymoreargs) } myfun("one", "two", "three", "four", "five", "six") // console output: // a,...
setter - JavaScript
les and send us a pull request. syntax {set prop(val) { . . . }} {set [expression](val) { . . . }} parameters prop the name of the property to bind to the given function. val an alias for the variable that holds the value attempted to be assigned to prop. expression starting with ecmascript 2015, you can also use expressions for a computed property name to bind to the given function.
description in javascript, a setter can be used to execute a function whenever a specified property is attempted to be changed. setters are most often used in conjunction with getters to create a type of pseudo-property. it is not possible to simultaneously have a setter on a property that holds an actual value. note the following when working with the set syntax: it can have an identifier which is eit...
Functions - JavaScript
dy. values can be passed to a function, and the function will return a value. in javascript, functions are first-class objects, because they can have properties and methods just like any other object. what distinguishes them from other objects is that functions can be called. in brief, they are function objects. for more examples and explanations, see also the javascript guide about functions.
description every function in javascript is a function object. see function for information on properties and methods of function objects. to return a value other than the default, a function must have a return statement that specifies the value to return. a function without a return statement will return a default value. in the case of a constructor called with the new keyword, the default value is the va...
AggregateError() constructor - JavaScript
the aggregateerror() constructor creates an error for several errors that need to be wrapped in a single error. syntax new aggregateerror(errors[, message]) parameters errors an iterable of errors, may not actually be error instances. messageoptional an optional human-readable
description of the aggregate error. examples creating an aggregateerror try { throw new aggregateerror([ new error("some error"), ], 'hello'); } catch (e) { console.log(e instanceof aggregateerror); // true console.log(e.message); // "hello" console.log(e.name); // "aggregateerror" console.log(e.errors); // [ error: "some error" ] } specifications specification promise.anythe definition of 'aggregateerror()' in that s...
get Array[@@species] - JavaScript
subclass constructors may override it to change the constructor assignment. examples species in ordinary objects the species property returns the default constructor function, which is the array constructor for array objects: array[symbol.species]; // function array() species in derived objects in a derived collection object (e.g. your custom array myarray), the myarray species is the myarray constructor. ...
Array.prototype[@@unscopables] - JavaScript
the @@unscopable symbol property contains property names that were not included in the ecmascript standard prior to the es2015 version. these properties are excluded from with statement bindings.
description the default array properties that are excluded from with bindings are: copywithin() entries() fill() find() findindex() includes() keys() values() see symbol.unscopables for how to set unscopables for your own objects. property attributes of array.prototype[@@unscopables] writable no enumerable no configurable yes examples use in with environments the following code works fine in es5 and below. however, in ecmascript 2015 and later, the array.prototype.keys() method was introduced. t...
Array.prototype.reduce() - JavaScript
alled upon. initialvalue optional a value to use as the first argument to the first call of the callback. if no initialvalue is supplied, the first element in the array will be used as the initial accumulator value and skipped as currentvalue. calling reduce() on an empty array without an initialvalue will throw a typeerror. return value the single value that results from the reduction.
description the reduce() method executes the callback once for each assigned value present in the array, taking four arguments: accumulator currentvalue currentindex array the first time the callback is called, accumulator and currentvalue can be one of two values. if initialvalue is provided in the call to reduce(), then accumulator will be equal to initialvalue, and currentvalue will be equal to t...
Array.prototype.reduceRight() - JavaScript
array. arrayoptional the array reduceright() was called upon. initialvalueoptional value to use as accumulator to the first call of the callback. if no initial value is supplied, the last element in the array will be used and skipped. calling reduce or reduceright on an empty array without an initial value creates a typeerror. return value the value that results from the reduction.
description reduceright executes the callback function once for each element present in the array, excluding holes in the array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the array over which iteration is occurring. the call to the reduceright callback would look something like this: array.reduceright(fu...
Array.prototype.concat() - JavaScript
eractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const new_array = old_array.concat([value1[, value2[, ...[, valuen]]]]) parameters valuen optional arrays and/or values to concatenate into a new array. if all valuen parameters are omitted, concat returns a shallow copy of the existing array on which it is called. see the
description below for more details. return value a new array instance.
description the concat method creates a new array consisting of the elements in the object on which it is called, followed in order by, for each argument, the elements of that argument (if the argument is an array) or the argument itself (if the argument is not an array). it does not recurse into nested array arguments. the concat m...
Array.prototype.copyWithin() - JavaScript
om. if negative, start will be counted from the end. if start is omitted, copywithin will copy from index 0. end optional zero-based index at which to end copying elements from. copywithin copies up to but not including end. if negative, end will be counted from the end. if end is omitted, copywithin will copy until the last index (default to arr.length). return value the modified array.
description the copywithin works like c and c++'s memmove, and is a high-performance method to shift the data of an array. this especially applies to the typedarray method of the same name. the sequence is copied and pasted as one operation; pasted sequence will have the copied values even when the copy and paste region overlap. the copywithin function is intentionally generic, it does not require that its...
Array.prototype.every() - JavaScript
three arguments: element the current element being processed in the array. index optional the index of the current element being processed in the array. array optional the array every was called upon. thisarg optional a value to use as this when executing callback. return value true if the callback function returns a truthy value for every array element. otherwise, false.
description the every method executes the provided callback function once for each element present in the array until it finds the one where callback returns a falsy value. if such an element is found, the every method immediately returns false. otherwise, if callback returns a truthy value for all elements, every returns true. caution: calling this method on an empty array will return true for any condit...
Array.prototype.fill() - JavaScript
examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.fill(value[, start[, end]]) parameters value value to fill the array with. (note all elements in the array will be this exact value.) start optional start index, default 0. end optional end index, default arr.length. return value the modified array, filled with value.
description if start is negative, it is treated as array.length + start. if end is negative, it is treated as array.length + end. fill is intentionally generic: it does not require that its this value be an array object. fill is a mutator method: it will change the array itself and return it, not a copy of it. if the first parameter is an object, each slot in the array will reference that object. p...
Array.prototype.filter() - JavaScript
ts: element the current element being processed in the array. indexoptional the index of the current element being processed in the array. arrayoptional the array filter was called upon. thisargoptional value to use as this when executing callback. return value a new array with the elements that pass the test. if no elements pass the test, an empty array will be returned.
description filter() calls a provided callback function once for each element in an array, and constructs a new array of all the values for which callback returns a value that coerces to true. callback is invoked only for indexes of the array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values. array elements which do not pass the callba...
Array.prototype.find() - JavaScript
king 3 arguments: element the current element in the array. index optional the index (position) of the current element in the array. array optional the array that find was called on. thisarg optional object to use as this inside callback. return value the value of the first element in the array that satisfies the provided testing function. otherwise, undefined is returned.
description the find method executes the callback function once for each index of the array until the callback returns a truthy value. if so, find immediately returns the value of that element. otherwise, find returns undefined. callback is invoked for every index of the array, not just those with assigned values. this means it may be less efficient for sparse arrays, compared to methods that only visit as...
Array.prototype.findIndex() - JavaScript
three arguments: element the current element being processed in the array. index optional the index of the current element being processed in the array. array optional the array findindex() was called upon. thisarg optional optional object to use as this when executing callback. return value the index of the first element in the array that passes the test. otherwise, -1.
description the findindex() method executes the callback function once for every index in the array until it finds the one where callback returns a truthy value. if such an element is found, findindex() immediately returns the element's index. if callback never returns a truthy value (or the array's length is 0), findindex() returns -1. edge case alert: unlike other array methods such as array.some(), ca...
Array.prototype.flatMap() - JavaScript
rguments: currentvalue the current element being processed in the array. indexoptional the index of the current element being processed in the array. arrayoptional the array map was called upon. thisargoptional value to use as this when executing callback. return value a new array with each element being the result of the callback function and flattened to a depth of 1.
description see array.prototype.map() for a detailed
description of the callback function. the flatmap method is identical to a map followed by a call to flat of depth 1. alternative reduce() and concat() var arr = [1, 2, 3, 4]; arr.flatmap(x => [x, x * 2]); // is equivalent to arr.reduce((acc, x) => acc.concat([x, x * 2]), []); // [1, 2, 2, 4, 3, 6, 4, 8] note, however, that this is inefficient and s...
Array.prototype.forEach() - JavaScript
)[, thisarg]) parameters callback function to execute on each element. it accepts between one and three arguments: currentvalue the current element being processed in the array. index optional the index currentvalue in the array. array optional the array foreach() was called upon. thisarg optional value to use as this when executing callback. return value undefined.
description foreach() calls a provided callback function once for each element in an array in ascending order. it is not invoked for index properties that have been deleted or are uninitialized. (for sparse arrays, see example below.) callback is invoked with three arguments: the value of the element the index of the element the array object being traversed if a thisarg parameter is provided to fore...
Array.from() - JavaScript
roject, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax array.from(arraylike [, mapfn [, thisarg]]) parameters arraylike an array-like or iterable object to convert to an array. mapfn optional map function to call on every element of the array. thisarg optional value to use as this when executing mapfn. return value a new array instance.
description array.from() lets you create arrays from: array-like objects (objects with a length property and indexed elements); or iterable objects (objects such as map and set). array.from() has an optional parameter mapfn, which allows you to execute a map() function on each element of the array being created. more clearly, array.from(obj, mapfn, thisarg) has the same result as array.from(obj).map(...
Array.prototype.indexOf() - JavaScript
will not be searched. if the provided index value is a negative number, it is taken as the offset from the end of the array. note: if the provided index is negative, the array is still searched from front to back. if the provided index is 0, then the whole array will be searched. default: 0 (entire array is searched). return value the first index of the element in the array; -1 if not found.
description indexof() compares searchelement to elements of the array using strict equality (the same method used by the === or triple-equals operator). note: for the string method, see string.prototype.indexof(). polyfill indexof() was added to the ecma-262 standard in the 5th edition; as such it may not be present in all browsers. you can work around this by utilizing the following code at the begin...
Array.isArray() - JavaScript
the array.isarray() method determines whether the passed value is an array. array.isarray([1, 2, 3]); // true array.isarray({foo: 123}); // false array.isarray('foobar'); // false array.isarray(undefined); // false syntax array.isarray(value) parameters value the value to be checked. return value true if the value is an array; otherwise, false.
description if the value is an array, true is returned; otherwise, false is. see the article “determining with absolute accuracy whether or not a javascript object is an array” for more details. given a typedarray instance, false is always returned. polyfill running the following code before any other code will create array.isarray() if it's not natively available. if (!array.isarray) { array.isarray = function(arg) { return ...
Array.prototype.join() - JavaScript
specifies a string to separate each pair of adjacent elements of the array. the separator is converted to a string if necessary. if omitted, the array elements are separated with a comma (","). if separator is an empty string, all elements are joined without any characters in between them. return value a string with all array elements joined. if arr.length is 0, the empty string is returned.
description the string conversions of all array elements are joined into one string. if an element is undefined, null or an empty array [], it is converted to an empty string. examples joining an array four different ways the following example creates an array, a, with three elements, then joins the array four times: using the default separator, then a comma and a space, then a plus and an empty strin...
Array.prototype.lastIndexOf() - JavaScript
or equal to the length of the array, the whole array will be searched. if negative, it is taken as the offset from the end of the array. note that even when the index is negative, the array is still searched from back to front. if the calculated index is less than 0, -1 is returned, i.e. the array will not be searched. return value the last index of the element in the array; -1 if not found.
description lastindexof compares searchelement to elements of the array using strict equality (the same method used by the ===, or triple-equals, operator). polyfill lastindexof was added to the ecma-262 standard in the 5th edition; as such it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing us...
Array.prototype.length - JavaScript
rray sets or returns the number of elements in that array. the value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the value of the length property is an integer with a positive sign and a value less than 2 to the 32nd power (232). var namelista = new array(4294967296); //2 to the 32nd power = 4294967296 var namelistc = new array(-100) //negative sign console.log(namelista.length); //rangeerror: invalid array length console.log(namelistc.length); //rangeerror: invalid array length var namelistb = []; na...
Array.of() - JavaScript
h property of 7 (note: this implies an array of 7 empty slots, not slots with actual undefined values). array.of(7); // [7] array.of(1, 2, 3); // [1, 2, 3] array(7); // array of 7 empty slots array(1, 2, 3); // [1, 2, 3] syntax array.of(element0[, element1[, ...[, elementn]]]) parameters elementn elements used to create the array. return value a new array instance.
description this function is part of the ecmascript 2015 standard. for more information, see: array.of() array.from() proposal array.of() polyfill polyfill running the following code before any other code will create array.of() if it's not natively available. if (!array.of) { array.of = function() { return array.prototype.slice.call(arguments); // or let vals = []; for(let prop ...
Array.prototype.pop() - JavaScript
turns that element. this method changes the length of the array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arrname.pop() return value the removed element from the array; undefined if the array is empty.
description the pop method removes the last element from an array and returns that value to the caller. pop is intentionally generic; this method can be called or applied to objects resembling arrays. objects which do not contain a length property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meaningful manner. if you call pop() on an empty array, it...
Array.prototype.push() - JavaScript
ample is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.push([element1[, ...[, elementn]]]) parameters elementn the element(s) to add to the end of the array. return value the new length property of the object upon which the method was called.
description the push method appends values to an array. push is intentionally generic. this method can be used with call() or apply() on objects resembling arrays. the push method relies on a length property to determine where to start inserting the given values. if the length property cannot be converted into a number, the index used is 0. this includes the possibility of length being nonexistent, in whic...
Array.prototype.reverse() - JavaScript
reverses an array in place. the first array element becomes the last, and the last array element becomes the first. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax a.reverse() return value the reversed array.
description the reverse method transposes the elements of the calling array object in place, mutating the array, and returning a reference to the array. reverse is intentionally generic; this method can be called or applied to objects resembling arrays. objects which do not contain a length property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meanin...
Array.prototype.shift() - JavaScript
that removed element. this method changes the length of the array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.shift() return value the removed element from the array; undefined if the array is empty.
description the shift method removes the element at the zeroeth index and shifts the values at consecutive indexes down, then returns the removed value. if the length property is 0, undefined is returned. shift is intentionally generic; this method can be called or applied to objects resembling arrays. objects which do not contain a length property reflecting the last in a series of consecutive, zero-based...
Array.prototype.slice() - JavaScript
icating an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence. if end is omitted, slice extracts through the end of the sequence (arr.length). if end is greater than the length of the sequence, slice extracts through to the end of the sequence (arr.length). return value a new array containing the extracted elements.
description slice does not alter the original array. it returns a shallow copy of elements from the original array. elements of the original array are copied into the returned array as follows: for object references (and not the actual object), slice copies object references into the new array. both the original and new array refer to the same object. if a referenced object changes, the changes are visib...
Array.prototype.some() - JavaScript
nts: element the current element being processed in the array. indexoptional the index of the current element being processed in the array. arrayoptional the array some() was called upon. thisargoptional a value to use as this when executing callback. return value true if the callback function returns a truthy value for at least one element in the array. otherwise, false.
description the some() method executes the callback function once for each element present in the array until it finds the one where callback returns a truthy value (a value that becomes true when converted to a boolean). if such an element is found, some() immediately returns true. otherwise, some() returns false. callback is invoked only for indexes of the array with assigned values. it is not invoked for...
Array.prototype.sort() - JavaScript
comparefunction optional specifies a function that defines the sort order. if omitted, the array elements are converted to strings, then sorted according to each character's unicode code point value. firstel the first element for comparison. secondel the second element for comparison. return value the sorted array. note that the array is sorted in place, and no copy is made.
description if comparefunction is not supplied, all non-undefined array elements are sorted by converting them to strings and comparing strings in utf-16 code units order. for example, "banana" comes before "cherry". in a numeric sort, 9 comes before 80, but because numbers are converted to strings, "80" comes before "9" in the unicode order. all undefined elements are sorted to the end of the array. note...
Array.prototype.splice() - JavaScript
ify at least one new element (see below). item1, item2, ... optional the elements to add to the array, beginning from start. if you do not specify any elements, splice() will only remove elements from the array. return value an array containing the deleted elements. if only one element is removed, an array of one element is returned. if no elements are removed, an empty array is returned.
description if the specified number of elements to insert differs from the number of elements being removed, the array's length will be changed. examples remove 0 (zero) elements before index 2, and insert "drum" let myfish = ['angel', 'clown', 'mandarin', 'sturgeon'] let removed = myfish.splice(2, 0, 'drum') // myfish is ["angel", "clown", "drum", "mandarin", "sturgeon"] // removed is [], no elements r...
Array.prototype.toString() - JavaScript
for array objects, the tostring method joins the array and returns one string containing each array element separated by commas. javascript calls the tostring method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. ...
get ArrayBuffer[@@species] - JavaScript
subclass constructors may over-ride it to change the constructor assignment. examples species in ordinary objects the species property returns the default constructor function, which is the arraybuffer constructor for arraybuffer objects: arraybuffer[symbol.species]; // function arraybuffer() species in derived objects in a derived collection object (e.g. your custom array buffer myarraybuffer), the myarraybuffer species is the myarraybuffer constructor. ...
ArrayBuffer.prototype.byteLength - JavaScript
the bytelength accessor property represents the length of an arraybuffer in bytes. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the bytelength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when the array is constructed and cannot be changed. this property returns 0 if this arraybuffer has been detached. examples using bytelength var buffer = new arraybuffer(8); buffer.bytelength; // 8 specifications specification ecmascript (ecma-262)the definition of 'arraybuffer.prototype.bytelength'...
ArrayBuffer.prototype.slice() - JavaScript
ase clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arraybuffer.slice(begin[, end]) parameters begin zero-based byte index at which to begin slicing. end optional byte index before which to end slicing. if end is unspecified, the new arraybuffer contains all bytes from begin to the end of this arraybuffer. return value a new arraybuffer object.
description the slice() method copies up to, but not including, the byte indicated by the end parameter. if either begin or end is negative, it refers to an index from the end of the array, as opposed to from the beginning. the range specified by the begin and end parameters is clamped to the valid index range for the current array. if the computed length of the new arraybuffer would be negative, it is cla...
AsyncFunction - JavaScript
on([arg1[, arg2[, ...argn]],] functionbody) parameters arg1, arg2, ... argn names to be used by the function as formal argument names. each must be a string that corresponds to a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function definition.
description async function objects created with the asyncfunction constructor are parsed when the function is created. this is less efficient than declaring an async function with an async function expression and calling it within your code, because such functions are parsed with the rest of the code. all arguments passed to the function are treated as the names of the identifiers of the parameters in the ...
Atomics.and() - JavaScript
, uint32array, bigint64array, or biguint64array. index the position in the typedarray to compute the bitwise and. value the number to compute the bitwise and with. return value the old value at the given position (typedarray[index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray.
description the bitwise and operation only yields 1, if both a and b are 1. the truth table for the and operation is: a b a & b 0 0 0 0 1 0 1 0 0 1 1 1 for example, a bitwise and of 5 & 1 results in 0001 which is 1 in decimal. 5 0101 1 0001 ---- 1 0001 examples using and() const sab = new sharedarraybuffer(1024)...
Atomics.or() - JavaScript
ay, uint32array, bigint64array, or biguint64array. index the position in the typedarray to compute the bitwise or. value the number to compute the bitwise or with. return value the old value at the given position (typedarray[index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray.
description the bitwise or operation yields 1, if either a or b are 1. the truth table for the or operation is: a b a | b 0 0 0 0 1 1 1 0 1 1 1 1 for example, a bitwise or of 5 & 1 results in 0101 which is 5 in decimal. 5 0101 1 0001 ---- 5 0101 examples using or const sab = new sharedarraybuffer(1024); const t...
Atomics.xor() - JavaScript
, uint32array, bigint64array, or biguint64array. index the position in the typedarray to compute the bitwise xor. value the number to compute the bitwise xor with. return value the old value at the given position (typedarray[index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray.
description the bitwise xor operation yields 1, if a and b are different. the truth table for the xor operation is: a b a ^ b 0 0 0 0 1 1 1 0 1 1 1 0 for example, a bitwise xor of 5 ^ 1 results in 0100 which is 4 in decimal. 5 0101 1 0001 ---- 4 0100 examples using xor const sab = new sharedarraybuffer(1024); c...
Atomics - JavaScript
unlike the other global objects, atomics is not a constructor. you cannot use it with a new operator or invoke the atomics object as a function. all properties and methods of atomics are static (as is the case with the math object, for example). atomic operations when memory is shared, multiple threads can read and write the same data in memory. ...
BigInt.prototype.toString() - JavaScript
ctive-examples and send us a pull request. syntax bigintobj.tostring([radix]) parameters radixoptional optional. an integer in the range 2 through 36 specifying the base to use for representing numeric values. return value a string representing the specified bigint object. exceptions rangeerror if tostring() is given a radix less than 2 or greater than 36, a rangeerror is thrown.
description the bigint object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring(). for bigint objects, the tostring() method returns a string representation of the object in the specified radix. the tostring() method parses its first argument, and attempts to return a string representation in the specified radix (base). for radixes above 10, the letters of ...
BigInt - JavaScript
bigint is a built-in object that provides a way to represent whole numbers larger than 253 - 1, which is the largest number javascript can reliably represent with the number primitive and represented by the number.max_safe_integer constant. bigint can be used for arbitrarily large integers.
description a bigint is created by appending n to the end of an integer literal — 10n — or by calling the function bigint(). const thebiggestint = 9007199254740991n const alsohuge = bigint(9007199254740991) // ↪ 9007199254740991n const hugestring = bigint("9007199254740991") // ↪ 9007199254740991n const hugehex = bigint("0x1fffffffffffff") // ↪ 9007199254740991n const hugebin = bigint("0b11111111111111111111111111111111111111111111111111111") // ↪ 9007199254740991n bigint is similar to num...
Boolean.prototype.toString() - JavaScript
e tostring() method returns a string representing the specified boolean object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax bool.tostring() return value a string representing the specified boolean object.
description the boolean object overrides the tostring method of the object object; it does not inherit object.prototype.tostring(). for boolean objects, the tostring method returns a string representation of the object. javascript calls the tostring() method automatically when a boolean is to be represented as a text value or when a boolean is referred to in a string concatenation. for boolean objects and...
Boolean.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of a boolean object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax bool.valueof() return value the primitive value of the given boolean object
description the valueof() method of boolean returns the primitive value of a boolean object or literal boolean as a boolean data type. this method is usually called internally by javascript and not explicitly in code. examples using valueof() x = new boolean(); myvar = x.valueof(); // assigns false to myvar specifications specification ecmascript (ecma-262)the definition of 'boolean.prototype.val...
Boolean - JavaScript
if the value is omitted or is 0, -0, null, false, nan, undefined, or the empty string (""), the object has an initial value of false. all other values, including any object, an empty array ([]), or the string "false", create an object with an initial value of true. do not confuse the primitive boolean values true and false with the true and false values of the boolean object. any object of which the value is not undefined or null, including a boolean object whose value is false, evaluates to true when passed to a conditional statement. ...
DataView() constructor - JavaScript
al the offset, in bytes, to the first byte in the above buffer for the new view to reference. if unspecified, the buffer view starts with the first byte. bytelength optional the number of elements in the byte array. if unspecified, the view's length will match the buffer's length. return value a new dataview object representing the specified data buffer. (that probably wasn't a very helpful
description.) you can think of the returned object as an "interpreter" of the array buffer of bytes — it knows how to convert numbers to fit within the buffer correctly, both when reading and writing to it. this means handling integer and float conversion, endianness, and other details of representing numbers in binary form. exceptions rangeerror thrown if the byteoffset or bytelength parameter val...
DataView.prototype.buffer - JavaScript
the buffer accessor property represents the arraybuffer or sharedarraybuffer referenced by the dataview at construction time. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the buffer property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when the dataview is constructed and cannot be changed. examples using the buffer property var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.buffer; // arraybuffer { bytelength: 8 } specifications specification ecmascript (ecma-262)t...
DataView.prototype.byteLength - JavaScript
the bytelength accessor property represents the length (in bytes) of this view from the start of its arraybuffer or sharedarraybuffer. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the bytelength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when an dataview is constructed and cannot be changed. if the dataview is not specifying an offset or a bytelength, the bytelength of the referenced arraybuffer or sharedarraybuffer will be returned. examples using the bytelength property var buffer = new arraybuffer(8)...
DataView.prototype.byteOffset - JavaScript
the byteoffset accessor property represents the offset (in bytes) of this view from the start of its arraybuffer or sharedarraybuffer. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the byteoffset property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when an dataview is constructed and cannot be changed. examples using the byteoffset property var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.byteoffset; // 0 (no offset specified) var dataview2 = new dataview(buffer, 3); dataview2.byteof...
DataView.prototype.getBigInt64() - JavaScript
ndian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from. littleendian optional indicates whether the 64-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a bigint. errors thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the view.
description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getbigint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getbigint64(0); // 0n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getbigint64()' in that specification. ...
DataView.prototype.getBigUint64() - JavaScript
ndian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from. littleendian optional indicates whether the 64-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a bigint. errors thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the view.
description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getbiguint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getbiguint64(0); // 0n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getbiguint64()' in that specification. ...
DataView.prototype.getFloat32() - JavaScript
byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 32-bit float is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a signed 32-bit float number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getfloat32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getfloat32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getfloat32' in that specification. ...
DataView.prototype.getFloat64() - JavaScript
byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 64-bit float is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a signed 64-bit float number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getfloat64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getfloat64(0); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getfloat64' in that specification. ...
DataView.prototype.getInt16() - JavaScript
byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 16-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a signed 16-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint16(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getint16' in that specification. ...
DataView.prototype.getInt32() - JavaScript
byteoffset the offset, in bytes, from the start of the view where to read the data. littleendian optional indicates whether the 32-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a signed 32-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getint32' in that specification. ...
DataView.prototype.getInt8() - JavaScript
xamples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.getint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the view where to read the data. return value a signed 8-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint8(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getint8' in that specification. ...
DataView.prototype.getUint16() - JavaScript
byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 16-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value an unsigned 16-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getuint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getuint16(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getuint16' in that specification. ...
DataView.prototype.getUint32() - JavaScript
byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 32-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value an unsigned 32-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getuint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getuint32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getuint32' in that specification. ...
DataView.prototype.getUint8() - JavaScript
les project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.getuint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the view where to read the data. return value an unsigned 8-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getuint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getuint8(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getuint8' in that specification. ...
DataView - JavaScript
dataview accessors provide explicit control of how data is accessed, regardless of the executing computer's endianness. ...
Date.UTC() - JavaScript
tween 0 and 59 representing the minutes. if omitted, defaults to 0. second optional an integer between 0 and 59 representing the seconds. if omitted, defaults to 0. millisecond optional an integer between 0 and 999 representing the milliseconds. if omitted, defaults to 0. return value a number representing the number of milliseconds for the given date since january 1, 1970, 00:00:00, utc.
description utc() takes comma-delimited date and time parameters and returns the number of milliseconds between january 1, 1970, 00:00:00, universal time and the specified date and time. years between 0 and 99 are converted to a year in the 20th century (1900 + year). for example, 95 is converted to the year 1995. the utc() method differs from the date constructor in two ways: date.utc() uses universal...
Date.prototype.getFullYear() - JavaScript
e this method instead of the getyear() method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.getfullyear() return value a number corresponding to the year of the given date, according to local time.
description the value returned by getfullyear() is an absolute number. for dates between the years 1000 and 9999, getfullyear() returns a four-digit number, for example, 1995. use this function to make sure a year is compliant with years after 2000. examples using getfullyear() the following example assigns the four-digit value of the current year to the variable year. var today = new date(); var year =...
Date.prototype.getTimezoneOffset() - JavaScript
tc. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.gettimezoneoffset() return value a number representing the time-zone offset, in minutes, from the date based on current host system settings to utc.
description the time-zone offset is the difference, in minutes, from local time to utc. note that this means that the offset is positive if the local timezone is behind utc, and negative if it is ahead. for example, for time zone utc+10:00 (australian eastern standard time, vladivostok time, chamorro standard time), -600 will be returned. current locale utc-8 utc utc+3 retur...
Date.prototype.getUTCFullYear() - JavaScript
specified date according to universal time. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.getutcfullyear() return value a number representing the year in the given date according to universal time.
description the value returned by getutcfullyear() is an absolute number that is compliant with year-2000, for example, 1995. examples using getutcfullyear() the following example assigns the four-digit value of the current year to the variable year. var today = new date(); var year = today.getutcfullyear(); specifications specification ecmascript (ecma-262)the definition of 'date.p...
Date.prototype.getYear() - JavaScript
the getyear() method returns the year in the specified date according to local time. because getyear() does not return full years ("year 2000 problem"), it is no longer used and has been replaced by the getfullyear() method. syntax dateobj.getyear() return value a number representing the year of the given date, according to local time, minus 1900.
description for years greater than or equal to 2000, the value returned by getyear() is 100 or greater. for example, if the year is 2026, getyear() returns 126. for years between and including 1900 and 1999, the value returned by getyear() is between 0 and 99. for example, if the year is 1976, getyear() returns 76. for years less than 1900, the value returned by getyear() is less than 0. for example, if the year is 1800, getyear() returns -100.
Date.parse() - JavaScript
a string representing a simplification of the iso 8601 calendar date extended format. (other formats may be used, but results are implementation-dependent.) return value a number representing the milliseconds elapsed since january 1, 1970, 00:00:00 utc and the date obtained by parsing the given string representation of a date. if the argument doesn't represent a valid date, nan is returned.
description the parse() method takes a date string (such as "2011-10-10t14:48:00") and returns the number of milliseconds since january 1, 1970, 00:00:00 utc. this function is useful for setting date values based on string values, for example in conjunction with the settime() method and the date object. date time string format the standard string representation of a date time string is a simplification o...
Date.prototype.setDate() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setdate(dayvalue) parameters dayvalue an integer representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the given date (the date object is also changed in place).
description if the dayvalue is outside of the range of date values for the month, setdate() will update the date object accordingly. for example, if 0 is provided for dayvalue, the date will be set to the last day of the previous month. if a negative number is provided for dayvalue, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 ...
Date.prototype.setFullYear() - JavaScript
e of the year, for example, 1995. monthvalue optional. an integer between 0 and 11 representing the months january through december. datevalue optional. an integer between 1 and 31 representing the day of the month. if you specify the datevalue parameter, you must also specify the monthvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if you do not specify the monthvalue and datevalue parameters, the values returned from the getmonth() and getdate() methods are used. if a parameter you specify is outside of the expected range, setfullyear() attempts to update the other parameters and the date information in the date object accordingly. for example, if you specify 15 for monthvalue, the year is incremented by 1 (yearvalue + 1...
Date.prototype.setHours() - JavaScript
inutesvalue. msvalue optional. ideally, a number between 0 and 999, representing the milliseconds. if a value greater than 999 is provided, the datetime will be incremented by the extra milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date.
description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getminutes(), getseconds(), and getmilliseconds() methods are used. if a parameter you specify is outside of the expected range, sethours() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented ...
Date.prototype.setMilliseconds() - JavaScript
y. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setmilliseconds(millisecondsvalue) parameters millisecondsvalue a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if you specify a number outside the expected range, the date information in the date object is updated accordingly. for example, if you specify 1005, the number of seconds is incremented by 1, and 5 is used for the milliseconds. examples using setmilliseconds() var thebigday = new date(); thebigday.setmilliseconds(100); specifications specification ecmascript (ecma-262)th...
Date.prototype.setMinutes() - JavaScript
ween 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if you do not specify the secondsvalue and msvalue parameters, the values returned from getseconds() and getmilliseconds() methods are used. if a parameter you specify is outside of the expected range, setminutes() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented by 1 (minutesvalue + 1), and 40 ...
Date.prototype.setMonth() - JavaScript
er representing the month of the year offset from the start of the year. so, 0 represents january, 11 represents december, -1 represents december of the previous year, and 12 represents january of the following year. dayvalue optional. an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if you do not specify the dayvalue parameter, the value returned from the getdate() method is used. if a parameter you specify is outside of the expected range, setmonth() attempts to update the date information in the date object accordingly. for example, if you use 15 for monthvalue, the year will be incremented by 1, and 3 will be used for month. the current day of month will have an impact...
Date.prototype.setSeconds() - JavaScript
pull request. syntax dateobj.setseconds(secondsvalue[, msvalue]) versions prior to javascript 1.3 dateobj.setseconds(secondsvalue) parameters secondsvalue an integer between 0 and 59, representing the seconds. msvalue optional. a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if you do not specify the msvalue parameter, the value returned from the getmilliseconds() method is used. if a parameter you specify is outside of the expected range, setseconds() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes stored in the date object will be incremented by 1, and 40 will be used for seconds. ...
Date.prototype.setTime() - JavaScript
tive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.settime(timevalue) parameters timevalue an integer representing the number of milliseconds since 1 january 1970, 00:00:00 utc. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date (effectively, the value of the argument).
description use the settime() method to help assign a date and time to another date object. examples using settime() var thebigday = new date('july 1, 1999'); var sameasbigday = new date(); sameasbigday.settime(thebigday.gettime()); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.settime' in that specification. ...
Date.prototype.setUTCDate() - JavaScript
in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setutcdate(dayvalue) parameters dayvalue an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if a parameter you specify is outside of the expected range, setutcdate() attempts to update the date information in the date object accordingly. for example, if you use 40 for dayvalue, and the month stored in the date object is june, the day will be changed to 10 and the month will be incremented to july. examples using setutcdate() var thebigday = new date(); thebigday.setutcdate(20); sp...
Date.prototype.setUTCFullYear() - JavaScript
lue of the year, for example, 1995. monthvalue optional. an integer between 0 and 11 representing the months january through december. dayvalue optional. an integer between 1 and 31 representing the day of the month. if you specify the dayvalue parameter, you must also specify the monthvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if you do not specify the monthvalue and dayvalue parameters, the values returned from the getutcmonth() and getutcdate() methods are used. if a parameter you specify is outside of the expected range, setutcfullyear() attempts to update the other parameters and the date information in the date object accordingly. for example, if you specify 15 for monthvalue, the year is incremented by 1 (yearv...
Date.prototype.setUTCHours() - JavaScript
een 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date.
description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getutcminutes(), getutcseconds(), and getutcmilliseconds() methods are used. if a parameter you specify is outside of the expected range, setutchours() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be ...
Date.prototype.setUTCMilliseconds() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setutcmilliseconds(millisecondsvalue) parameters millisecondsvalue a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if a parameter you specify is outside of the expected range, setutcmilliseconds() attempts to update the date information in the date object accordingly. for example, if you use 1100 for millisecondsvalue, the seconds stored in the date object will be incremented by 1, and 100 will be used for milliseconds. examples using setutcmilliseconds() var thebigday = new date(); thebigday.setutcmillis...
Date.prototype.setUTCMinutes() - JavaScript
ween 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if you do not specify the secondsvalue and msvalue parameters, the values returned from getutcseconds() and getutcmilliseconds() methods are used. if a parameter you specify is outside of the expected range, setutcminutes() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented by 1 (minutesvalue + 1)...
Date.prototype.setUTCMonth() - JavaScript
.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setutcmonth(monthvalue[, dayvalue]) parameters monthvalue an integer between 0 and 11, representing the months january through december. dayvalue optional. an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if you do not specify the dayvalue parameter, the value returned from the getutcdate() method is used. if a parameter you specify is outside of the expected range, setutcmonth() attempts to update the date information in the date object accordingly. for example, if you use 15 for monthvalue, the year will be incremented by 1, and 3 will be used for month. examples using setutcmonth() var the...
Date.prototype.setUTCSeconds() - JavaScript
clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setutcseconds(secondsvalue[, msvalue]) parameters secondsvalue an integer between 0 and 59, representing the seconds. msvalue optional. a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if you do not specify the msvalue parameter, the value returned from the getutcmilliseconds() method is used. if a parameter you specify is outside of the expected range, setutcseconds() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes stored in the date object will be incremented by 1, and 40 will be used for seco...
Date.prototype.setYear() - JavaScript
the setyear() method sets the year for a specified date according to local time. because setyear() does not set full years ("year 2000 problem"), it is no longer used and has been replaced by the setfullyear() method. syntax dateobj.setyear(yearvalue) parameters yearvalue an integer. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date.
description if yearvalue is a number between 0 and 99 (inclusive), then the year for dateobj is set to 1900 + yearvalue. otherwise, the year for dateobj is set to yearvalue. examples using setyear() the first two lines set the year to 1996. the third sets the year to 2000. var thebigday = new date(); thebigday.setyear(96); thebigday.setyear(1996); thebigday.setyear(2000); specifications specif...
Date.prototype.toDateString() - JavaScript
e.g. "thu jan 01 1970". the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.todatestring() return value a string representing the date portion of the given date object in human readable form in english.
description date instances refer to a specific point in time. calling tostring() will return the date formatted in a human readable form in english. in spidermonkey, this consists of the date portion (day, month, and year) followed by the time portion (hours, minutes, seconds, and time zone). sometimes it is desirable to obtain a string of the time portion; such a thing can be accomplished with the totimest...
Date.prototype.toJSON() - JavaScript
the tojson() method returns a string representation of the date object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.tojson() return value a string representation of the given date.
description date instances refer to a specific point in time. calling tojson() returns a string (using toisostring()) representing the date object's value. this method is generally intended to, by default, usefully serialize date objects during json serialization. examples using tojson() var jsondate = (new date()).tojson(); var backtodate = new date(jsondate); console.log(jsondate); //2015-10-26t07:46:36.611z speci...
Date.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified date object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.tostring() return value a string representing the given date.
description date instances inherit their tostring() method from date.prototype, not object.prototype. date.prototype.tostring() returns a string representation of the date in the format specified in ecma-262 which can be summarised as: week day: 3 letter english week day name, e.g. "sat" space month name: 3 letter english month name, e.g. "sep" space date: 2 digit day in month, e.g. "01" space year: 4 digit y...
Date.prototype.toTimeString() - JavaScript
rm in american english. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.totimestring() return value a string representing the time portion of the given date in human readable form in american english.
description date instances refer to a specific point in time. calling tostring() will return the date formatted in a human readable form in american english. in spidermonkey, this consists of the date portion (day, month, and year) followed by the time portion (hours, minutes, seconds, and time zone). sometimes it is desirable to obtain a string of the time portion; such a thing can be accomplished with the...
Date.prototype.toUTCString() - JavaScript
62 toutcstring, it can have negative values in the 2021 version the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.toutcstring() return value a string representing the given date using the utc time zone.
description the value returned by toutcstring() is a string in the form www, dd mmm yyyy hh:mm:ss gmt, where: format sring
description www day of week, as three letters (e.g. sun, mon, ...) dd day of month, as two digits with leading zero if required mmm month, as three letters (e.g. jan, feb, ...) yyyy year, as four or more digits with leadin...
Date.prototype.valueOf() - JavaScript
this method is functionally equivalent to the date.prototype.gettime() method. this method is usually called internally by javascript and not explicitly in code. ...
Date - JavaScript
javascript date objects represent a single moment in time in a platform-independent format. date objects contain a number that represents milliseconds since 1 january 1970 utc. tc39 is working on temporal, a new date/time api. read more about it on the igalia blog and fill out the survey. it needs real-world feedback from web developers, but is not yet ready for production use!
description the ecmascript epoch and timestamps a javascript date is fundamentally specified as the number of milliseconds that have elapsed since midnight on january 1, 1970, utc. this date and time is the same as the unix epoch, which is the predominant base value for computer-recorded date and time values. note: it's important to keep in mind that while the time value at the heart of a date object is utc, the basic...
Error() constructor - JavaScript
filename optional the value for the filename property on the created error object. defaults to the name of the file containing the code that called the error() constructor. linenumber optional the value for the linenumber property on the created error object. defaults to the line number containing the error() constructor invocation. examples function call or new construction when error is used like a function -- without new, it will return an error object. ...
Error.prototype.stack - JavaScript
the non-standard stack property of error objects offer a trace of which functions were called, in what order, from which line and file, and with what arguments. the stack string proceeds from the most recent calls to earlier ones, leading back to the original global scope call.
description each step will be separated by a newline, with the first part of the line being the function name (if not a call from the global scope), then by an at (@) sign, the file location (except when the function is the error constructor as the error is being thrown), a colon, and, if there is a file location, the line number. (note that the error object also possesses the filename, linenumber and columnnumber properties for retrieving these from the error thrown (but only the error, and not its trace).) note...
Error.prototype.message - JavaScript
spidermonkey makes extensive use of the message property for exceptions. the message property combined with the name property is used by the error.prototype.tostring() method to create a string representation of the error. by default, the message property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the error constructor. ...
Error.prototype.name - JavaScript
the name property, in addition to the message property, is used by the error.prototype.tostring() method to create a string representation of the error. ...
Error.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified error object. syntax e.tostring() return value a string representing the specified error object.
description the error object overrides the object.prototype.tostring() method inherited by all objects. its semantics are as follows (assuming object and string have their original values): error.prototype.tostring = function() { 'use strict'; var obj = object(this); if (obj !== this) { throw new typeerror(); } var name = this.name; name = (name === undefined) ? 'error' : string(name); var msg = this.message; msg = (msg === undefined) ? '' : string(msg); if (name === '') { return msg; } if (msg === '') { return name; } return name + ': ' + msg; }; examples using tostring() var e = new e...
FinalizationRegistry - JavaScript
(cleanup callbacks are sometimes called finalizers.) note: cleanup callbacks should not be used for essential program logic. see notes on cleanup callbacks for details. you create the registry passing in the callback: const registry = new finalizationregistry(heldvalue => { // .... ...
Function() constructor - JavaScript
rg2 [, ...argn]] ,] functionbody) parameters arg1, arg2, ... argn names to be used by the function as formal argument names. each must be a string that corresponds to a valid javascript identifier, or a list of such strings separated with a comma. for example: "x", "thevalue"—or "x,thevalue". functionbody a string containing the javascript statements comprising the function definition.
description function objects created with the function constructor are parsed when the function is created. this is less efficient than declaring a function with a function expression or function statement and calling it within your code because such functions are parsed with the rest of the code. all arguments passed to the function are treated as the names of the identifiers of the parameters in the func...
Function.prototype.apply() - JavaScript
array-like object, specifying the arguments with which func should be called, or null or undefined if no arguments should be provided to the function. starting with ecmascript 5 these arguments can be a generic array-like object instead of an array. see below for browser compatibility information. return value the result of calling the function with the specified this value and arguments.
description note: while the syntax of this function is almost identical to that of call(), the fundamental difference is that call() accepts an argument list, while apply() accepts a single array of arguments. note: when the first argument is undefined or null a similar outcome can be achieved using the array spread syntax. you can assign a different this object when calling an existing function. this...
Function.arguments - JavaScript
the recommended way to access the arguments object available within functions is simply to refer to the variable arguments. in the case of recursion, i.e. ...
Function.prototype.bind() - JavaScript
o object. if no arguments are provided to bind , or if the thisarg is null or undefined, the this of the executing scope is treated as the thisarg for the new function. arg1, arg2, ...argn optional arguments to prepend to arguments provided to the bound function when invoking func. return value a copy of the given function with the specified this value, and initial arguments (if provided).
description the bind() function creates a new bound function, which is an exotic function object (a term from ecmascript 2015) that wraps the original function object. calling the bound function generally results in the execution of its wrapped function. a bound function has the following internal properties: [[boundtargetfunction]] the wrapped function object [[boundthis]] the value that is always p...
Function.prototype.call() - JavaScript
ion: in certain cases, thisarg may not be the actual value seen by the method. if the method is a function in non-strict mode, null and undefined will be replaced with the global object, and primitive values will be converted to objects. arg1, arg2, ...argn optional arguments for the function. return value the result of calling the function with the specified this value and arguments.
description the call() allows for a function/method belonging to one object to be assigned and called for a different object. call() provides a new value of this to the function/method. with call(), you can write a method once and then inherit it in another object, without having to rewrite the method for the new object. note: while the syntax of this function is almost identical to that of apply(), the ...
Function.caller - JavaScript
it's also null for strict, async function and generator function callers. this property replaces the obsolete arguments.caller property of the arguments object. the special property __caller__, which returned the activation object of the caller thus allowing to reconstruct the stack, was removed for security reasons. ...
Function.length - JavaScript
source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of function.length writable no enumerable no configurable yes
description length is a property of a function object, and indicates how many arguments the function expects, i.e. the number of formal parameters. this number excludes the rest parameter and only includes parameters before the first one with a default value. by contrast, arguments.length is local to a function and provides the number of arguments actually passed to the function. data property of the funct...
Function.name - JavaScript
es writable. the built-in definition in the absence of a custom static definition is read-only: foo.name = 'hello'; console.log(foo.name); // logs "hello" if class foo has a static name() property but "foo" if not. therefore you may not rely on the built-in function.name property to always hold a class's name. symbols as function names if a symbol is used a function name and the symbol has a
description, the method's name is the
description in square brackets. let sym1 = symbol("foo"); let sym2 = symbol(); let o = { [sym1]: function(){}, [sym2]: function(){} }; o[sym1].name; // "[foo]" o[sym2].name; // "" specifications specification ecmascript (ecma-262)the definition of 'name' in that specification. ...
Function.prototype.toString() - JavaScript
() method returns a string representing the source code of the function. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax function.tostring() return value a string representing the source code of the function.
description the function object overrides the tostring method inherited from object; it does not inherit object.prototype.tostring. for user-defined function objects, the tostring method returns a string containing the source text segment which was used to define the function. javascript calls the tostring method automatically when a function is to be represented as a text value, e.g. when a function is co...
GeneratorFunction - JavaScript
n ([arg1[, arg2[, ...argn]],] functionbody) parameters arg1, arg2, ... argn names to be used by the function as formal argument names. each must be a string that corresponds to a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function definition.
description generator function objects created with the generatorfunction constructor are parsed when the function is created. this is less efficient than declaring a generator function with a function* expression and calling it within your code, because such functions are parsed with the rest of the code. all arguments passed to the function are treated as the names of the identifiers of the parameters in...
Infinity - JavaScript
property attributes of infinity writable no enumerable no configurable no the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description infinity is a property of the global object. in other words, it is a variable in global scope. the initial value of infinity is number.positive_infinity. the value infinity (positive infinity) is greater than any other number. this value behaves slightly differently than mathematical infinity; see number.positive_infinity for details. as defined by the ecmascript 5 specification, infinity is ...
InternalError() constructor - JavaScript
the internalerror() constructor creates an error that indicates an error that occurred internally in the javascript engine. for example: "internalerror: too much recursion". syntax new internalerror([message[, filename[, linenumber]]]) parameters message optional. human-readable
description of the error filename optional. the name of the file containing the code that caused the exception linenumber optional. the line number of the code that caused the exception examples creating a new internalerror new internalerror("engine failure"); specifications not part of any standard. ...
Intl.Collator.prototype.compare() - JavaScript
cording to the sort order of this collator object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax collator.compare(string1, string2) parameters string1 string2 the strings to compare against each other.
description the compare getter function returns a number indicating how string1 and string2 compare to each other according to the sort order of this collator object: a negative value if string1 comes before string2; a positive value if string1 comes after string2; 0 if they are considered equal. examples using compare for array sort use the compare getter function for sorting arrays. note that the funct...
Intl.Collator.prototype.resolvedOptions() - JavaScript
this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax collator.resolvedoptions() return value a new object with properties reflecting the locale and collation options computed during the initialization of the given collator object.
description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. usage sensitivity ignorepunctuation the values provided for these propertie...
Intl.Collator.supportedLocalesOf() - JavaScript
may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in collation without having to fall back to the runtime's default locale.
description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in collation that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in col...
Intl.DateTimeFormat.prototype.format() - JavaScript
ts a date according to the locale and formatting options of this intl.datetimeformat object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax datetimeformat.format(date) parameters date the date to format.
description the format getter formats a date into a string according to the locale and formatting options of this intl.datetimeformat object. examples using format use the format getter function for formatting a single date, here for serbia: var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; var datetimeformat = new intl.datetimeformat('sr-rs', options); console.log(datet...
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
the intl.datetimeformat.prototype.formattoparts() method allows locale-aware formatting of strings produced by datetimeformat formatters. syntax datetimeformat.formattoparts(date) parameters date optional the date to format. return value an array of objects containing the formatted date in parts.
description the formattoparts() method is useful for custom formatting of date strings. it returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preserving the locale-specific parts. the structure the formattoparts() method returns, looks like this: [ { type: 'day', value: '17' }, { type: 'weekday', value: 'monday' } ] possible types are the following: day the string used for the day, for example "17". dayperiod the str...
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
s stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax datetimeformat.resolvedoptions() return value a new object with properties reflecting the locale and date and time formatting options computed during the initialization of the given datetimeformat object.
description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. calendar e.g. "gregory" numberingsystem the values requested using the unic...
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
ollowing property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not ...
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
.displaynames.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current displaynames object. syntax displaynames.resolvedoptions() return value an object with properties reflecting the locale and formatting options computed during the construction of the given displaynames object.
description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. style the value provided for this property in the options...
Intl.DisplayNames.supportedLocalesOf() - JavaScript
ollowing property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not ...
Intl.ListFormat.prototype.format() - JavaScript
the format() method returns a string with a language-specific representation of the list. syntax listformat.format([list]); parameters list an iterable object, such as an array return value a language-specific formatted string representing the elements of the list
description the format() method returns a string that has been formatted based on parameters provided in the intl.listformat object. the locales and options parameters customize the behavior of format() and let applications specify the language conventions that should be used to format the list. examples using format the following example shows how to create a list formatter using the english language. const list = ['motorcycle', 'bus', 'car']; console.log(new intl.listformat('en-gb', { style: 'long', type: 'conjunction...
Intl.ListFormat.prototype.formatToParts() - JavaScript
rmat.prototype.formattoparts() method returns an array of objects representing the different components that can be used to format a list of values in a locale-aware fashion. syntax intl.listformat.prototype.formattoparts(list) parameters list an array of values to be formatted according to a locale. return value an array of components which contains the formatted parts from the list.
description whereas intl.listformat.prototype.format() returns a string being the formated version of the list (according to the given locale and style options), formattoparts() returns an array of the different components of the formated string. each element of the resulting array has two properties: type and value. the type property may be either "element", which refers to a value from the list, or "lite...
Intl.ListFormat.prototype.resolvedOptions() - JavaScript
the intl.listformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current listformat object. syntax listformat.resolvedoptions() return value an object with properties reflecting the locale and formatting options computed during the construction of the given listformat object.
description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. style the value provided for this property in the options...
Intl.ListFormat.supportedLocalesOf() - JavaScript
ollowing property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not ...
Intl.Locale.prototype.baseName - JavaScript
the basename property returns basic, core information about the locale in the form of a substring of the complete data string. specifically, the property returns the substring containing the language, and the script and region if available. basename returns the language ["-" script] ["-" region] *("-" variant) subsequence of the unicode_language_id grammar. ...
Intl.Locale.prototype.caseFirst - JavaScript
the intl.locale.prototype.casefirst property is an accessor property that returns whether case is taken into account for the locale's collation rules.
description a locale's collation rules are used to determine how strings are ordered in that locale. certain locales use a character's case (uppercase or lowercase) in the collation process. this additional rule can be expressed in a locale's casefirst property. there are 3 values that the casefirst property can have, outlined in the table below. casefirst values value
description upper upper case to be sorted before lower case. lower lower case to be sorted before upper case. false no special case ordering. examples setting the casefirst value via the locale string in the unicode local...
Intl.Locale.prototype.hourCycle - JavaScript
the intl.locale.prototype.hourcycle property is an accessor property that returns the time keeping format convention used by the locale.
description there are 2 main types of time keeping conventions (clocks) used around the world: the 12 hour clock and the 24 hour clock. the hourcycle property makes it easier for javascript programmers to access the clock type used by a particular locale. like other additional locale data, hour cycle type is an extension subtag, which extends the data contained in a locale string. the hour cycle type can have several different values, which are listed in the table below. valid hour cycle types hour cycle type
description h12 hour system using 1–12; corresponds to 'h' in patterns. the 12 hour clock, with midnight starting at 12:00 a...
Intl.Locale.prototype.language - JavaScript
the unicode specification treats the language identifier of a locale as the language and the region together (to make a distiction between dialects and variations, e.g. british english vs. american english). the language property of a locale returns strictly the locale's language subtag. examples setting the language in the locale identifer string argument in order to be a valid unicode locale identifier, a string must start with the language subtag. ...
Intl.Locale.prototype.maximize() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax locale.maximize() return value a locale instance whose basename property returns the result of the add likely subtags algorithm executed against locale.basename.
description sometimes, it is convenient to be able to identify the most likely locale language identifier subtags based on an incomplete langauage id. the add likely subtags algorithm gives us this functionality. for instance, given the language id "en", the algorithm would return "en-latn-us", since english can only be written in the latin script, and is most likely to be used in the united states, as it i...
Intl.Locale.prototype.minimize() - JavaScript
e source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax locale.minimize() return value a locale instance whose basename property returns the result of the remove likely subtags algorithm executed against locale.basename.
description this method carries out the reverse of maximize(), removing any language, script, or region subtags from the locale language identifier (essentially the contents of basename). this is useful when there are superfluous subtags in the language identifier; for instance, "en-latn" can be simplified to "en", since "latn" is the only script used to write english. minimize() only affects the main subta...
Intl.Locale.prototype.numeric - JavaScript
numeric is a boolean value, which means that it can be either true or false. if numeric is set to false, there will be no special handling of numeric values in strings. if numeric is set to true, then the locale will take numeric characters into account when collating strings. this special numeric handling means that sequences of decimal digits will be compared as numbers. ...
Intl.Locale.prototype.region - JavaScript
knowing the locale's region is vital to identifying differences between locales. for example, english is spoken in the united kingdom and the united states of america, but there are differences in spelling and other language conventions between those two countries. ...
Intl.Locale.prototype.script - JavaScript
it indicates the set of symbols, or glyphs, that are used to write a particular language. for instance, the script associated with english is latin, whereas the script typically associated with korean is hangul. in many cases, denoting a script is not strictly necessary, since the language (which is necessary) is only written in a single script. ...
Intl.Locale.prototype.toString() - JavaScript
tl.locale.prototype.tostring() returns the locale's full locale identifier string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax locale.tostring() return value the locale's unicode locale identifier string.
description the locale object is a javascript representation of a concept unicode locale identifier. information about a particular locale (language, script, calendar type, etc.) can be encoded in a locale identifier string. to make it easier to work with these locale identifiers, the locale object was introduced to javascript. calling the tostring method on a locale object will return the identifier string...
Intl.Locale - JavaScript
unicode represents locales with a string, called a locale identifier. the locale identifier consists of a language identifier and extension tags. language identifiers are the core of the locale, consisting of language, script, and region subtags. additional information about the locale is stored in the optional extension tags. extension tags hold information about locale aspects such as calendar type, clock type, and numbering system type. ...
Intl.NumberFormat.prototype.format() - JavaScript
mber according to the locale and formatting options of this numberformat object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax numberformat.format(number) parameters number a number or bigint to format.
description the format getter function formats a number into a string according to the locale and formatting options of this numberformat object. examples using format use the format getter function for formatting a single currency value, here for russia: var options = { style: 'currency', currency: 'rub' }; var numberformat = new intl.numberformat('ru-ru', options); console.log(numberformat.format(6543...
Intl.NumberFormat.prototype.formatToParts() - JavaScript
the intl.numberformat.prototype.formattoparts() method allows locale-aware formatting of strings produced by numberformat formatters. syntax intl.numberformat.prototype.formattoparts(number) parameters number optional a number or bigint to format. return value an array of objects containing the formatted number in parts.
description the formattoparts() method is useful for custom formatting of number strings. it returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preserving the locale-specific parts. the structure the formattoparts() method returns, looks like this: [ { type: "integer", value: "3" }, { type: "group", value: "." }, { type: "integer", value: "500" } ] possible types are the following: currency t...
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
e example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax numberformat.resolvedoptions() return value a new object with properties reflecting the locale and number formatting options computed during the initialization of the given numberformat object.
description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. numberingsystem the value provided for this properties in the options argumen...
Intl.NumberFormat.supportedLocalesOf() - JavaScript
e the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in number formatting without having to fall back to the runtime's default locale.
description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in number formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balines...
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
l.pluralrules.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and plural formatting options computed during initialization of this pluralrules object. syntax pluralrule.resolvedoptions() return value a new object with properties reflecting the locale and plural formatting options computed during the initialization of the given pluralrules object.
description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. pluralcategories an array of plural categories used by the given locale, sele...
Intl.PluralRules.select() - JavaScript
the intl.pluralrules.prototype.select method returns a string indicating which plural rule to use for locale-aware formatting. syntax pluralcategory = pluralrule.select(number) parameters number the number to get a plural rule for. return value a string representing the pluralization category of the number, can be one of zero, one, two, few, many or other.
description this function selects a pluralization category according to the locale and formatting options of a pluralrules object. examples using select() new intl.pluralrules('ar-eg').select(0); // → 'zero' new intl.pluralrules('ar-eg').select(1); // → 'one' new intl.pluralrules('ar-eg').select(2); // → 'two' new intl.pluralrules('ar-eg').select(6); // → 'few' new intl.pluralrules('ar-eg').select(18); // → 'many' s...
Intl.PluralRules.supportedLocalesOf() - JavaScript
ay have the following property: localematcher the locale matching algorithm to use. possible values are lookup and best fit; the default is best fit. for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in plural formatting without having to fall back to the runtime's default locale.
description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in plural formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof() assuming a runtime that supports indonesian and german but not balin...
Intl.RelativeTimeFormat.prototype.format() - JavaScript
github.com/mdn/interactive-examples and send us a pull request. syntax relativetimeformat.format(value, unit) parameters value numeric value to use in the internationalized relative time message. unit unit to use in the relative time internationalized message. possible values are: "year", "quarter", "month", "week", "day", "hour", "minute", "second". plural forms are also permitted.
description the function returned by the format getter formats a value and a unit into a string according to the locale and formatting options of this intl.relativetimeformat object. examples basic format usage the following example shows how to create a relative time formatter using the english language. // create a relative time formatter in your locale // with default values explicitly passed in. con...
Intl.RelativeTimeFormat.prototype.formatToParts() - JavaScript
.formattoparts(value, unit) parameters value numeric value to use in the internationalized relative time message. unit unit to use in the relative time internationalized message. possible values are: "year", "quarter", "month", "week", "day", "hour", "minute", "second". plural forms are also permitted. return value an array of objects containing the formatted relative time in parts.
description the intl.relativetimeformat.prototype.formattoparts method is a version of the format method which it returns an array of objects which represent "parts" of the object, separating the formatted number into its consituent parts and separating it from other surrounding text. these objects have two properties: type a numberformat formattoparts type, and value, which is the string which is the compo...
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax relativetimeformat.resolvedoptions() return value a new object with properties reflecting the locale and number formatting options computed during the initialization of the given relativetimeformat object.
description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. style the length of the internationalized message. possible values are: "...
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
ollowing property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not ...
JSON.parse() - JavaScript
ansformation on the resulting object before it is returned. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax json.parse(text[, reviver]) parameters text the string to parse as json. see the json object for a
description of json syntax. reviver optional if a function, this prescribes how the value originally produced by parsing is transformed, before being returned. return value the object, array, string, number, boolean, or null value corresponding to the given json text. exceptions throws a syntaxerror exception if the string to parse is not valid json. polyfill // from https://github.com/douglascrockf...
JSON.stringify() - JavaScript
ng, if it's longer than that) is used as white space. if this parameter is not provided (or is null), no white space is used. return value a json string representing the given value. exceptions throws a typeerror ("cyclic object value") exception when a circular reference is found. throws a typeerror ("bigint value can't be serialized in json") when trying to stringify a bigint value.
description json.stringify() converts a value to json notation representing it: if the value has a tojson() method, it's responsible to define what data will be serialized. boolean, number, and string objects are converted to the corresponding primitive values during stringification, in accord with the traditional conversion semantics. undefined, functions, and symbols are not valid json values. if any...
JSON - JavaScript
it is based upon javascript syntax but is distinct from it: some javascript is not json. objects and arrays property names must be double-quoted strings; trailing commas are forbidden. ...
get Map[@@species] - JavaScript
subclass constructors may over-ride it to change the constructor assignment. examples species in ordinary objects the species property returns the default constructor function, which is the map constructor for map objects: map[symbol.species]; // function map() species in derived objects in a derived collection object (e.g. your custom map mymap), the mymap species is the mymap constructor. ...
Map.prototype.forEach() - JavaScript
ack([value][,key][,map])[, thisarg]) parameters callback function to execute for each entry of mymap. it takes the following arguments: value optional value of each iteration. key optional key of each iteration. map optional the map being iterated (mymap in the above syntax box). thisarg optional value to use as this when executing callback. return value undefined.
description the foreach method executes the provided callback once for each key of the map which actually exist. it is not invoked for keys which have been deleted. however, it is executed for values which are present but have the value undefined. callback is invoked with three arguments: the entry's value the entry's key the map object being traversed if a thisarg parameter is provided to foreach, ...
Map.prototype.size - JavaScript
the size accessor property returns the number of elements in a map object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the value of size is an integer representing how many entries the map object has. a set accessor function for size is undefined; you can not change this property. examples using size var mymap = new map(); mymap.set('a', 'alpha'); mymap.set('b', 'beta'); mymap.set('g', 'gamma'); mymap.size // 3 specifications specification ecmascript (ecma-262)the definition of 'map.prototype.size' in that specification. ...
Map - JavaScript
key equality key equality is based on the samevaluezero algorithm. nan is considered the same as nan (even though nan !== nan) and all other values are considered equal according to the semantics of the === operator. ...
Math.E - JavaScript
18 the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of math.e writable no enumerable no configurable no
description because e is a static property of math, you always use it as math.e, rather than as a property of a math object you created (math is not a constructor). examples using math.e the following function returns e: function getnapier() { return math.e; } getnapier(); // 2.718281828459045 specifications specification ecmascript (ecma-262)the definition of 'math.e' in that sp...
Math.LN10 - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of math.ln10 writable no enumerable no configurable no
description because ln10 is a static property of math, you always use it as math.ln10, rather than as a property of a math object you created (math is not a constructor). examples using math.ln10 the following function returns the natural log of 10: function getnatlog10() { return math.ln10; } getnatlog10(); // 2.302585092994046 specifications specification ecmascript (ecma-262)t...
Math.LN2 - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of math.ln2 writable no enumerable no configurable no
description because ln2 is a static property of math, you always use it as math.ln2, rather than as a property of a math object you created (math is not a constructor). examples using math.ln2 the following function returns the natural log of 2: function getnatlog2() { return math.ln2; } getnatlog2(); // 0.6931471805599453 specifications specification ecmascript (ecma-262)the def...
Math.LOG10E - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of math.log10e writable no enumerable no configurable no
description because log10e is a static property of math, you always use it as math.log10e, rather than as a property of a math object you created (math is not a constructor). examples using math.log10e the following function returns the base 10 logarithm of e: function getlog10e() { return math.log10e; } getlog10e(); // 0.4342944819032518 specifications specification ecmascript (...
Math.LOG2E - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of math.log2e writable no enumerable no configurable no
description because log2e is a static property of math, you always use it as math.log2e, rather than as a property of a math object you created (math is not a constructor). examples using math.log2e the following function returns the base 2 logarithm of e: function getlog2e() { return math.log2e; } getlog2e(); // 1.4426950408889634 specifications specification ecmascript (ecma-26...
Math.PI - JavaScript
9 the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of math.pi writable no enumerable no configurable no
description because pi is a static property of math, you always use it as math.pi, rather than as a property of a math object you created (math is not a constructor). examples using math.pi the following function uses math.pi to calculate the circumference of a circle with a passed radius. function calculatecircumference(radius) { return math.pi * (radius + radius); } calculatecircumference(1); // 6...
Math.SQRT1_2 - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of math.sqrt1_2 writable no enumerable no configurable no
description because sqrt1_2 is a static property of math, you always use it as math.sqrt1_2, rather than as a property of a math object you created (math is not a constructor). examples using math.sqrt1_2 the following function returns 1 over the square root of 2: function getroot1_2() { return math.sqrt1_2; } getroot1_2(); // 0.7071067811865476 specifications specification ecmas...
Math.SQRT2 - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of math.sqrt2 writable no enumerable no configurable no
description because sqrt2 is a static property of math, you always use it as math.sqrt2, rather than as a property of a math object you created (math is not a constructor). examples using math.sqrt2 the following function returns the square root of 2: function getroot2() { return math.sqrt2; } getroot2(); // 1.4142135623730951 specifications specification ecmascript (ecma-262)the...
Math.abs() - JavaScript
\text{if} \quad x \geq 0 \\ x & \text{if} \quad x < 0 \end{cases} the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.abs(x) parameters x a number. return value the absolute value of the given number.
description because abs() is a static method of math, you always use it as math.abs(), rather than as a method of a math object you created (math is not a constructor). examples behavior of math.abs() passing an empty object, an array with more than one member, a non-numeric string or undefined/empty variable returns nan. passing null, an empty string or an empty array returns 0. math.abs('-1'); // ...
Math.acos() - JavaScript
le is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.acos(x) parameters x a number representing a cosine, where x is between -1 and 1. return value the arccosine (angle in radians) of the given number if it's between -1 and 1; otherwise, nan.
description the math.acos() method returns a numeric value between 0 and π radians for x between -1 and 1. if the value of x is outside this range, it returns nan. because acos() is a static method of math, you always use it as math.acos(), rather than as a method of a math object you created (math is not a constructor). examples using math.acos() math.acos(-2); // nan math.acos(-1); // 3.14159265358...
Math.acosh() - JavaScript
that} \; \cosh(y) = x the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.acosh(x) parameters x a number. return value the hyperbolic arc-cosine of the given number. if the number is less than 1, nan.
description because acosh() is a static method of math, you always use it as math.acosh(), rather than as a method of a math object you created (math is no constructor). polyfill for all x≥1x \geq 1, we have arcosh(x)=ln(x+x2-1)\operatorname {arcosh} (x) = \ln \left(x + \sqrt{x^{2} - 1} \right) and so this can be emulated with the following function: math.acosh = math.acosh || function(x) { return ma...
Math.asin() - JavaScript
at} \; \sin(y) = x the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.asin(x) parameters x a number. return value the arcsine (in radians) of the given number if it's between -1 and 1; otherwise, nan.
description the math.asin() method returns a numeric value between -π2-\frac{\pi}{2} and π2\frac{\pi}{2} radians for x between -1 and 1. if the value of x is outside this range, it returns nan. because asin() is a static method of math, you always use it as math.asin(), rather than as a method of a math object you created (math is not a constructor). examples using math.asin() math.asin(-2); // nan m...
Math.asinh() - JavaScript
\text{ the unique } \; y \; \text{such that} \; \sinh(y) = x the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.asinh(x) parameters x a number. return value the hyperbolic arcsine of the given number.
description because asinh() is a static method of math, you always use it as math.asinh(), rather than as a method of a math object you created (math is not a constructor). polyfill math.asinh can be emulated with the following function: if (!math.asinh) math.asinh = function(x) { var absx = math.abs(x), w if (absx < 3.725290298461914e-9) // |x| < 2^-28 return x if (absx > 268435456)...
Math.atan() - JavaScript
\frac{\pi}{2}\right] \, \text{such that} \; \tan(y) = x the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.atan(x) parameters x a number. return value the arctangent (in radians) of the given number.
description the math.atan() method returns a numeric value between -π2-\frac{\pi}{2} and π2\frac{\pi}{2} radians. because atan() is a static method of math, you always use it as math.atan(), rather than as a method of a math object you created (math is not a constructor). examples using math.atan() math.atan(1); // 0.7853981633974483 math.atan(0); // 0 math.atan(-0); // -0 math.atan(infinity); ...
Math.atan2() - JavaScript
itory. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.atan2(y, x) parameters y the y coordinate of the point. x the x coordinate of the point return value the angle in radians (in [-π,π][-\pi, \pi]) between the positive x-axis and the ray from (0,0) to the point (x,y).
description the math.atan2() method returns a numeric value between -π and π representing the angle theta of an (x, y) point. this is the counterclockwise angle, measured in radians, between the positive x axis, and the point (x, y). note that the arguments to this function pass the y-coordinate first and the x-coordinate second. math.atan2() is passed separate x and y arguments, and math.atan() is pas...
Math.atanh() - JavaScript
xt{ the unique } \; y \; \text{such that} \; \tanh(y) = x the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.atanh(x) parameters x a number. return value the hyperbolic arctangent of the given number.
description because atanh() is a static method of math, you always use it as math.atanh(), rather than as a method of a math object you created (math is not a constructor). polyfill for |x|<1\left|x\right| < 1, we have artanh(x)=12ln(1+x1-x)\operatorname {artanh} (x) = \frac{1}{2}\ln \left( \frac{1 + x}{1 - x} \right) so this can be emulated by the following function: math.atanh = math.atanh || function...
Math.cbrt() - JavaScript
= \sqrt[3]{x} = \text{the unique} \; y \; \text{such that} \; y^3 = x the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.cbrt(x) parameters x a number. return value the cube root of the given number.
description because cbrt() is a static method of math, you always use it as math.cbrt(), rather than as a method of a math object you created (math is not a constructor). polyfill for all x≥0x \geq 0, have x3=x1/3\sqrt[3]{x} = x^{1/3} so this can be emulated by the following function: if (!math.cbrt) { math.cbrt = (function(pow) { return function cbrt(x){ // ensure negative numbers remain n...
Math.ceil() - JavaScript
integer 0 and does not give a nan error. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.ceil(x) parameters x a number. return value the smallest integer greater than or equal to the given number.
description because ceil() is a static method of math, you always use it as math.ceil(), rather than as a method of a math object you created (math is not a constructor). examples using math.ceil() the following example shows example usage of math.ceil(). math.ceil(.95); // 1 math.ceil(4); // 4 math.ceil(7.004); // 8 math.ceil(-0.95); // -0 math.ceil(-4); // -4 math.ceil(-7.004); // -7 d...
Math.clz32() - JavaScript
on of a number. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.clz32(x) parameters x a number. return value the number of leading zero bits in the 32-bit binary representation of the given number.
description "clz32" is short for countleadingzeroes32. if x is not a number, then it will be converted to a number first, then converted to a 32-bit unsigned integer. if the converted 32-bit unsigned integer is 0, then return 32, because all bits are 0. this function is particularly useful for systems that compile to js, like emscripten. count leading ones and beyond at present, there is no math.clon f...
Math.cos() - JavaScript
length hypotenuse . the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.cos(x) parameters x the angle in radians for which to return the cosine. return value the cosine of the given number.
description the math.cos() method returns a numeric value between -1 and 1, which represents the cosine of the angle. because cos() is a static method of math, you always use it as math.cos(), rather than as a method of a math object you created (math is not a constructor). examples using math.cos() math.cos(0); // 1 math.cos(1); // 0.5403023058681398 math.cos(math.pi); // -1 ma...
Math.cosh() - JavaScript
2\mathtt{\operatorname{math.cosh(x)}} = \frac{e^x + e^{-x}}{2} the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.cosh(x) parameters x a number. return value the hyperbolic cosine of the given number.
description because cosh() is a static method of math, you always use it as math.cosh(), rather than as a method of a math object you created (math is not a constructor). polyfill this can be emulated with the help of the math.exp() function: math.cosh = math.cosh || function(x) { return (math.exp(x) + math.exp(-x)) / 2; } or using only one call to the math.exp() function: math.cosh = math.cosh || f...
Math.exp() - JavaScript
base of the natural logarithms. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.exp(x) parameters x a number. return value a number representing ex, where e is euler's number and x is the argument.
description because exp() is a static method of math, you always use it as math.exp(), rather than as a method of a math object you created (math is not a constructor). examples using math.exp() math.exp(-1); // 0.36787944117144233 math.exp(0); // 1 math.exp(1); // 2.718281828459045 specifications specification ecmascript (ecma-262)the definition of 'math.exp' in that specification...
Math.expm1() - JavaScript
f the natural logarithms. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.expm1(x) parameters x a number. return value a number representing ex - 1, where e is euler's number and x is the argument.
description because expm1() is a static method of math, you always use it as math.expm1(), rather than as a method of a math object you created (math is not a constructor). polyfill this can be emulated with the help of the math.exp() function: math.expm1 = math.expm1 || function(x) { return math.exp(x) - 1; }; examples using math.expm1() math.expm1(-1); // -0.6321205588285577 math.expm1(0); // 0...
Math.floor() - JavaScript
to a given number. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.floor(x) parameters x a number. return value a number representing the largest integer less than or equal to the specified number.
description because floor() is a static method of math, you always use it as math.floor(), rather than as a method of a math object you created (math is not a constructor). note: math.floor(null) returns 0, not a nan. examples using math.floor() math.floor( 45.95); // 45 math.floor( 45.05); // 45 math.floor( 4 ); // 4 math.floor(-45.05); // -46 math.floor(-45.95); // -46 decimal adjustment /...
Math.fround() - JavaScript
xamples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax var singlefloat = math.fround(doublefloat); parameters doublefloat a number. if the parameter is of a different type, it will get converted to a number or to nan if it cannot be converted. return value the nearest 32-bit single precision float representation of the given number.
description javascript uses 64-bit double floating-point numbers internally, which offer a very high precision. however, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a float32array. this can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. to solve this, math.fro...
Math.hypot() - JavaScript
ou'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.hypot([value1[, value2[, ...]]]) parameters value1, value2, ... numbers. return value the square root of the sum of squares of the given arguments. if at least one of the arguments cannot be converted to a number, nan is returned.
description calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula math.sqrt(v1*v1 + v2*v2), where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. the corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4). ...
Math.imul() - JavaScript
source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax var product = math.imul(a, b); parameters a first number. b second number. return value the result of the c-like 32-bit multiplication of the given arguments.
description math.imul() allows for 32-bit integer multiplication with c-like semantics. this feature is useful for projects like emscripten. because imul() is a static method of math, you always use it as math.imul(), rather than as a method of a math object you created (math is not a constructor). if you use normal javascript floating point numbers in imul, you will experience a degrade in performance. thi...
Math.log() - JavaScript
thematics. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.log(x) parameters x a number. return value the natural logarithm (base e) of the given number. if the number is negative, nan is returned.
description if the value of x is 0, the return value is always -infinity. if the value of x is negative, the return value is always nan. because log() is a static method of math, you always use it as math.log(), rather than as a method of a math object you created (math is not a constructor). if you need the natural log of 2 or 10, use the constants math.ln2 or math.ln10 . if you need a logarithm to bas...
Math.log10() - JavaScript
that} \; 10^y = x the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.log10(x) parameters x a number. return value the base 10 logarithm of the given number. if the number is negative, nan is returned.
description if the value of x is less than 0, the return value is always nan. because log10() is a static method of math, you always use it as math.log10(), rather than as a method of a math object you created (math is not a constructor). this function is the equivalent of math.log(x) / math.log(10). for log10(e) use the constant math.log10e which is 1 / math.ln10. examples using math.log10() math.l...
Math.log1p() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.log1p(x) parameters x a number. return value the natural logarithm (base e) of 1 plus the given number. if the number is less than -1, nan is returned.
description for very small values of x, adding 1 can reduce or eliminate precision. the double floats used in js give you about 15 digits of precision. 1 + 1e-15 = 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. when you calculate log(1 + x), you should get an answer very close to x, if x is small (that's why the...
Math.log2() - JavaScript
ch that} \; 2^y = x the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.log2(x) parameters x a number. return value the base 2 logarithm of the given number. if the number is negative, nan is returned.
description if the value of x is less than 0, the return value is always nan. because log2() is a static method of math, you always use it as math.log2(), rather than as a method of a math object you created (math is not a constructor). this function is the equivalent of math.log(x) / math.log(2). for log2(e) use the constant math.log2e which is 1 / math.ln2. polyfill this polyfill emulates the math.
Math.max() - JavaScript
d in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.max([value1[, value2[, ...]]]) parameters value1, value2, ... numbers. return value the largest of the given numbers. if at least one of the arguments cannot be converted to a number, nan is returned.
description because math is not a constructor, max() is a static method of math (you always use it as math.max(), rather than as a method of an instanced math object). -infinity is the initial comparant because almost every other value is bigger, that's why when no arguments are given, -infinity is returned. if at least one of arguments cannot be converted to a number, the result is nan. examples using ...
Math.min() - JavaScript
ctive-examples and send us a pull request. syntax math.min([value1[, value2[, ...]]]) parameters value1, value2, ... zero or more numbers among which the lowest value will be selected and returned. return value the smallest of the given numbers. if any one or more of the parameters cannot be converted into a number, nan is returned. the result is infinity if no parameters are provided.
description because min() is a static method of math, you always use it as math.min(), rather than as a method of a math object you created (math is not a constructor). if no arguments are given, the result is infinity. if at least one of arguments cannot be converted to a number, the result is nan. examples using math.min() this finds the min of x and y and assigns it to z: var x = 10, y = -20; var z...
Math.pow() - JavaScript
is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.pow(base, exponent) parameters base the base number. exponent the exponent used to raise the base. return value a number representing the given base taken to the power of the given exponent.
description the math.pow() function returns the base to the exponent power, that is, baseexponent, the base and the exponent are in decimal numeral system. because pow() is a static method of math, you always use it as math.pow(), rather than as a method of a math object you created (math has no constructor). if the base is negative and the exponent is not an integer, the result is nan. examples using ma...
Math.round() - JavaScript
f a number rounded to the nearest integer. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.round(x) parameters x a number. return value the value of the given number rounded to the nearest integer.
description if the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. if it is less than 0.5, the argument is rounded to the integer with the lower absolute value. if the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. note that this differs from many languages' round()...
Math.sign() - JavaScript
. syntax math.sign(x) parameters x a number. if this argument is not a number, it is implicitly converted to one. return value a number representing the sign of the given argument: if the argument is positive, returns 1. if the argument is negative, returns -1. if the argument is positive zero, returns 0. if the argument is negative zero, returns -0. otherwise, nan is returned.
description because sign() is a static method of math, you always use it as math.sign(), rather than as a method of a math object you created (math is not a constructor). polyfill if (!math.sign) { math.sign = function(x) { // if x is nan, the result is nan. // if x is -0, the result is -0. // if x is +0, the result is +0. // if x is negative and not -0, the result is -1. // if x is...
Math.sin() - JavaScript
the math.sin() function returns the sine of a number. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.sin(x) parameters x a number (given in radians). return value the sine of the given number.
description the math.sin() method returns a numeric value between -1 and 1, which represents the sine of the angle given in radians. because sin() is a static method of math, you always use it as math.sin(), rather than as a method of a math object you created (math is not a constructor). examples using math.sin() math.sin(0); // 0 math.sin(1); // 0.8414709848078965 math.sin(math.pi / ...
Math.sinh() - JavaScript
-x2\mathtt{\operatorname{math.sinh(x)}} = \frac{e^x - e^{-x}}{2} the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.sinh(x) parameters x a number. return value the hyperbolic sine of the given number.
description because sinh() is a static method of math, you always use it as math.sinh(), rather than as a method of a math object you created (math is not a constructor). polyfill this can be emulated with the help of the math.exp() function: math.sinh = math.sinh || function(x) { return (math.exp(x) - math.exp(-x)) / 2; } or using only one call to the math.exp() function: math.sinh = math.sinh || ...
Math.sqrt() - JavaScript
xt{such that} \; y^2 = x the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.sqrt(x) parameters x a number. return value the square root of the given number. if the number is negative, nan is returned.
description if the value of x is negative, math.sqrt() returns nan. because sqrt() is a static method of math, you always use it as math.sqrt(), rather than as a method of a math object you created (math is not a constructor). examples using math.sqrt() math.sqrt(9); // 3 math.sqrt(2); // 1.414213562373095 math.sqrt(1); // 1 math.sqrt(0); // 0 math.sqrt(-1); // nan math.sqrt(-0); // -0 specificatio...
Math.tan() - JavaScript
unction returns the tangent of a number. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.tan(x) parameters x a number representing an angle in radians. return value the tangent of the given number.
description the math.tan() method returns a numeric value that represents the tangent of the angle. because tan() is a static method of math, you always use it as math.tan(), rather than as a method of a math object you created (math is not a constructor). examples using math.tan() math.tan(1); // 1.5574077246549023 because the math.tan() function accepts radians, but it is often easier to work with d...
Math.tanh() - JavaScript
the math.tanh() function returns the hyperbolic tangent of a number, that is tanhx=sinhxcoshx=ex-e-xex+e-x=e2x-1e2x+1\tanh x = \frac{\sinh x}{\cosh x} = \frac {e^x - e^{-x}} {e^x + e^{-x}} = \frac{e^{2x} - 1}{e^{2x}+1} syntax math.tanh(x) parameters x a number. return value the hyperbolic tangent of the given number.
description because tanh() is a static method of math, you always use it as math.tanh(), rather than as a method of a math object you created (math is not a constructor). polyfill this can be emulated with the help of the math.exp() function: math.tanh = math.tanh || function(x){ var a = math.exp(+x), b = math.exp(-x); return a == infinity ? 1 : b == infinity ? -1 : (a - b) / (a + b); } examples using math.tanh() math.tanh(0); // 0 math.tanh(infinit...
Math.trunc() - JavaScript
s the integer part of a number by removing any fractional digits. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.trunc(x) parameters x a number. return value the integer part of the given number.
description unlike the other three math methods: math.floor(), math.ceil() and math.round(), the way math.trunc() works is very simple. it truncates (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. the argument passed to this method will be converted to number type implicitly. because trunc() is a static method of math, you always use i...
Math - JavaScript
all properties and methods of math are static. you refer to the constant pi as math.pi and you call the sine function as math.sin(x), where x is the method’s argument. constants are defined with the full precision of real numbers in javascript. note: many math functions have a precision that’s implementation-dependent. ...
NaN - JavaScript
er. property attributes of nan writable no enumerable no configurable no the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description nan is a property of the global object. in other words, it is a variable in global scope. the initial value of nan is not-a-number — the same as the value of number.nan. in modern browsers, nan is a non-configurable, non-writable property. even when this is not the case, avoid overriding it. it is rather rare to use nan in a program. there are five different types of operations that return n...
Number.EPSILON - JavaScript
e source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of number.epsilon writable no enumerable no configurable no
description the epsilon property has a value of approximately 2.2204460492503130808472633361816e-16, or 2-52. polyfill if (number.epsilon === undefined) { number.epsilon = math.pow(2, -52); } examples testing equality x = 0.2; y = 0.3; z = 0.1; equal = (math.abs(x - y + z) < number.epsilon); specifications specification ecmascript (ecma-262)the definition of 'number.epsilon'...
Number.MAX_SAFE_INTEGER - JavaScript
for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of number.max_safe_integer writable no enumerable no configurable no
description the max_safe_integer constant has a value of 9007199254740991 (9,007,199,254,740,991 or ~9 quadrillion). the reasoning behind that number is that javascript uses double-precision floating-point format numbers as specified in ieee 754 and can only safely represent numbers between -(253 - 1) and 253 - 1. safe in this context refers to the ability to represent integers exactly and to correctly com...
Number.MAX_VALUE - JavaScript
source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of number.max_value writable no enumerable no configurable no
description the max_value property has a value of approximately 1.79e+308, or 21024. values larger than max_value are represented as infinity. because max_value is a static property of number, you always use it as number.max_value, rather than as a property of a number object you created. examples using max_value the following code multiplies two numeric values. if the result is less than or equal to m...
Number.MIN_SAFE_INTEGER - JavaScript
for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of number.min_safe_integer writable no enumerable no configurable no
description the min_safe_integer constant has a value of -9007199254740991 (-9,007,199,254,740,991 or about -9 quadrillion). the reasoning behind that number is that javascript uses double-precision floating-point format numbers as specified in ieee 754 and can only safely represent numbers between -(253 - 1) and 253 - 1. see number.issafeinteger() for more information. because min_safe_integer is a stati...
Number.MIN_VALUE - JavaScript
source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of number.min_value writable no enumerable no configurable no
description the min_value property is the number closest to 0, not the most negative number, that javascript can represent. min_value has a value of approximately 5e-324. values smaller than min_value ("underflow values") are converted to 0. because min_value is a static property of number, you always use it as number.min_value, rather than as a property of a number object you created. examples using mi...
Number.NEGATIVE_INFINITY - JavaScript
or this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of number.negative_infinity writable no enumerable no configurable no
description the value of number.negative_infinity is the same as the negative value of the global object's infinity property. this value behaves slightly differently than mathematical infinity: any positive value, including positive_infinity, multiplied by negative_infinity is negative_infinity. any negative value, including negative_infinity, multiplied by negative_infinity is positive_infinity. any ...
Number.POSITIVE_INFINITY - JavaScript
or this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of number.positive_infinity writable no enumerable no configurable no
description the value of number.positive_infinity is the same as the value of the global object's infinity property. this value behaves slightly differently than mathematical infinity: any positive value, including positive_infinity, multiplied by positive_infinity is positive_infinity. any negative value, including negative_infinity, multiplied by positive_infinity is negative_infinity. any positive ...
Number.isFinite() - JavaScript
urce for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax number.isfinite(value) parameters value the value to be tested for finiteness. return value a boolean indicating whether or not the given value is a finite number.
description in comparison to the global isfinite() function, this method doesn't forcibly convert the parameter to a number. this means only values of the type number, that are also finite, return true. polyfill if (number.isfinite === undefined) number.isfinite = function(value) { return typeof value === 'number' && isfinite(value); } examples using isfinite number.isfinite(infinity); // false ...
Number.isInteger() - JavaScript
ce for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax number.isinteger(value) parameters value the value to be tested for being an integer. return value a boolean indicating whether or not the given value is an integer.
description if the target value is an integer, return true, otherwise return false. if the value is nan or infinity, return false. the method will also return true for floating point numbers that can be represented as integer. polyfill number.isinteger = number.isinteger || function(value) { return typeof value === 'number' && isfinite(value) && math.floor(value) === value; }; examples using...
Number.isNaN() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax number.isnan(value) parameters value the value to be tested for nan. return value true if the given value is nan and its type is number; otherwise, false.
description due to both equality operators, == and ===, evaluating to false when checking if nan is nan, the function number.isnan() has become necessary. this situation is unlike all other possible value comparisons in javascript. in comparison to the global isnan() function, number.isnan() doesn't suffer the problem of forcefully converting the parameter to a number. this means it is now safe to pass val...
Number.prototype.toFixed() - JavaScript
ent is omitted, it is treated as 0. return value a string representing the given number using fixed-point notation. exceptions rangeerror if digits is too small or too large. values between 0 and 100, inclusive, will not cause a rangeerror. implementations are allowed to support larger and smaller values as chosen. typeerror if this method is invoked on an object that is not a number.
description tofixed() returns a string representation of numobj that does not use exponential notation and has exactly digits digits after the decimal place. the number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. if the absolute value of numobj is greater or equal to 1e+21, this method simply calls number.prototype.tostring() and re...
Number.prototype.toPrecision() - JavaScript
recision() method returns a string representing the number object to the specified precision. syntax numobj.toprecision([precision]) parameters precision optional an integer specifying the number of significant digits. return value a string representing a number object in fixed-point or exponential notation rounded to precision significant digits. see the discussion of rounding in the
description of the number.prototype.tofixed() method, which also applies to toprecision(). if the precision argument is omitted, behaves as number.prototype.tostring(). if the precision argument is a non-integer value, it is rounded to the nearest integer. exceptions rangeerror if precision is not between 1 and 100 (inclusive), a rangeerror is thrown. implementations are allowed to support larger and s...
Number.prototype.toString() - JavaScript
/mdn/interactive-examples and send us a pull request. syntax numobj.tostring([radix]) parameters radix optional. an integer in the range 2 through 36 specifying the base to use for representing numeric values. return value a string representing the specified number object. exceptions rangeerror if tostring() is given a radix less than 2 or greater than 36, a rangeerror is thrown.
description the number object overrides the tostring() method of the object object. (it does not inherit object.prototype.tostring()). for number objects, the tostring() method returns a string representation of the object in the specified radix. the tostring() method parses its first argument, and attempts to return a string representation in the specified radix (base). for radices above 10, the letters o...
Number.prototype.valueOf() - JavaScript
returns the wrapped primitive value of a number object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax numobj.valueof() return value a number representing the primitive value of the specified number object.
description this method is usually called internally by javascript and not explicitly in web code. examples using valueof let numobj = new number(10) console.log(typeof numobj) // object let num = numobj.valueof() console.log(num) // 10 console.log(typeof num) // number specifications specification ecmascript (ecma-262)the definition of 'number.prototype.valueof' in ...
Number - JavaScript
. a number literal like 37 in javascript code is a floating-point value, not an integer. there is no separate integer type in common everyday use. (javascript now has a bigint type, but it was not designed to replace number for everyday uses. 37 is still a number, not a bigint.) number may also be expressed in literal forms like 0b101, 0o13, 0x0a. learn more on numeric lexical grammar here.
description when used as a function, number(value) converts a string or other value to the number type. if the value can't be converted, it returns nan. literal syntax 123 // one-hundred twenty-three 123.0 // same 123 === 123.0 // true function syntax number('123') // returns the number 123 number('123') === 123 // true number("unicorn") // nan number(undefined) // nan constructor number(...
Object.prototype.__defineGetter__() - JavaScript
d not be used since better alternatives exist. the __definegetter__ method binds an object's property to a function to be called when that property is looked up. syntax obj.__definegetter__(prop, func) parameters prop a string containing the name of the property to bind to the given function. func a function to be bound to a lookup of the specified property. return value undefined.
description the __definegetter__ allows a getter to be defined on a pre-existing object. examples non-standard and deprecated way var o = {}; o.__definegetter__('gimmefive', function() { return 5; }); console.log(o.gimmefive); // 5 standard-compliant ways // using the get operator var o = { get gimmefive() { return 5; } }; console.log(o.gimmefive); // 5 // using object.defineproperty var o = {}; obje...
Object.prototype.__defineSetter__() - JavaScript
x obj.__definesetter__(prop, fun) parameters prop a string containing the name of the property to be bound to the given function. fun a function to be called when there is an attempt to set the specified property. this function takes the form function(val) { . . . } val an alias for the variable that holds the value attempted to be assigned to prop. return value undefined.
description the __definesetter__ method allows a setter to be defined on a pre-existing object. examples non-standard and deprecated way var o = {}; o.__definesetter__('value', function(val) { this.anothervalue = val; }); o.value = 5; console.log(o.value); // undefined console.log(o.anothervalue); // 5 standard-compliant ways // using the set operator var o = { set value(val) { this.anothervalue = val...
Object.prototype.__lookupGetter__() - JavaScript
the __lookupgetter__ method returns the function bound as a getter to the specified property. syntax obj.__lookupgetter__(sprop) parameters sprop a string containing the name of the property whose getter should be returned. return value the function bound as a getter to the specified property.
description if a getter has been defined for an object's property, it's not possible to reference the getter function through that property, because that property refers to the return value of that function. __lookupgetter__ can be used to obtain a reference to the getter function. it is now possible to do this in a standardized way using object.getownpropertydescriptor() and object.getprototypeof(). examples standard-compliant and non-standard ways to get a property getter var obj = { get ...
Object.prototype.__lookupSetter__() - JavaScript
the __lookupsetter__ method returns the function bound as a setter to the specified property. syntax obj.__lookupsetter__(sprop) parameters sprop a string containing the name of the property whose setter should be returned. return value the function bound as a setter to the specified property.
description if a setter has been defined for an object's property, it was not possible to reference the setter function through that property, because that property refers to the return value of that function. __lookupsetter__ can be used to obtain a reference to the setter function. it is now possible to do this in a standardized way using object.getownpropertydescriptor(). examples standard-compliant and non-standard ways to get a property setter var obj = { set foo(value) { this.bar ...
Object.assign() - JavaScript
examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.assign(target, ...sources) parameters target the target object — what to apply the sources’ properties to, which is returned after it is modified. sources the source object(s) — objects containing the properties you want to apply. return value the target object.
description properties in the target object are overwritten by properties in the sources if they have the same key. later sources' properties overwrite earlier ones. the object.assign() method only copies enumerable and own properties from a source object to a target object. it uses [[get]] on the source and [[set]] on the target, so it will invoke getters and setters. therefore it assigns properties, vers...
Object.prototype.constructor - JavaScript
the constructor property returns a reference to the object constructor function that created the instance object. note that the value of this property is a reference to the function itself, not a string containing the function's name. the value is only read-only for primitive values such as 1, true, and "test".
description all objects (with the exception of objects created with object.create(null)) will have a constructor property. objects created without the explicit use of a constructor function (such as object- and array-literals) will have a constructor property that points to the fundamental object constructor type for that object. let o = {} o.constructor === object // true let o = new object o.constructor === object // true let a = [] a.constructor === array // true let a = new array a...
Object.defineProperty() - JavaScript
e clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.defineproperty(obj, prop, descriptor) parameters obj the object on which to define the property. prop the name or symbol of the property to be defined or modified. descriptor the descriptor for the property being defined or modified. return value the object that was passed to the function.
description this method allows a precise addition to or modification of a property on an object. normal property addition through assignment creates properties which show up during property enumeration (for...in loop or object.keys method), whose values may be changed, and which may be deleted. this method allows these extra details to be changed from their defaults. by default, values added using object.de...
Object.entries() - JavaScript
y. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.entries(obj) parameters obj the object whose own enumerable string-keyed property [key, value] pairs are to be returned. return value an array of the given object's own enumerable string-keyed property [key, value] pairs.
description object.entries() returns an array whose elements are arrays corresponding to the enumerable string-keyed property [key, value] pairs found directly upon object. the ordering of the properties is the same as that given by looping over the property values of the object manually. polyfill to add compatible object.entries() support in older environments that do not natively support it, you can use...
Object.freeze() - JavaScript
turns the same object that was passed in. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.freeze(obj) parameters obj the object to freeze. return value the object that was passed to the function.
description nothing can be added to or removed from the properties set of a frozen object. any attempt to do so will fail, either silently or by throwing a typeerror exception (most commonly, but not exclusively, when in strict mode). for data properties of a frozen object, values cannot be changed, the writable and configurable attributes are set to false. accessor properties (getters and setters) work th...
Object.fromEntries() - JavaScript
epository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.fromentries(iterable); parameters iterable an iterable such as array or map or other objects implementing the iterable protocol. return value a new object whose properties are given by the entries of the iterable.
description the object.fromentries() method takes a list of key-value pairs and returns a new object whose properties are given by those entries. the iterable argument is expected to be an object that implements an @@iterator method, that returns an iterator object, that produces a two element array-like object, whose first element is a value that will be used as a property key, and whose second element is ...
Object.getOwnPropertyDescriptor() - JavaScript
tion. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.getownpropertydescriptor(obj, prop) parameters obj the object in which to look for the property. prop the name or symbol of the property whose
description is to be retrieved. return value a property descriptor of the given property if it exists on the object, undefined otherwise.
description this method permits examination of the precise
description of a property. a property in javascript consists of either a string-valued name or a symbol and a property descriptor. further information about property descriptor types and their attributes can b...
Object.getOwnPropertyDescriptors() - JavaScript
the object.getownpropertydescriptors() method returns all own property descriptors of a given object. syntax object.getownpropertydescriptors(obj) parameters obj the object for which to get all own property descriptors. return value an object containing all own property descriptors of an object. might be an empty object, if there are no properties.
description this method permits examination of the precise
description of all own properties of an object. a property in javascript consists of either a string-valued name or a symbol and a property descriptor. further information about property descriptor types and their attributes can be found in object.defineproperty(). a property descriptor is a record with some of the following attributes: value the value associated with the proper...
Object.getOwnPropertyNames() - JavaScript
() method returns an array of all properties (including non-enumerable properties except for those which use symbol) found directly in a given object. syntax object.getownpropertynames(obj) parameters obj the object whose enumerable and non-enumerable properties are to be returned. return value an array of strings that corresponds to the properties found directly in the given object.
description object.getownpropertynames() returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object obj. the ordering of the enumerable properties in the array is consistent with the ordering exposed by a for...in loop (or by object.keys()) over the properties of the object. the ordering of the non-enumerable properties in the a...
Object.getOwnPropertySymbols() - JavaScript
example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.getownpropertysymbols(obj) parameters obj the object whose symbol properties are to be returned. return value an array of all symbol properties found directly upon the given object.
description similar to object.getownpropertynames(), you can get all symbol properties of a given object as an array of symbols. note that object.getownpropertynames() itself does not contain the symbol properties of an object and only the string properties. as all objects have no own symbol properties initially, object.getownpropertysymbols() returns an empty array unless you have set symbol properties on...
Object.prototype.hasOwnProperty() - JavaScript
e is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax obj.hasownproperty(prop) parameters prop the string name or symbol of the property to test. return value a boolean indicating whether or not the object has the specified property as own property.
description all descendents of object inherit the hasownproperty method. this method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in operator, this method does not check for a property in the object's prototype chain. if an object is an array, hasownproperty method can check whether an index exists. note hasownproperty returns true e...
Object.is() - JavaScript
the object.is() method determines whether two values are the same value. syntax object.is(value1, value2); parameters value1 the first value to compare. value2 the second value to compare. return value a boolean indicating whether or not the two arguments are the same value.
description object.is() determines whether two values are the same value. two values are the same if one of the following holds: both undefined both null both true or both false both strings of the same length with the same characters in the same order both the same object (means both object have same reference) both numbers and both +0 both -0 both nan or both non-zero and both not nan and both have the same value this is not the same as being equal according to the == operator. the =...
Object.isExtensible() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.isextensible(obj) parameters obj the object which should be checked. return value a boolean indicating whether or not the given object is extensible.
description objects are extensible by default: they can have new properties added to them, and (in engines that support __proto__) their __proto__ property can be modified. an object can be marked as non-extensible using object.preventextensions(), object.seal(), or object.freeze(). examples using object.isextensible // new objects are extensible. var empty = {}; object.isextensible(empty); // === true ...
Object.isFrozen() - JavaScript
ozen. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.isfrozen(obj) parameters obj the object which should be checked. return value a boolean indicating whether or not the given object is frozen.
description an object is frozen if and only if it is not extensible, all its properties are non-configurable, and all its data properties (that is, properties which are not accessor properties with getter or setter components) are non-writable. examples using object.isfrozen // a new object is extensible, so it is not frozen. object.isfrozen({}); // === false // an empty object which is not extensible /...
Object.prototype.isPrototypeOf() - JavaScript
in is checked against afunction.prototype, not against afunction itself. syntax prototypeobj.isprototypeof(object) parameters object the object whose prototype chain will be searched. return value a boolean indicating whether the calling object lies in the prototype chain of the specified object. errors thrown typeerror a typeerror is thrown if prototypeobj is undefined or null.
description the isprototypeof() method allows you to check whether or not an object exists within another object's prototype chain. examples using isprototypeof this example demonstrates that baz.prototype, bar.prototype, foo.prototype and object.prototype exist in the prototype chain for object baz: function foo() {} function bar() {} function baz() {} bar.prototype = object.create(foo.prototype); baz...
Object.isSealed() - JavaScript
aled. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.issealed(obj) parameters obj the object which should be checked. return value a boolean indicating whether or not the given object is sealed.
description returns true if the object is sealed, otherwise false. an object is sealed if it is not extensible and if all its properties are non-configurable and therefore not removable (but not necessarily non-writable). examples using object.issealed // objects aren't sealed by default. var empty = {}; object.issealed(empty); // === false // if you make an empty object non-extensible, // it is vacuous...
Object.keys() - JavaScript
ored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.keys(obj) parameters obj the object of which the enumerable's own properties are to be returned. return value an array of strings that represent all the enumerable properties of the given object.
description object.keys() returns an array whose elements are strings corresponding to the enumerable properties found directly upon object. the ordering of the properties is the same as that given by looping over the properties of the object manually. polyfill to add compatible object.keys support in older environments that do not natively support it, copy the following snippet: // from /docs/web/javasc...
Object.preventExtensions() - JavaScript
e object). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.preventextensions(obj) parameters obj the object which should be made non-extensible. return value the object being made non-extensible.
description an object is extensible if new properties can be added to it. object.preventextensions() marks an object as no longer extensible, so that it will never have properties beyond the ones it had at the time it was marked as non-extensible. note that the properties of a non-extensible object, in general, may still be deleted. attempting to add new properties to a non-extensible object will fail, eith...
Object.prototype.propertyIsEnumerable() - JavaScript
ple is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax obj.propertyisenumerable(prop) parameters prop the name of the property to test. return value a boolean indicating whether the specified property is enumerable and is the object's own property.
description every object has a propertyisenumerable method. this method can determine whether the specified property in an object can be enumerated by a for...in loop, with the exception of properties inherited through the prototype chain. if the object does not have the specified property, this method returns false. examples a basic use of propertyisenumerable the following example shows the use of prop...
Object.prototype.__proto__ - JavaScript
f/reflect.getprototypeof and object.setprototypeof/reflect.setprototypeof (though still, setting the [[prototype]] of an object is a slow operation that should be avoided if performance is a concern). the __proto__ property can also be used in an object literal definition to set the object [[prototype]] on creation, as an alternative to object.create(). see: object initializer / literal syntax.
description the __proto__ getter function exposes the value of the internal [[prototype]] of an object. for objects created using an object literal, this value is object.prototype. for objects created using array literals, this value is array.prototype. for functions, this value is function.prototype. for objects created using new fun, where fun is one of the built-in constructor functions provided by javas...
Object.seal() - JavaScript
an still be changed as long as they are writable. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.seal(obj) parameters obj the object which should be sealed. return value the object being sealed.
description by default, objects are extensible (new properties can be added to them). sealing an object prevents new properties from being added and marks all existing properties as non-configurable. this has the effect of making the set of properties on the object fixed and immutable. making all properties non-configurable also prevents them from being converted from data properties to accessor properties ...
Object.setPrototypeOf() - JavaScript
ssue, if you are concerned about performance, you should avoid setting the [[prototype]] of an object. instead, create a new object with the desired [[prototype]] using object.create(). syntax object.setprototypeof(obj, prototype) parameters obj the object which is to have its prototype set. prototype the object's new prototype (an object or null). return value the specified object.
description throws a typeerror exception if the object whose [[prototype]] is to be modified is non-extensible according to object.isextensible(). does nothing if the prototype parameter isn't an object or null (i.e., number, string, boolean, or undefined). otherwise, this method changes the [[prototype]] of obj to the new value. object.setprototypeof() is in the ecmascript 2015 specification. it is genera...
Object.prototype.toLocaleString() - JavaScript
ject. this method is meant to be overridden by derived objects for locale-specific purposes. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax obj.tolocalestring() return value a string representing the object.
description object's tolocalestring returns the result of calling tostring(). this function is provided to give objects a generic tolocalestring method, even though not all may use it. see the list below. objects overriding tolocalestring array: array.prototype.tolocalestring() number: number.prototype.tolocalestring() date: date.prototype.tolocalestring() typedarray: typedarray.prototype.tolocalest...
Object.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object. syntax object.tosource(); obj.tosource(); return value a string representing the source code of the object.
description the tosource() method returns the following values: for the built-in object object, tosource() returns the following string indicating that the source code is not available: function object() { [native code] } for instances of object, tosource() returns a string representing the source code. you can call tosource() while debugging to examine the contents of an object. overriding the tosource() method it is safe for objects to override the tosource() method. for example: function person(name) { this.name = name; } person.prototype.tosource = function person_tosou...
Object.prototype.toString() - JavaScript
the tostring() method returns a string representing the object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax obj.tostring() return value a string representing the object.
description every object has a tostring() method that is automatically called when the object is to be represented as a text value or when an object is referred to in a manner in which a string is expected. by default, the tostring() method is inherited by every object descended from object. if this method is not overridden in a custom object, tostring() returns "[object type]", where type is the object type. the following code illustrates ...
Object.prototype.valueOf() - JavaScript
mple is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.valueof() return value the primitive value of the specified object. a (unary) plus sign can sometimes be used as a shorthand for valueof, e.g. in +new number()). also see using unary plus.
description javascript calls the valueof method to convert an object to a primitive value. you rarely need to invoke the valueof method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected. by default, the valueof method is inherited by every object descended from object. every built-in core object overrides this method to return an appropriate value...
Object.values() - JavaScript
ive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.values(obj) parameters obj the object whose enumerable own property values are to be returned. return value an array containing the given object's own enumerable property values.
description object.values() returns an array whose elements are the enumerable property values found on the object. the ordering of the properties is the same as that given by looping over the property values of the object manually. polyfill to add compatible object.values support in older environments that do not natively support it, you can find a polyfill in the tc39/proposal-object-values-entries or ...
Object - JavaScript
overridden). however, an object may be deliberately created for which this is not true (e.g. ...
Promise.all() - JavaScript
se. a pending promise in all other cases. this returned promise is then resolved/rejected asynchronously (as soon as the stack is empty) when all the promises in the given iterable have resolved, or if any of the promises reject. see the example about "asynchronicity or synchronicity of promise.all" below. returned values will be in order of the promises passed, regardless of completion order.
description this method can be useful for aggregating the results of multiple promises. it is typically used when there are multiple asynchronous tasks that are dependent on one another to complete successfully, as it does not wait and will reject immediately upon any of the input promises rejecting. in comparison, the promise returned by promise.allsettled() will wait for all input promises to complete,...
Promise.any() - JavaScript
an array. return value an already resolved promise if the iterable passed is empty. an asynchronously resolved promise if the iterable passed contains no promises. a pending promise in all other cases. this returned promise is then resolved/rejected asynchronously (as soon as the stack is empty) when any of the promises in the given iterable resolve, or if all the promises have rejected.
description this method is useful for returning the first promise that fulfils. it short-circuits after a promise fulfils, so it does not wait for the other promises to complete once it finds one. unlike promise.all(), which returns an array of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). this can be beneficial if we need only one promise to fulfil but we d...
Promise.prototype.catch() - JavaScript
since it returns a promise, it can be chained in the same way as its sister method, then(). examples using and chaining the catch method var p1 = new promise(function(resolve, reject) { resolve('success'); }); p1.then(function(value) { console.log(value); // "success!" throw new error('oh, no!'); }).catch(function(e) {...
Promise.prototype.finally() - JavaScript
once the promise has been dealt with. this helps to avoid duplicating code in both the promise's then() and catch() handlers. syntax p.finally(onfinally); p.finally(function() { // settled (fulfilled or rejected) }); parameters onfinally a function called when the promise is settled. return value returns a promise whose finally handler is set to the specified function, onfinally.
description the finally() method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. the finally() method is very similar to calling .then(onfinally, onfinally) however there are a couple of differences: when creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it a f...
Promise.race() - JavaScript
itory. if you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax promise.race(iterable); parameters iterable an iterable object, such as an array. see iterable. return value a pending promise that asynchronously yields the value of the first promise in the given iterable to fulfill or reject.
description the race function returns a promise that is settled the same way (and takes the same value) as the first promise that settles amongst the promises of the iterable passed as an argument. if the iterable passed is empty, the promise returned will be forever pending. if the iterable contains one or more non-promise value and/or an already settled promise, then promise.race will resolve to the fir...
Promise.reject() - JavaScript
a given reason. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax promise.reject(reason); parameters reason reason why this promise rejected. return value a promise that is rejected with the given reason.
description the static promise.reject function returns a promise that is rejected. for debugging purposes and selective error catching, it is useful to make reason an instanceof error. examples using the static promise.reject() method promise.reject(new error('fail')).then(function() { // not called }, function(error) { console.error(error); // stacktrace }); specifications specification ...
Promise.resolve() - JavaScript
ayers of promise-like objects (e.g. a promise that resolves to a promise that resolves to something) into a single layer. syntax promise.resolve(value); parameters value argument to be resolved by this promise. can also be a promise or a thenable to resolve. return value a promise that is resolved with the given value, or the promise passed as value, if the value was a promise object.
description the static promise.resolve function returns a promise that is resolved. examples using the static promise.resolve method promise.resolve('success').then(function(value) { console.log(value); // "success" }, function(value) { // not called }); resolving an array var p = promise.resolve([1,2,3]); p.then(function(v) { console.log(v[0]); // 1 }); resolving another promise var original...
Promise.prototype.then() - JavaScript
// using settimeout we can postpone the execution of a function to the moment the stack is empty settimeout(() => { console.log(thenprom); }); // logs, in order: // promise {[[promisestatus]]: "pending", [[promisevalue]]: undefined} // "this gets called after the end of the main stack. the value received and returned is: 33" // promise {[[promisestatus]]: "resolved", [[promisevalue]]: 33}
description as the then and promise.prototype.catch() methods return promises, they can be chained — an operation called composition. examples using the then method var p1 = new promise((resolve, reject) => { resolve('success!'); // or // reject(new error("error!")); }); p1.then(value => { console.log(value); // success! }, reason => { console.error(reason); // error! }); chaining the the...
Promise - JavaScript
it allows you to associate handlers with an asynchronous action's eventual success value or failure reason. ...
handler.apply() - JavaScript
a pull request. syntax const p = new proxy(target, { apply: function(target, thisarg, argumentslist) { } }); parameters the following parameters are passed to the apply() method. this is bound to the handler. target the target object. thisarg the this argument for the call. argumentslist the list of arguments for the call. return value the apply() method can return any value.
description the handler.apply() method is a trap for a function call. interceptions this trap can intercept these operations: proxy(...args) function.prototype.apply() and function.prototype.call() reflect.apply() invariants if the following invariants are violated, the proxy will throw a typeerror. the target must be a callable itself. that is, it must be a function object. examples trapping a...
handler.construct() - JavaScript
y(target, { construct: function(target, argumentslist, newtarget) { } }); parameters the following parameters are passed to the construct() method. this is bound to the handler. target the target object. argumentslist the list of arguments for the constructor. newtarget the constructor that was originally called, p above. return value the construct method must return an object.
description the handler.construct() method is a trap for the new operator. interceptions this trap can intercept these operations: new proxy(...args) reflect.construct() invariants if the following invariants are violated, the proxy will throw a typeerror: the result must be an object. examples trapping the new operator the following code traps the new operator. const p = new proxy(function...
handler.defineProperty() - JavaScript
mples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(target, { defineproperty: function(target, property, descriptor) { } }); parameters the following parameters are passed to the defineproperty() method. this is bound to the handler. target the target object. property the name or symbol of the property whose
description is to be retrieved. descriptor the descriptor for the property being defined or modified. return value the defineproperty() method must return a boolean indicating whether or not the property has been successfully defined.
description the handler.defineproperty() method is a trap for object.defineproperty(). interceptions this trap can intercept these operations: object.defineproperty...
handler.deleteProperty() - JavaScript
arget, { deleteproperty: function(target, property) { } }); parameters the following parameters are passed to the deleteproperty() method. this is bound to the handler. target the target object. property the name or symbol of the property to delete. return value the deleteproperty() method must return a boolean indicating whether or not the property has been successfully deleted.
description the handler.deleteproperty() method is a trap for the delete operator. interceptions this trap can intercept these operations: property deletion: delete proxy[foo] and delete proxy.foo reflect.deleteproperty() invariants if the following invariants are violated, the proxy will throw a typeerror: a property cannot be deleted, if it exists as a non-configurable own property of the targ...
handler.get() - JavaScript
const p = new proxy(target, { get: function(target, property, receiver) { } }); parameters the following parameters are passed to the get() method. this is bound to the handler. target the target object. property the name or symbol of the property to get. receiver either the proxy or an object that inherits from the proxy. return value the get() method can return any value.
description the handler.get() method is a trap for getting a property value. interceptions this trap can intercept these operations: property access: proxy[foo]and proxy.bar inherited property access: object.create(proxy)[foo] reflect.get() invariants if the following invariants are violated, the proxy will throw a typeerror: the value reported for a property must be the same as the value of th...
handler.getOwnPropertyDescriptor() - JavaScript
active examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(target, { getownpropertydescriptor: function(target, prop) { } }); parameters the following parameters are passed to the getownpropertydescriptor() method. this is bound to the handler. target the target object. prop the name of the property whose
description should be retrieved. return value the getownpropertydescriptor() method must return an object or undefined.
description the handler.getownpropertydescriptor() method is a trap for object.getownpropertydescriptor(). interceptions this trap can intercept these operations: object.getownpropertydescriptor() reflect.getownpropertydescriptor() invariants if the following invariants are vi...
handler.getPrototypeOf() - JavaScript
ive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(obj, { getprototypeof(target) { ... } }); parameters the following parameter is passed to the getprototypeof() method. this is bound to the handler. target the target object. return value the getprototypeof() method must return an object or null.
description interceptions this trap can intercept these operations: object.getprototypeof() reflect.getprototypeof() __proto__ object.prototype.isprototypeof() instanceof invariants if the following invariants are violated, the proxy will throw a typeerror: getprototypeof() method must return an object or null. if target is not extensible, object.getprototypeof(proxy) method must return the s...
handler.has() - JavaScript
/github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(target, { has: function(target, prop) { } }); parameters the following parameters are passed to has() method. this is bound to the handler. target the target object. prop the name or symbol of the property to check for existence. return value the has() method must return a boolean value.
description the handler.has() method is a trap for the in operator. interceptions this trap can intercept these operations: property query: foo in proxy inherited property query: foo in object.create(proxy) with check: with(proxy) { (foo); } reflect.has() invariants if the following invariants are violated, the proxy will throw a typeerror: a property cannot be reported as non-existent, if it ...
handler.isExtensible() - JavaScript
tive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(target, { isextensible: function(target) { } }); parameters the following parameter is passed to the isextensible() method. this is bound to the handler. target the target object. return value the isextensible() method must return a boolean value.
description the handler.isextensible() method is a trap for object.isextensible(). interceptions this trap can intercept these operations: object.isextensible() reflect.isextensible() invariants if the following invariants are violated, the proxy will throw a typeerror: object.isextensible(proxy) must return the same value as object.isextensible(target). examples trapping of isextensible the...
handler.ownKeys() - JavaScript
he interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(target, { ownkeys: function(target) { } }); parameters the following parameter is passed to the ownkeys() method. this is bound to the handler. target the target object. return value the ownkeys() method must return an enumerable object.
description the handler.ownkeys() method is a trap for reflect.ownkeys(). interceptions this trap can intercept these operations: object.getownpropertynames() object.getownpropertysymbols() object.keys() reflect.ownkeys() invariants if the following invariants are violated, the proxy will throw a typeerror: the result of ownkeys() must be an array. the type of each array element is either a s...
handler.preventExtensions() - JavaScript
roject, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(target, { preventextensions: function(target) { } }); parameters the following parameter is passed to the preventextensions() method. this is bound to the handler. target the target object. return value the preventextensions() method must return a boolean value.
description the handler.preventextensions() method is a trap for object.preventextensions(). interceptions this trap can intercept these operations: object.preventextensions() reflect.preventextensions() invariants if the following invariants are violated, the proxy will throw a typeerror: object.preventextensions(proxy) only returns true if object.isextensible(proxy) is false. examples trapp...
handler.set() - JavaScript
roxy, and has no own property .name, but it has a proxy on its prototype chain. that proxy's set() handler will be called, and obj will be passed as the receiver. return value the set() method should return a boolean value. return true to indicate that assignment succeeded. if the set() method returns false, and the assignment happened in strict-mode code, a typeerror will be thrown.
description the handler.set() method is a trap for setting property value. interceptions this trap can intercept these operations: property assignment: proxy[foo] = bar and proxy.foo = bar inherited property assignment: object.create(proxy)[foo] = bar reflect.set() invariants if the following invariants are violated, the proxy will throw a typeerror: cannot change the value of a property to be ...
handler.setPrototypeOf() - JavaScript
const p = new proxy(target, { setprototypeof: function(target, prototype) { } }); parameters the following parameters are passed to the setprototypeof() method. this is bound to the handler. target the target object. prototype the object's new prototype or null. return value the setprototypeof() method returns true if the [[prototype]] was successfully changed, otherwise false.
description the handler.setprototypeof() method is a trap for object.setprototypeof(). interceptions this trap can intercept these operations: object.setprototypeof() reflect.setprototypeof() invariants if the following invariants are violated, the proxy will throw a typeerror: if target is not extensible, the prototype parameter must be the same value as object.getprototypeof(target). example...
Proxy() constructor - JavaScript
the proxy() constructor is used to create proxy objects. syntax new proxy(target, handler) parameters target a target object to wrap with proxy. it can be any sort of object, including a native array, a function, or even another proxy. handler an object whose properties are functions that define the behavior of the proxy when an operation is performed on it.
description use the proxy() constructor to create a new proxy object. this constructor takes two mandatory arguments: target is the object for which you want to create the proxy handler is the object that defines the custom behavior of the proxy. an empty handler will create a proxy that behaves, in almost all respects, exactly like the target. by defining any of a set group of functions on the handler object, you can customise...
Proxy.revocable() - JavaScript
proxy object. syntax proxy.revocable(target, handler); parameters target a target object to wrap with proxy. it can be any sort of object, including a native array, a function, or even another proxy. handler an object whose properties are functions define the behavior of proxy p when an operation is performed on it. return value a newly created revocable proxy object is returned.
description a revocable proxy is an object with following two properties {proxy: proxy, revoke: revoke}. proxy a proxy object created with new proxy(target, handler) call. revoke a function with no argument to invalidate (switch off) the proxy. if the revoke() function gets called, the proxy becomes unusable: any trap to a handler will throw a typeerror. once a proxy is revoked, it will remain revok...
Proxy - JavaScript
the proxy object enables you to create a proxy for another object, which can intercept and redefine fundamental operations for that object.
description a proxy is created with two parameters: target: the original object which you want to proxy handler: an object that defines which operations will be intercepted and how to redefine intercepted operations. for example, this code defines a simple target with just two properties, and an even simpler handler with no properties: const target = { message1: "hello", message2: "everyone" }; const handler1 = {}; const proxy1 = new proxy(target, handler1); because the handler is empty, this proxy behaves just like the original target: console.log(proxy1.message1); // hello console.log(proxy1.message2); // everyone to customise the proxy, we...
RangeError() constructor - JavaScript
the rangeerror() constructor creates an error when a value is not in the set or range of allowed values. syntax new rangeerror([message[, filename[, linenumber]]]) parameters message optional human-readable
description of the error. filename optional the name of the file containing the code that caused the exception linenumber optional the line number of the code that caused the exception examples using rangeerror (for numeric values) function check(n) { if( !(n >= -500 && n <= 500) ) { throw new rangeerror("the argument must be between -500 and 500.") } } try { check(2000) } catch(error) { if (error instanceof rangeerror) { // handle the error } } using rangeerror (for non-numeric values) function check(value) { if(["apple", "banan...
RangeError - JavaScript
this can be encountered when: passing a value that is not one of the allowed string values to string.prototype.normalize(), or when attempting to create an array of an illegal length with the array constructor, or when passing bad values to the numeric methods number.prototype.toexponential(), number.prototype.tofixed() or number.prototype.toprecision(). constructor rangeerror() creates a new rangeerror object. ...
ReferenceError() constructor - JavaScript
filename optional optional. the name of the file containing the code that caused the exception. linenumber optional optional. the line number of the code that caused the exception. ...
Reflect.apply() - JavaScript
argumentslist) parameters target the target function to call. thisargument the value of this provided for the call to target. argumentslist an array-like object specifying the arguments with which target should be called. return value the result of calling the given target function with the specified this value and arguments. exceptions a typeerror, if the target is not callable.
description in es5, you typically use the function.prototype.apply() method to call a function with a given this value and arguments provided as an array (or an array-like object). function.prototype.apply.call(math.floor, undefined, [1.75]); with reflect.apply() this becomes less verbose and easier to understand. examples using reflect.apply() reflect.apply(math.floor, undefined, [1.75]); // 1; refle...
Reflect.construct() - JavaScript
ch target should be called. newtarget optional the constructor whose prototype should be used. see also the new.target operator. if newtarget is not present, its value defaults to target. return value a new instance of target (or newtarget, if present), initialized by target as a constructor with the given argumentslist. exceptions a typeerror, if target or newtarget are not constructors.
description reflect.construct() allows you to invoke a constructor with a variable number of arguments. (this would also be possible by using the spread syntax combined with the new operator.) let obj = new foo(...args) let obj = reflect.construct(foo, args) reflect.construct() vs object.create() prior to the introduction of reflect, objects could be constructed using an arbitrary combination of constru...
Reflect.defineProperty() - JavaScript
roperty(target, propertykey, attributes) parameters target the target object on which to define the property. propertykey the name of the property to be defined or modified. attributes the attributes for the property being defined or modified. return value a boolean indicating whether or not the property was successfully defined. exceptions a typeerror, if target is not an object.
description the reflect.defineproperty method allows precise addition to or modification of a property on an object. for more details, see the object.defineproperty which is similar. one key difference: object.defineproperty returns the object or throws a typeerror if the property has not been successfully defined. reflect.defineproperty, however, simply returns a boolean indicating whether or not the pro...
Reflect.deleteProperty() - JavaScript
https://github.com/mdn/interactive-examples and send us a pull request. syntax reflect.deleteproperty(target, propertykey) parameters target the target object on which to delete the property. propertykey the name of the property to be deleted. return value a boolean indicating whether or not the property was successfully deleted. exceptions a typeerror, if target is not an object.
description the reflect.deleteproperty method allows you to delete a property on an object. it returns a boolean indicating whether or not the property was successfully deleted. it is almost identical to the non-strict delete operator. examples using reflect.deleteproperty() let obj = { x: 1, y: 2 } reflect.deleteproperty(obj, 'x') // true obj // { y: 2 } let arr = [1, 2, ...
Reflect.get() - JavaScript
ey[, receiver]) parameters target the target object on which to get the property. propertykey the name of the property to get. receiver optional the value of this provided for the call to target if a getter is encountered. when used with proxy, it can be an object that inherits from target. return value the value of the property. exceptions a typeerror, if target is not an object.
description the reflect.get method allows you to get a property on an object. it is like the property accessor syntax as a function. examples using reflect.get() // object let obj = { x: 1, y: 2 } reflect.get(obj, 'x') // 1 // array reflect.get(['zero', 'one'], 1) // "one" // proxy with a get handler let x = {p: 1}; let obj = new proxy(x, { get(t, k, r) { return k + 'bar' } }) reflect.get(ob...
Reflect.getOwnPropertyDescriptor() - JavaScript
us a pull request. syntax reflect.getownpropertydescriptor(target, propertykey) parameters target the target object in which to look for the property. propertykey the name of the property to get an own property descriptor for. return value a property descriptor object if the property exists in target object; otherwise, undefined. exceptions a typeerror, if target is not an object.
description the reflect.getownpropertydescriptor method returns a property descriptor of the given property if it exists in the target object, undefined otherwise. the only difference to object.getownpropertydescriptor() is how non-object targets are handled. examples using reflect.getownpropertydescriptor() reflect.getownpropertydescriptor({x: 'hello'}, 'x') // {value: "hello", writable: true, enumerabl...
Reflect.getPrototypeOf() - JavaScript
te to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax reflect.getprototypeof(target) parameters target the target object of which to get the prototype. return value the prototype of the given object. if there are no inherited properties, null is returned. exceptions a typeerror, if target is not an object.
description the reflect.getprototypeof method returns the prototype (i.e. the value of the internal [[prototype]] property) of the specified object. examples using reflect.getprototypeof() reflect.getprototypeof({}) // object.prototype reflect.getprototypeof(object.prototype) // null reflect.getprototypeof(object.create(null)) // null compared to object.getprototypeof() // same res...
Reflect.has() - JavaScript
s project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax reflect.has(target, propertykey) parameters target the target object in which to look for the property. propertykey the name of the property to check. return value a boolean indicating whether or not the target has the property. exceptions a typeerror, if target is not an object.
description the reflect.has method allows you to check if a property is in an object. it works like the in operator as a function. examples using reflect.has() reflect.has({x: 0}, 'x') // true reflect.has({x: 0}, 'y') // false // returns true for properties in the prototype chain reflect.has({x: 0}, 'tostring') // proxy with .has() handler method obj = new proxy({}, { has(t, k) { return k.startswit...
Reflect.isExtensible() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax reflect.isextensible(target) parameters target the target object which to check if it is extensible. return value a boolean indicating whether or not the target is extensible. exceptions a typeerror, if target is not an object.
description the reflect.isextensible method allows you determine if an object is extensible (whether it can have new properties added to it). it is the same method as object.isextensible(). examples using reflect.isextensible() see also object.isextensible(). // new objects are extensible. let empty = {} reflect.isextensible(empty) // === true // ...but that can be changed. reflect.preventextensions(e...
Reflect.ownKeys() - JavaScript
github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax reflect.ownkeys(target) parameters target the target object from which to get the own keys. return value an array of the target object's own property keys. exceptions a typeerror, if target is not an object.
description the reflect.ownkeys method returns an array of the target object's own property keys. its return value is equivalent to object.getownpropertynames(target).concat(object.getownpropertysymbols(target)). examples using reflect.ownkeys() reflect.ownkeys({z: 3, y: 2, x: 1}) // [ "z", "y", "x" ] reflect.ownkeys([]) // ["length"] let sym = symbol.for('comet') let sym2 = symbol.for...
Reflect.preventExtensions() - JavaScript
o the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax reflect.preventextensions(target) parameters target the target object on which to prevent extensions. return value a boolean indicating whether or not the target was successfully set to prevent extensions. exceptions a typeerror, if target is not an object.
description the reflect.preventextensions() method allows you to prevent new properties from ever being added to an object (i.e., prevents future extensions to the object). it is similar to object.preventextensions(). examples using reflect.preventextensions() see also object.preventextensions(). // objects are extensible by default. let empty = {} reflect.isextensible(empty) // === true // ...but tha...
Reflect.set() - JavaScript
, receiver]) parameters target the target object on which to set the property. propertykey the name of the property to set. value the value to set. receiver optional the value of this provided for the call to target if a setter is encountered. return value a boolean indicating whether or not setting the property was successful. exceptions a typeerror, if target is not an object.
description the reflect.set method allows you to set a property on an object. it does property assignment and is like the property accessor syntax as a function. examples using reflect.set() // object let obj = {} reflect.set(obj, 'prop', 'value') // true obj.prop // "value" // array let arr = ['duck', 'duck', 'duck'] reflect.set(arr, 2, 'goose') // true arr[2] // "goose" // it can truncate an arra...
Reflect.setPrototypeOf() - JavaScript
nd send us a pull request. syntax reflect.setprototypeof(target, prototype) parameters target the target object of which to set the prototype. prototype the object's new prototype (an object or null). return value a boolean indicating whether or not the prototype was successfully set. exceptions a typeerror, if target is not an object or if prototype is neither an object nor null.
description the reflect.setprototypeof method changes the prototype (i.e. the value of the internal [[prototype]] property) of the specified object. examples using reflect.setprototypeof() reflect.setprototypeof({}, object.prototype) // true // it can change an object's [[prototype]] to null. reflect.setprototypeof({}, null) // true // returns false if target is not extensible. reflect.setprototypeof...
Reflect - JavaScript
you cannot use it with a new operator or invoke the reflect object as a function. all properties and methods of reflect are static (just like the math object). the reflect object provides the following static functions which have the same names as the proxy handler methods. ...
RegExp.prototype[@@match]() - JavaScript
b repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexp[symbol.match](str) parameters str a string that is a target of the match. return value an array containing the entire match result and any parentheses-captured matched results, or null if there were no matches.
description this method is called internally in string.prototype.match(). for example, the following two examples return same result. 'abc'.match(/a/); /a/[symbol.match]('abc'); this method exists for customizing match behavior within regexp subclasses. examples direct call this method can be used in almost the same way as string.prototype.match(), except the different this and the different argument...
RegExp.prototype[@@matchAll]() - JavaScript
of the regular expression against a string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexp[symbol.matchall](str) parameters str a string that is a target of the match. return value an iterator.
description this method is called internally in string.prototype.matchall(). for example, the following two examples return same result. 'abc'.matchall(/a/); /a/[symbol.matchall]('abc'); this method exists for customizing the behavior of matchall() in regexp subclasses. examples direct call this method can be used in almost the same way as string.prototype.matchall(), except for the different value of...
RegExp.prototype[@@replace]() - JavaScript
the specifying a string as a parameter section in string.prototype.replace() page. function (replacement) a function to be invoked to create the new substring. the arguments supplied to this function are described in the specifying a function as a parameter section in string.prototype.replace() page. return value a new string with some or all matches of a pattern replaced by a replacement.
description this method is called internally in string.prototype.replace() if the pattern argument is a regexp object. for example, following two examples return same result. 'abc'.replace(/a/, 'a'); /a/[symbol.replace]('abc', 'a'); this method exists for customizing replace behavior in regexp subclass. if pattern argument is not a regexp object, string.prototype.replace() doesn't call this method, nor...
RegExp.prototype[@@search]() - JavaScript
e to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexp[symbol.search](str) parameters str a string that is a target of the search. return value integer if successful, [@@search]() returns the index of the first match of the regular expression inside the string. otherwise, it returns -1.
description this method is called internally in string.prototype.search(). for example, the following two examples return the same result. 'abc'.search(/a/); /a/[symbol.search]('abc'); this method exists for customizing the search behavior in regexp subclasses. examples direct call this method can be used in almost the same way as string.prototype.search(), except the different this and the different ...
RegExp.prototype[@@split]() - JavaScript
meters str the target of the split operation. limit optional integer specifying a limit on the number of splits to be found. the [@@split]() method still splits on every match of this regexp pattern (or, in the syntax above, regexp), until the number of split items match the limit or the string falls short of this pattern. return value an array containing substrings as its elements.
description this method is called internally in string.prototype.split() if its separator argument is an object that has a @@split method, such as a regexp. for example, the following two examples return the same result. 'a-b-c'.split(/-/); /-/[symbol.split]('a-b-c'); this method exists for customizing the behavior of split() in regexp subclass. examples direct call this method can be used in almost t...
RegExp.prototype.compile() - JavaScript
; treat beginning and end characters (^ and $) as working over multiple lines (i.e., match the beginning or end of each line (delimited by \n or \r), not only the very beginning or end of the whole input string) y sticky; matches only from the index indicated by the lastindex property of this regular expression in the target string (and does not attempt to match from any later indexes).
description the compile method is deprecated. you can just use the regexp constructor to achieve the same effect. examples using compile() the following example shows how to recompile a regular expression with a new pattern and a new flag. var regexobj = new regexp('foo', 'gi'); regexobj.compile('new foo', 'g'); specifications specification ecmascript (ecma-262)the definition of 'r...
RegExp.prototype.dotAll - JavaScript
the dotall property indicates whether or not the "s" flag is used with the regular expression. dotall is a read-only property of an individual regular expression instance. property attributes of regexp.prototype.dotall writable no enumerable no configurable yes
description the value of dotall is a boolean and true if the "s" flag was used; otherwise, false. the "s" flag indicates that the dot special character (".") should additionally match the following line terminator ("newline") characters in a string, which it would not match otherwise: u+000a line feed (lf) ("\n") u+000d carriage return (cr) ("\r") u+2028 line separator u+2029 paragraph separator this effectively means the dot will matc...
RegExp.prototype.flags - JavaScript
for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of regexp.prototype.flags writable no enumerable no configurable yes
description flags in the flags property are sorted alphabetically (from left to right, e.g. "gimsuy"). polyfill if (regexp.prototype.flags === undefined) { object.defineproperty(regexp.prototype, 'flags', { configurable: true, get: function() { return this.tostring().match(/[gimsuy]*$/)[0]; } }); } examples using flags /foo/ig.flags; // "gi" /bar/myu.flags; // "muy" specif...
RegExp.prototype.global - JavaScript
or this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of regexp.prototype.global writable no enumerable no configurable yes
description the value of global is a boolean and true if the "g" flag was used; otherwise, false. the "g" flag indicates that the regular expression should be tested against all possible matches in a string. a regular expression defined as both global ("g") and sticky ("y") will ignore the global flag and perform sticky matches. you cannot change this property directly. examples using global var regex =...
RegExp.prototype.ignoreCase - JavaScript
his interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of regexp.prototype.ignorecase writable no enumerable no configurable yes
description the value of ignorecase is a boolean and true if the "i" flag was used; otherwise, false. the "i" flag indicates that case should be ignored while attempting a match in a string. you cannot change this property directly. examples using ignorecase var regex = new regexp('foo', 'i'); console.log(regex.ignorecase); // true specifications specification ecmascript (ecma-262)...
RegExp.input ($_) - JavaScript
instead, you always use it as regexp.input or regexp.$_. the value of the input property is modified whenever the searched string on the regular expression is changed and that string is matching. ...
RegExpInstance.lastIndex - JavaScript
the lastindex is a read/write integer property of regular expression instances that specifies the index at which to start the next match. property attributes of regexpinstance.lastindex writable yes enumerable no configurable no
description this property is set only if the regular expression instance used the g flag to indicate a global search, or the y flag to indicate a sticky search. the following rules apply: if lastindex is greater than the length of the string, test() and exec() fail, then lastindex is set to 0. if lastindex is equal to or less than the length of the string and if the regular expression matches the empty string, then the regular expression matches input starting from lastin...
RegExp.lastMatch ($&) - JavaScript
instead, you always use it as regexp.lastmatch or regexp['$&']. the value of the lastmatch property is read-only and modified whenever a successful match is made. ...
RegExp.lastParen ($+) - JavaScript
instead, you always use it as regexp.lastparen or regexp['$+']. the value of the lastparen property is read-only and modified whenever a successful match is made. ...
RegExp.leftContext ($`) - JavaScript
instead, you always use it as regexp.leftcontext or regexp['$`']. the value of the leftcontext property is read-only and modified whenever a successful match is made. ...
RegExp.prototype.multiline - JavaScript
this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of regexp.prototype.multiline writable no enumerable no configurable yes
description the value of multiline is a boolean and is true if the "m" flag was used; otherwise, false. the "m" flag indicates that a multiline input string should be treated as multiple lines. for example, if "m" is used, "^" and "$" change from matching at only the start or end of the entire string to the start or end of any line within the string. you cannot change this property directly. examples usi...
RegExp.$1-$9 - JavaScript
instead, you always use them as regexp.$1, ..., regexp.$9. the values of these properties are read-only and modified whenever successful matches are made. the number of possible parenthesized substrings is unlimited, but the regexp object can only hold the first nine. ...
RegExp.rightContext ($') - JavaScript
instead, you always use it as regexp.rightcontext or regexp["$'"]. the value of the rightcontext property is read-only and modified whenever a successful match is made. ...
RegExp.prototype.sticky - JavaScript
or this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of regexp.prototype.sticky writable no enumerable no configurable yes
description the value of sticky is a boolean and true if the "y" flag was used; otherwise, false. the "y" flag indicates that it matches only from the index indicated by the lastindex property of this regular expression in the target string (and does not attempt to match from any later indexes). a regular expression defined as both sticky and global ignores the global flag. you cannot change this property ...
RegExp.prototype.test() - JavaScript
ple is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexobj.test(str) parameters str the string against which to match the regular expression. returns true if there is a match between the regular expression and the string str. otherwise, false.
description use test() whenever you want to know whether a pattern is found in a string. test() returns a boolean, unlike the string.prototype.search() method (which returns the index of a match, or -1 if not found). to get more information (but with slower execution), use the exec() method. (this is similar to the string.prototype.match() method.) as with exec() (or in combination with it), test() called...
RegExp.prototype.toString() - JavaScript
the tostring() method returns a string representing the regular expression. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexobj.tostring(); return value a string representing the given object.
description the regexp object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring(). for regexp objects, the tostring() method returns a string representation of the regular expression. examples using tostring() the following example displays the string value of a regexp object: var myexp = new regexp('a+b+c'); console.log(myexp.tostring()); // logs '/a+b+c/' var ...
RegExp.prototype.unicode - JavaScript
r this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of regexp.prototype.unicode writable no enumerable no configurable yes
description the value of unicode is a boolean and true if the "u" flag was used; otherwise false. the "u" flag enables various unicode-related features. with the "u" flag, any unicode code point escapes will be interpreted as such, for example. you cannot change this property directly. it is read-only. examples using the unicode property var regex = new regexp('\u{61}', 'u'); console.log(regex.unicode)...
RegExp - JavaScript
the literal notation's parameters are enclosed between slashes and do not use quotation marks. the constructor function's parameters are not enclosed between slashes but do use quotation marks. ...
get Set[@@species] - JavaScript
subclass constructors may override it to change the constructor assignment. examples species in ordinary objects the species property returns the default constructor function, which is the set constructor for set objects: set[symbol.species]; // function set() species in derived objects in a derived collection object (e.g. your custom set myset), the myset species is the myset constructor. ...
Set.prototype.forEach() - JavaScript
llback[, thisarg]) parameters callback function to execute for each element, taking three arguments: currentvalue, currentkey the current element being processed in the set. as there are no keys in set, the value is passed for both arguments. set the set object which foreach() was called upon. thisarg value to use as this when executing callback. return value undefined.
description the foreach() method executes the provided callback once for each value which actually exists in the set object. it is not invoked for values which have been deleted. however, it is executed for values which are present but have the value undefined. callback is invoked with three arguments: the element value the element key the set object being traversed there are no keys in set objects,...
Set.prototype.size - JavaScript
the size accessor property returns the number of (unique) elements in a set object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the value of size is an integer representing how many entries the set object has. a set accessor function for size is undefined; you cannot change this property. examples using size var myset = new set(); myset.add(1); myset.add(5); myset.add('some text') myset.size; // 3 specifications specification ecmascript (ecma-262)the definition of 'set.prototype.size' in that specification. ...
Set - JavaScript
you can iterate through the elements of a set in insertion order. a value in the set may only occur once; it is unique in the set's collection. value equality because each value in the set has to be unique, the value equality will be checked. in an earlier version of ecmascript specification, this was not based on the same algorithm as the one used in the === operator. specifically, for sets, +0 (which is strictly equal to -0) and -0 were different values. however, this was changed in the ecmascript 2015 specification. ...
SharedArrayBuffer.prototype.byteLength - JavaScript
the bytelength accessor property represents the length of an sharedarraybuffer in bytes. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the bytelength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when the shared array is constructed and cannot be changed. examples using bytelength var sab = new sharedarraybuffer(1024); sab.bytelength; // 1024 specifications specification ecmascript (ecma-262)the definition of 'sharedarraybuffer.prototype.bytelength' in that specification. ...
SharedArrayBuffer - JavaScript
the sharedarraybuffer object is used to represent a generic, fixed-length raw binary data buffer, similar to the arraybuffer object, but in a way that they can be used to create views on shared memory. unlike an arraybuffer, a sharedarraybuffer cannot become detached.
description allocating and sharing memory to share memory using sharedarraybuffer objects from one agent in the cluster to another (an agent is either the web page’s main program or one of its web workers), postmessage and structured cloning is used. the structured clone algorithm accepts sharedarraybuffers and typedarrays mapped onto sharedarraybuffers. in both cases, the sharedarraybuffer object is transmitted to the receiver resulting in a new, private sharedarraybuffer object in the receiving agent (just as for arraybuffer). ...
String.prototype.anchor() - JavaScript
pis instead. also, the html specification no longer allows the <a> element to have a name attribute, so this method doesn't even create valid markup. syntax str.anchor(name) parameters name a string representing a name value to put into the generated <a name="..."> start tag. return value a string beginning with an <a name="name"> start tag, then the text str, and then an </a> end tag
description don't use this method. use dom apis instead. also, the html specification no longer allows the <a> element to have a name attribute, so this method doesn't even create valid markup. examples using anchor() var mystring = 'table of contents'; document.body.innerhtml = mystring.anchor('contents_anchor'); will output the following html: <a name="contents_anchor">table of contents</a> speci...
String.prototype.big() - JavaScript
the big() method creates a <big> html element that causes a string to be displayed in a big font. usage note: the <big> element has been removed in html5 and shouldn't be used anymore. instead web developers should use css properties. syntax str.big() return value a string containing a <big> html element.
description the big() method embeds a string in a <big> tag: "<big>str</big>". examples using big() the following example uses string methods to change the size of a string: var worldstring = 'hello, world'; console.log(worldstring.small()); // <small>hello, world</small> console.log(worldstring.big()); // <big>hello, world</big> console.log(worldstring.fontsize(7)); // <fontsize=7>hello, world</fontsize> with the element.style object you can get the element's style attr...
String.prototype.blink() - JavaScript
the blink() method creates a <blink> html element that causes a string to blink. warning: blinking text is frowned upon by several accessibility standards. the <blink> element itself is non-standard and deprecated! syntax str.blink() return value a string containing a <blink> html element.
description the blink() method embeds a string in a <blink> tag: "<blink>str</blink>". examples using blink() the following example uses string methods to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications ...
String.prototype.bold() - JavaScript
the bold() method creates a <b> html element that causes a string to be displayed as bold. syntax str.bold() return value a string containing a <b> html element.
description the bold() method embeds a string in a <b> tag: "<b>str</b>". examples using bold() the following example uses string methods to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.bold' in that specification. ...
String.prototype.charAt() - JavaScript
let character = str.charat(index) parameters index an integer between 0 and str.length - 1. if the index cannot be converted to the integer or no index is provided, the default is 0, so the first character of str is returned. return value a string representing the character (exactly one utf-16 code unit) at the specified index. if index is out of range, charat() returns an empty string.
description characters in a string are indexed from left to right. the index of the first character is 0, and the index of the last character—in a string called stringname—is stringname.length - 1. if the index you supply is out of this range, javascript returns an empty string. if no index is provided to charat(), the default is 0. examples displaying characters at different locations in a string t...
String.prototype.charCodeAt() - JavaScript
de point. if you want the entire code point value, use codepointat(). syntax str.charcodeat(index) parameters index an integer greater than or equal to 0 and less than the length of the string. if index is not a number, it defaults to 0. return value a number representing the utf-16 code unit value of the character at the given index. if index is out of range, charcodeat() returns nan.
description unicode code points range from 0 to 1114111 (0x10ffff). the first 128 unicode code points are a direct match of the ascii character encoding. (for information on unicode, see the javascript guide.) note: charcodeat() will always return a value that is less than 65536. this is because the higher code points are represented by a pair of (lower valued) "surrogate" pseudo-characters which are used...
String.prototype.codePointAt() - JavaScript
e to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.codepointat(pos) parameters pos position of an element in str to return the code point value from. return value a number representing the code point value of the character at the given pos. if there is no element at pos, returns undefined.
description if there is no element at the specified position, undefined is returned. if no utf-16 surrogate pair begins at pos, the code unit at pos is returned. polyfill the following extends strings to include the codepointat() function as specified in ecmascript 2015 for browsers without native support. /*! https://mths.be/codepointat v0.2.0 by @mathias */ if (!string.prototype.codepointat) { (func...
String.prototype.concat() - JavaScript
for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.concat(str2 [, ...strn]) parameters str2 [, ...strn] strings to concatenate to str. return value a new string containing the combined text of the strings provided.
description the concat() function concatenates the string arguments to the calling string and returns a new string. changes to the original string or the returned string don't affect the other. if the arguments are not of the type string, they are converted to string values before concatenating. performance it is strongly recommended that the assignment operators (+, +=) are used instead of the concat() ...
String.prototype.endsWith() - JavaScript
lease clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.endswith(searchstring[, length]) parameters searchstring the characters to be searched for at the end of str. length optional if provided, it is used as the length of str. defaults to str.length. return value true if the given characters are found at the end of the string; otherwise, false.
description this method lets you determine whether or not a string ends with another string. this method is case-sensitive. polyfill this method has been added to the ecmascript 6 specification and may not be available in all javascript implementations yet. however, you can polyfill string.prototype.endswith() with the following snippet: if (!string.prototype.endswith) { string.prototype.endswith = fun...
String.prototype.fixed() - JavaScript
the fixed() method creates a <tt> html element that causes a string to be displayed in fixed-pitch font. syntax str.fixed() return value a string representing a <tt> html element.
description the fixed() method embeds a string in a <tt> tag: "<tt>str</tt>". examples using fixed() the following example uses the fixed method to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.fixed()); // "<tt>hello, world</tt>" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.fixed' in that specification. ...
String.prototype.fontcolor() - JavaScript
note: the <font> element has been removed in html5 and shouldn't be used anymore. instead web developers should use css properties. syntax str.fontcolor(color) parameters color a string expressing the color as a hexadecimal rgb triplet or as a string literal. string literals for color names are listed in the css color reference. return value a string containing a <font> html element.
description if you express color as a hexadecimal rgb triplet, you must use the format rrggbb. for example, the hexadecimal rgb values for salmon are red=fa, green=80, and blue=72, so the rgb triplet for salmon is "fa8072". examples using fontcolor() the following example uses the fontcolor() method to change the color of a string by producing a string with the html <font> tag. var worldstring = 'hello,...
String.prototype.fontsize() - JavaScript
that causes a string to be displayed in the specified font size. usage note: the <font> element has been removed in html5 and shouldn't be used anymore. instead web developers should use css properties. syntax str.fontsize(size) parameters size an integer between 1 and 7, a string representing a signed integer between 1 and 7. return value a string containing a <font> html element.
description when you specify size as an integer, you set the font size of str to one of the 7 defined sizes. when you specify size as a string such as "-2", you adjust the font size of str relative to the size set in the <basefont> tag. examples using fontsize() the following example uses string methods to change the size of a string: var worldstring = 'hello, world'; console.log(worldstring.small()); ...
String.fromCharCode() - JavaScript
hub.com/mdn/interactive-examples and send us a pull request. syntax string.fromcharcode(num1[, ...[, numn]]) parameters num1, ..., numn a sequence of numbers that are utf-16 code units. the range is between 0 and 65535 (0xffff). numbers greater than 0xffff are truncated. no validity checks are performed. return value a string of length n consisting of the n specified utf-16 code units.
description this method returns a string and not a string object. because fromcharcode() is a static method of string, you always use it as string.fromcharcode(), rather than as a method of a string object you created. returning supplementary characters in utf-16, the most common characters can be represented by a single 16-bit value (i.e. a code unit). however, this set of characters, known as the base...
String.fromCodePoint() - JavaScript
ne https://github.com/mdn/interactive-examples and send us a pull request. syntax string.fromcodepoint(num1[, ...[, numn]]) parameters num1, ..., numn a sequence of code points. return value a string created by using the specified sequence of code points. exceptions a rangeerror is thrown if an invalid unicode code point is given (e.g. "rangeerror: nan is not a valid code point").
description this method returns a string (and not a string object). because fromcodepoint() is a static method of string, you must call it as string.fromcodepoint(), rather than as a method of a string object you created. polyfill the string.fromcodepoint() method has been added to ecmascript 2015 and may not be supported in all web browsers or environments yet. use the code below for a polyfill: if (...
String.prototype.includes() - JavaScript
.com/mdn/interactive-examples and send us a pull request. syntax str.includes(searchstring[, position]) parameters searchstring a string to be searched for within str. position optional the position within the string at which to begin searching for searchstring. (defaults to 0.) return value true if the search string is found anywhere within the given string; otherwise, false if not.
description this method lets you determine whether or not a string includes another string. case-sensitivity the includes() method is case sensitive. for example, the following expression returns false: 'blue whale'.includes('blue') // returns false polyfill this method has been added to the ecmascript 2015 specification and may not be available in all javascript implementations yet. however, you ca...
String.prototype.indexOf() - JavaScript
er than the string's length, the returned value is the string's length: 'hello world'.indexof('', 11) // returns 11 'hello world'.indexof('', 13) // returns 11 'hello world'.indexof('', 22) // returns 11 in the former instance, js seems to find an empty string just after the specified index value. in the latter instance, js seems to be finding an empty string at the end of the searched string.
description characters in a string are indexed from left to right. the index of the first character is 0, and the index of the last character of a string called stringname is stringname.length - 1. 'blue whale'.indexof('blue') // returns 0 'blue whale'.indexof('blute') // returns -1 'blue whale'.indexof('whale', 0) // returns 5 'blue whale'.indexof('whale', 5) // returns 5 'blue whale'.indexo...
String.prototype.italics() - JavaScript
the italics() method creates an <i> html element that causes a string to be italic. syntax str.italics() return value a string containing a <i> html element.
description the italics() method embeds a string in an <i> tag: "<i>str</i>". examples using italics() the following example uses string methods to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.italics' in that specification. ...
String.prototype.lastIndexOf() - JavaScript
n empty string, then fromindex is returned. fromindex optional the index of the last character in the string to be considered as the beginning of a match. the default value is +infinity. if fromindex >= str.length, the whole string is searched. if fromindex < 0, the behavior will be the same as if it would be 0. return value the index of the last occurrence of searchvalue; -1 if not found.
description characters in a string are indexed from left to right. the index of the first character is 0, and the index of the last character is str.length - 1. 'canal'.lastindexof('a'); // returns 3 'canal'.lastindexof('a', 2); // returns 1 'canal'.lastindexof('a', 0); // returns -1 'canal'.lastindexof('x'); // returns -1 'canal'.lastindexof('c', -5); // returns 0 'canal'.lastindexof('c', 0); /...
String length - JavaScript
utf-16, the string format used by javascript, uses a single 16-bit code unit to represent the most common characters, but needs to use two code units for less commonly-used characters, so it's possible for the value returned by length to not match the actual number of characters in the string. ecmascript 2016 (ed. 7) established a maximum length of 2^53 - 1 elements. previously, no maximum length was specified. ...
String.prototype.link() - JavaScript
reates a string representing the code for an <a> html element to be used as a hypertext link to another url. syntax str.link(url) parameters url any string that specifies the href attribute of the <a> tag; it should be a valid url (relative or absolute), with any & characters escaped as &, and any " characters escaped as ". return value a string containing an <a> html element.
description use the link() method to create an html snippet for a hypertext link. the returned string can then be added to the document via document.write() or element.innerhtml. links created with the link() method become elements in the links array of the document object. see document.links. examples using link() the following example displays the word "mdn" as a hypertext link that returns the user t...
String.prototype.localeCompare() - JavaScript
ions which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation-dependent. see the intl.collator() constructor for details on these parameters and how to use them. return value a negative number if referencestr occurs before comparestring; positive if the referencestr occurs after comparestring; 0 if they are equivalent.
description returns an integer indicating whether the referencestr comes before, after or is equivalent to the comparestring. negative when the referencestr occurs before comparestring positive when the referencestr occurs after comparestring returns 0 if they are equivalent do not rely on exact return values of -1 or 1! negative and positive integer results vary between browsers (as well as betwe...
String.prototype.match() - JavaScript
rties as explained above, some results contain additional properties as described below. groups an object of named capturing groups whose keys are the names and values are the capturing groups or undefined if no named capturing groups were defined. see groups and ranges for more information. index the index of the search at which the result was found. input a copy of the search string.
description if the regular expression does not include the g flag, str.match() will return the same result as regexp.exec(). other methods if you need to know if a string matches a regular expression regexp, use regexp.test(). if you only want the first match found, you might want to use regexp.exec() instead. if you want to obtain capture groups and the global flag is set, you need to use regexp.exec...
String.prototype.normalize() - JavaScript
cal decomposition, followed by canonical composition. "nfd" canonical decomposition. "nfkc" compatibility decomposition, followed by canonical composition. "nfkd" compatibility decomposition. return value a string containing the unicode normalization form of the given string. errors thrown rangeerror a rangeerror is thrown if form isn't one of the values specified above.
description unicode assigns a unique numerical value, called a code point, to each character. for example, the code point for "a" is given as u+0041. however, sometimes more than one code point, or sequence of code points, can represent the same abstract character — the character "ñ" for example can be represented by either of: the single code point u+00f1. the code point for "n" (u+006e) followed by...
String.raw() - JavaScript
string` parameters callsite well-formed template call site object, like { raw: ['foo', 'bar', 'baz'] }. ...substitutions contains substitution values. templatestring a template string, optionally with substitutions (${...}). return value the raw string form of a given template string. exceptions typeerror a typeerror is thrown if the first argument is not a well-formed object.
description in most cases, string.raw() is used with template strings. the first syntax mentioned above is only rarely used, because the javascript engine will call this with proper arguments for you, (just like with other tag functions). string.raw() is the only built-in tag function of template strings. it works just like the default template function and performs concatenation. you can even re-implemen...
String.prototype.replace() - JavaScript
fying a string as a parameter" section below. function (replacement) a function to be invoked to create the new substring to be used to replace the matches to the given regexp or substr. the arguments supplied to this function are described in the "specifying a function as a parameter" section below. return value a new string, with some or all matches of a pattern replaced by a replacement.
description this method does not change the calling string object. it simply returns a new string. to perform a global search and replace, include the g switch in the regular expression. specifying a string as a parameter the replacement string can include the following special replacement patterns: pattern inserts $$ inserts a "$". $& inserts the matched substrin...
String.prototype.replaceAll() - JavaScript
e "specifying a string as a parameter" section below. function (replacement) a function to be invoked to create the new substring to be used to replace the matches to the given regexp or substr. the arguments supplied to this function are described in the "specifying a function as a parameter" section below. return value a new string, with all matches of a pattern replaced by a replacement.
description this method does not change the calling string object. it simply returns a new string. specifying a string as a parameter the replacement string can include the following special replacement patterns: pattern inserts $$ inserts a "$". $& inserts the matched substring. $` inserts the portion of the string that precedes the matched substring. ...
String.prototype.search() - JavaScript
please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.search(regexp) parameters regexp a regular expression object. if a non-regexp object regexp is passed, it is implicitly converted to a regexp with new regexp(regexp). return value the index of the first match between the regular expression and the given string, or -1 if no match was found.
description when you want to know whether a pattern is found, and also know its index within a string, use search(). (if you only want to know if it exists, use the similar test() method on the regexp prototype, which returns a boolean.) for more information (but slower execution) use match() (similar to the regular expression exec() method). examples using search() the following example searches a str...
String.prototype.slice() - JavaScript
ing. endindex optional the zero-based index before which to end extraction. the character at this index will not be included. if endindex is omitted, slice() extracts to the end of the string. if negative, it is treated as str.length + endindex. (for example, if endindex is -3 it is treated as str.length - 3.) return value a new string containing the extracted section of the string.
description slice() extracts the text from one string and returns a new string. changes to the text in one string do not affect the other string. slice() extracts up to but not including endindex. str.slice(1, 4) extracts the second character through the fourth character (characters indexed 1, 2, and 3). as an example, str.slice(2, -1) extracts the third character through the second to last character in t...
String.prototype.small() - JavaScript
the small() method creates a <small> html element that causes a string to be displayed in a small font. syntax str.small() return value a string containing a <small> html element.
description the small() method embeds a string in a <small> tag: "<small>str</small>". examples using small() the following example uses string methods to change the size of a string: var worldstring = 'hello, world'; console.log(worldstring.small()); // <small>hello, world</small> console.log(worldstring.big()); // <big>hello, world</big> console.log(worldstring.fontsize(7)); // <font size="7">hello, world</fontsize> with the element.style object you can get the element's style attribute and manipulate it more generically, for example: document.getelementbyid('yourelemid').style.fontsize = '0.7em...
String.prototype.split() - JavaScript
have been placed in the array. any leftover text is not included in the array at all. the array may contain fewer entries than limit if the end of the string is reached before the limit is reached. if limit is 1, str.split(separator)[0] is returned if limit is 0, [] is returned. return value an array of strings, split at each point where the separator occurs in the given string.
description when found, separator is removed from the string, and the substrings are returned in an array. if separator is a regular expression with capturing parentheses, then each time separator matches, the results (including any undefined results) of the capturing parentheses are spliced into the output array. if the separator is an array, then that array is coerced to a string and used as a separator...
String.prototype.startsWith() - JavaScript
ctive-examples and send us a pull request. syntax str.startswith(searchstring[, position]) parameters searchstring the characters to be searched for at the start of this string. position optional the position in this string at which to begin searching for searchstring. defaults to 0. return value true if the given characters are found at the beginning of the string; otherwise, false.
description this method lets you determine whether or not a string begins with another string. this method is case-sensitive. polyfill this method has been added to the ecmascript 2015 specification and may not be available in all javascript implementations yet. however, you can polyfill string.prototype.startswith() with the following snippet: if (!string.prototype.startswith) { object.definepropert...
String.prototype.strike() - JavaScript
the strike() method creates a <strike> html element that causes a string to be displayed as struck-out text. syntax str.strike() return value a string containing a <strike> html element.
description the strike() method embeds a string in a <strike> tag: "<strike>str</strike>". examples using strike() the following example uses string methods to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.strike' in that specificat...
String.prototype.sub() - JavaScript
the sub() method creates a <sub> html element that causes a string to be displayed as subscript. syntax str.sub() return value a string containing a <sub> html element.
description the sub() method embeds a string in a <sub> tag: "<sub>str</sub>". examples using sub() and sup() methods the following example uses the sub() and sup() methods to format a string: var supertext = 'superscript'; var subtext = 'subscript'; console.log('this is what a ' + supertext.sup() + ' looks like.'); // this is what a <sup>superscript</sup> looks like console.log('this is what a ' + subtext.sub() + ' looks like.'); // this is what a <sub>subscript</sub> looks like. specifications specification ecmascript (ecma-262)the definition of 'string.prototype.sub' in that specification. ...
String.prototype.substr() - JavaScript
contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.substr(start[, length]) parameters start the index of the first character to include in the returned substring. length optional. the number of characters to extract. return value a new string containing the specified part of the given string.
description substr() extracts length characters from a str, counting from the start index. if start is a positive number, the index starts counting at the start of the string. its value is capped at str.length. if start is a negative number, the index starts counting from the end of the string. its value is capped at -str.length. note: in microsoft jscript, negative values of the start argument are not...
String.prototype.substring() - JavaScript
se clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.substring(indexstart[, indexend]) parameters indexstart the index of the first character to include in the returned substring. indexend optional the index of the first character to exclude from the returned substring. return value a new string containing the specified part of the given string.
description substring() extracts characters from indexstart up to but not including indexend. in particular: if indexend is omitted, substring() extracts characters to the end of the string. if indexstart is equal to indexend, substring() returns an empty string. if indexstart is greater than indexend, then the effect of substring() is as if the two arguments were swapped; see example below. any argu...
String.prototype.sup() - JavaScript
the sup() method creates a <sup> html element that causes a string to be displayed as superscript. syntax str.sup() return value a string containing a <sup> html element.
description the sup() method embeds a string in a <sup> tag: "<sup>str</sup>". examples using sub() and sup() methods the following example uses the sub() and sup() methods to format a string: var supertext = 'superscript'; var subtext = 'subscript'; console.log('this is what a ' + supertext.sup() + ' looks like.'); // "this is what a <sup>superscript</sup> looks like." console.log('this is what a ' + subtext.sub() + ' looks like.'); // "this is what a <sub>subscript</sub> looks like." specifications specification ecmascript (ecma-262)the definition of 'string.prototype.sup' in that specification.
String.prototype.toLocaleLowerCase() - JavaScript
he host environment’s current locale. return value a new string representing the calling string converted to lower case, according to any locale-specific case mappings. exceptions a rangeerror ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag. a typeerror ("invalid element in locales argument") is thrown if an array element isn't of type string.
description the tolocalelowercase() method returns the value of the string converted to lower case according to any locale-specific case mappings. tolocalelowercase() does not affect the value of the string itself. in most cases, this will produce the same result as tolowercase(), but for some locales, such as turkish, whose case mappings do not follow the default case mappings in unicode, there may be a di...
String.prototype.toLocaleUpperCase() - JavaScript
he host environment’s current locale. return value a new string representing the calling string converted to upper case, according to any locale-specific case mappings. exceptions a rangeerror ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag. a typeerror ("invalid element in locales argument") is thrown if an array element isn't of type string.
description the tolocaleuppercase() method returns the value of the string converted to upper case according to any locale-specific case mappings. tolocaleuppercase() does not affect the value of the string itself. in most cases, this will produce the same result as touppercase(), but for some locales, such as turkish, whose case mappings do not follow the default case mappings in unicode, there may be a di...
String.prototype.toLowerCase() - JavaScript
d returns the calling string value converted to lower case. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.tolowercase() return value a new string representing the calling string converted to lower case.
description the tolowercase() method returns the value of the string converted to lower case. tolowercase() does not affect the value of the string str itself. examples using tolowercase() console.log('alphabet'.tolowercase()); // 'alphabet' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.tolowercase' in that specification. ...
String.prototype.toUpperCase() - JavaScript
thub repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.touppercase() return value a new string representing the calling string converted to upper case. exceptions typeerror when called on null or undefined, for example, string.prototype.touppercase.call(undefined).
description the touppercase() method returns the value of the string converted to uppercase. this method does not affect the value of the string itself since javascript strings are immutable. examples basic usage console.log('alphabet'.touppercase()); // 'alphabet' conversion of non-string this values to strings this method will convert any non-string value to a string, when you set its this to a valu...
String.prototype.trim() - JavaScript
e, etc.) and all the line terminator characters (lf, cr, etc.). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.trim() return value a new string representing the str stripped of whitespace from both ends.
description the trim() method returns the string stripped of whitespace from both ends. trim() does not affect the value of the str itself. polyfill running the following code before any other code will create trim() if it's not natively available. if (!string.prototype.trim) { string.prototype.trim = function () { return this.replace(/^[\s\ufeff\xa0]+|[\s\ufeff\xa0]+$/g, ''); }; } examples us...
String.prototype.trimEnd() - JavaScript
an alias of this method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.trimend(); str.trimright(); return value a new string representing the calling string stripped of whitespace from its (right) end.
description the trimend() / trimright() methods return the string stripped of whitespace from its right end. trimend() or trimright() do not affect the value of the string itself. aliasing for consistency with functions like string.prototype.padend the standard method name is trimend. however, for web compatibility reasons, trimright remains as an alias to trimend. in some engines this means: string.prot...
String.prototype.trimStart() - JavaScript
of this method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.trimstart(); str.trimleft(); return value a new string representing the calling string stripped of whitespace from its beginning (left end).
description the trimstart() / trimleft() methods return the string stripped of whitespace from its left end. trimleft() or trimstart() do not affect the value of the string itself. aliasing for consistency with functions like string.prototype.padstart the standard method name is trimstart. however, for web compatibility reasons, trimleft remains as an alias to trimstart. in some engines this means: strin...
String - JavaScript
some of the most-used operations on strings are to check their length, to build and concatenate them using the + and += string operators, checking for the existence or location of substrings with the indexof() method, or extracting substrings with the substring() method. ...
Symbol.prototype[@@toPrimitive] - JavaScript
the hint argument is not used. javascript calls the [@@toprimitive]() method to convert an object to a primitive value. you rarely need to invoke the [@@toprimitive]() method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected. ...
Symbol() constructor - JavaScript
it is not intended to be subclassed. it may be used as the value of an extends clause of a class definition but a super call to it will cause an exception. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax symbol([
description]) parameters
description optional a string. a
description of the symbol which can be used for debugging but not to access the symbol itself. examples creating symbols to create a new primitive symbol, you write symbol() with an optional string as its
description: let sym1 = symbol() let sym2 = symbol('foo') let sym3 = symbol('foo') the above code creates three new symbols. note that s...
Symbol.asyncIterator - JavaScript
well-known symbol specifies the default asynciterator for an object. if this property is set on an object, it is an async iterable and can be used in a for await...of loop. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the symbol.asynciterator symbol is a builtin symbol that is used to access an object's @@asynciterator method. in order for an object to be async iterable, it must have a symbol.asynciterator key. property attributes of symbol.asynciterator writable no enumerable no configurable no examples user-de...
Symbol.isConcatSpreadable - JavaScript
the symbol.isconcatspreadable well-known symbol is used to configure if an object should be flattened to its array elements when using the array.prototype.concat() method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the @@isconcatspreadable symbol (symbol.isconcatspreadable) can be defined as an own or inherited property and its value is a boolean. it can control behavior for arrays and array-like objects: for array objects, the default behavior is to spread (flatten) elements. symbol.isconcatspreadable can avoid flattening in these cases. for array-like objects, the default behavior is no spreading or ...
Symbol.iterator - JavaScript
the well-known symbol.iterator symbol specifies the default iterator for an object. used by for...of. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description whenever an object needs to be iterated (such as at the beginning of a for..of loop), its @@iterator method is called with no arguments, and the returned iterator is used to obtain the values to be iterated. some built-in types have a default iteration behavior, while other types (such as object) do not. the built-in types with a @@iterator method are: array.prototype[@@iterator]() typedarray.prototype[@@iterator]() string.prototype[@@iterator]() map.proto...
Symbol.match - JavaScript
the symbol.match well-known symbol specifies the matching of a regular expression against a string. this function is called by the string.prototype.match() method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description this function is also used to identify if objects have the behavior of regular expressions. for example, the methods string.prototype.startswith(), string.prototype.endswith() and string.prototype.includes(), check if their first argument is a regular expression and will throw a typeerror if they are. now, if the match symbol is set to false (or a falsy value), it indicates that the object is not inten...
Symbol.matchAll - JavaScript
l well-known symbol returns an iterator, that yields matches of the regular expression against a string. this function is called by the string.prototype.matchall() method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description this symbol is used for string.prototype.matchall() and specifically in regexp.prototype[@@matchall](). the following two examples return same result: 'abc'.matchall(/a/); /a/[symbol.matchall]('abc'); this method exists for customizing match behavior within regexp subclasses. property attributes of symbol.matchall writable no enumer...
Symbol.species - JavaScript
the well-known symbol symbol.species specifies a function-valued property that the constructor function uses to create derived objects. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the species accessor property allows subclasses to override the default constructor for objects. property attributes of symbol.species writable no enumerable no configurable no examples using species you might want to return array objects in your derived array class myarray. for example, when using methods such as map() that return...
Symbol.toPrimitive - JavaScript
the symbol.toprimitive is a symbol that specifies a function valued property that is called to convert an object to a corresponding primitive value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description with the help of the symbol.toprimitive property (used as a function value), an object can be converted to a primitive value. the function is called with a string argument hint, which specifies the preferred type of the result primitive value. the hint argument can be one of "number", "string", and "default". property attributes of symbol.toprimitive writable no ...
Symbol.prototype.toString() - JavaScript
tostring() method returns a string representing the specified symbol object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax symbol().tostring() return value a string representing the specified symbol object.
description the symbol object overrides the tostring method of the object object; it does not inherit object.prototype.tostring(). for symbol objects, the tostring method returns a string representation of the object. no string concatenation while you can call tostring() on symbols, you cannot use string concatenation with them: symbol('foo') + 'bar' // typeerror: can't convert symbol to string e...
Symbol.toStringTag - JavaScript
it is accessed internally by the object.prototype.tostring() method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
Symbol.unscopables - JavaScript
es well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the with environment bindings of the associated object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the @@unscopables symbol (symbol.unscopables) can be defined on any object to exclude property names from being exposed as lexical variables in with with environment bindings. note that if using strict mode, with statements are not available and will likely also not need this symbol. setting a property to true in an unscopables object will make it unscopable and therefore it won't appear in lex...
Symbol.prototype.valueOf() - JavaScript
javascript calls the valueof method to convert an object to a primitive value. you rarely need to invoke the valueof method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected. ...
get TypedArray[@@species] - JavaScript
subclass constructors may over-ride it to change the constructor assignment. examples species in ordinary objects the species property returns the default constructor function, which is one of the typed array constructors for a given typed array object: int8array[symbol.species]; // function int8array() uint8array[symbol.species]; // function uint8array() float32array[symbol.species]; // function float32array() species in derived objects in a derived collection object (e.g. ...
TypedArray.BYTES_PER_ELEMENT - JavaScript
his interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of typedarray.bytes_per_element writable no enumerable no configurable no
description typedarray objects differ from each other in the number of bytes per element and in the way the bytes are interpreted. the bytes_per_element constant contains the number of bytes each element in the given typedarray has. examples using bytes_per_element int8array.bytes_per_element; // 1 uint8array.bytes_per_element; // 1 uint8clampedarray.bytes_per_element; // 1 int16array.byte...
TypedArray.prototype.buffer - JavaScript
the buffer accessor property represents the arraybuffer referenced by a typedarray at construction time. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the buffer property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when the typedarray is constructed and cannot be changed. typedarray is one of the typedarray objects. examples using the buffer property var buffer = new arraybuffer(8); var uint16 = new uint16array(buffer); uint16.buffer; // arraybuffer { bytelength: 8 } specifications specification ...
TypedArray.prototype.byteLength - JavaScript
the bytelength accessor property represents the length (in bytes) of a typed array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the bytelength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when a typedarray is constructed and cannot be changed. if the typedarray is not specifying an byteoffset or a length, the length of the referenced arraybuffer will be returned. typedarray is one of the typedarray objects. examples using the bytelength property var buffer = new arraybuffer(8); var uint8 = new uint8arra...
TypedArray.prototype.copyWithin() - JavaScript
mdn/interactive-examples and send us a pull request. syntax typedarray.copywithin(target, start[, end = this.length]) parameters target target start index position where to copy the elements to. start source start index position where to start copying elements from. end optional optional. source end index position where to end copying elements from. return value the modified array.
description see array.prototype.copywithin for more details. examples using copywithin var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.set([1,2,3]); console.log(uint8); // uint8array [ 1, 2, 3, 0, 0, 0, 0, 0 ] uint8.copywithin(3,0,3); console.log(uint8); // uint8array [ 1, 2, 3, 1, 2, 3, 0, 0 ] specifications specification ecmascript (ecma-262)the defin...
TypedArray.prototype.every() - JavaScript
ee arguments: currentvalue the current element being processed in the typed array. index the index of the current element being processed in the typed array. array the typed array every was called upon. thisarg optional. value to use as this when executing callback. return value true if the callback function returns a truthy value for every array element; otherwise, false.
description the every method executes the provided callback function once for each element present in the typed array until it finds one where callback returns a falsy value (a value that becomes false when converted to a boolean). if such an element is found, the every method immediately returns false. otherwise, if callback returned a true value for all elements, every will return true. callback is invok...
TypedArray.prototype.fill() - JavaScript
ute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.fill(value[, start = 0[, end = this.length]]) parameters value value to fill the typed array with. start optional. start index. defaults to 0. end optional. end index (not included). defaults to this.length. return value the modified array.
description the elements interval to fill is [start, end). the fill method takes up to three arguments value, start and end. the start and end arguments are optional with default values of 0 and the length of the this object. if start is negative, it is treated as length+start where length is the length of the array. if end is negative, it is treated as length+end. polyfill since there is no global obj...
TypedArray.prototype.filter() - JavaScript
xamples and send us a pull request. syntax typedarray.filter(callback[, thisarg]) parameters callback function to test each element of the typed array. invoked with arguments (element, index, typedarray). return true to keep the element, false otherwise. thisarg optional value to use as this when executing callback. return value a new typed array with the elements that pass the test.
description the filter() method calls a provided callback function once for each element in a typed array, and constructs a new typed array of all the values for which callback returns a true value. callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values. typed array elements which do ...
TypedArray.prototype.find() - JavaScript
ue in the typed array, taking three arguments: element the current element being processed in the typed array. index the index of the current element being processed in the typed array. array the array find was called upon. thisarg optional. object to use as this when executing callback. return value a value in the array if an element passes the test; otherwise, undefined.
description the find method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, find immediately returns the value of that element. otherwise, find returns undefined. callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which have been ...
TypedArray.prototype.findIndex() - JavaScript
the typed array, taking three arguments: element the current element being processed in the typed array. index the index of the current element being processed in the typed array. array the typed array findindex was called upon. thisarg optional. object to use as this when executing callback. return value an index in the array if an element passes the test; otherwise, -1.
description the findindex method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, findindex immediately returns the index of that element. otherwise, findindex returns -1. callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which ha...
TypedArray.prototype.forEach() - JavaScript
parameters callback function that produces an element of the new typed array, taking three arguments: currentvalue the current element being processed in the typed array. index the index of the current element being processed in the array. array the array foreach() was called upon. thisarg optional. value to use as this when executing callback. return value undefined.
description the foreach() method executes the provided callback once for each element present in the typed array in ascending order. it is not invoked for indexes that have been deleted or elided. however, it is executed for elements that are present and have the value undefined. callback is invoked with three arguments: the element value the element index the typed array being traversed if a thisar...
TypedArray.from() - JavaScript
ray uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array parameters source an array-like or iterable object to convert to a typed array. mapfn optional map function to call on every element of the typed array. thisarg optional value to use as this when executing mapfn. return value a new typedarray instance.
description typedarray.from() lets you create typed arrays from: array-like objects (objects with a length property and indexed elements); or iterable objects (objects where you can get its elements, such as map and set). typedarray.from() has the optional parameter mapfn, which allows you to execute a map() function on each element of the typed array (or subclass object) that is being created. this m...
TypedArray.prototype.indexOf() - JavaScript
ed index value is a negative number, it is taken as the offset from the end of the typed array. note: if the provided index is negative, the typed array is still searched from front to back. if the calculated index is less than 0, then the whole typed array will be searched. default: 0 (entire typed array is searched). return value the first index of the element in the array; -1 if not found.
description indexof compares searchelement to elements of the typed array using strict equality (the same method used by the ===, or triple-equals, operator). examples using indexof var uint8 = new uint8array([2, 5, 9]); uint8.indexof(2); // 0 uint8.indexof(7); // -1 uint8.indexof(9, 2); // 2 uint8.indexof(2, -1); // -1 uint8.indexof(2, -3); // 0 specifications specification ...
TypedArray.prototype.lastIndexOf() - JavaScript
typed array, the whole typed array will be searched. if negative, it is taken as the offset from the end of the typed array. note that even when the index is negative, the typed array is still searched from back to front. if the calculated index is less than 0, -1 is returned, i.e. the typed array will not be searched. return value the last index of the element in the array; -1 if not found.
description lastindexof compares searchelement to elements of the typed array using strict equality (the same method used by the ===, or triple-equals, operator). examples using lastindexof var uint8 = new uint8array([2, 5, 9, 2]); uint8.lastindexof(2); // 3 uint8.lastindexof(7); // -1 uint8.lastindexof(2, 3); // 3 uint8.lastindexof(2, 2); // 0 uint8.lastindexof(2, -2); // 0 uint8.lastindexof(2...
TypedArray.prototype.length - JavaScript
the length accessor property represents the length (in elements) of a typed array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
description the length property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when a typedarray is constructed and cannot be changed. if the typedarray is not specifying an byteoffset or a length, the length of the referenced arraybuffer will be returned. typedarray is one of the typedarray objects. examples using the length property var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer)...
TypedArray.prototype.map() - JavaScript
on that produces an element of the new typed array, taking three arguments: currentvalue the current element being processed in the typed array. index optional the index of the current element being processed in the typed array. array optional the typed array map() was called upon. thisarg optional value to use as this when executing mapfn. return value a new typed array.
description the map() method calls a provided callback function (mapfn) once for each element in a typed array, in order, and constructs a new typed array from the results. mapfn is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes that are undefined, those which have been deleted, or which have never been assigned values. mapfn is invoked with three arg...
TypedArray.name - JavaScript
source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of typedarray.name writable no enumerable no configurable no
description typedarray objects differ from each other in the number of bytes per element and in the way the bytes are interpreted. the name property describes of what data type the array consists. the first part can be int for "integer" or uint for an "unsigned integer", also float for "floating point" is used. the second part is a number describing the bit-size of the array. finally, the object type is arr...
TypedArray.of() - JavaScript
n/interactive-examples and send us a pull request. syntax typedarray.of(element0[, element1[, ...[, elementn]]]) where typedarray is one of: int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array parameters elementn elements of which to create the typed array. return value a new typedarray instance.
description some subtle distinctions between array.of() and typedarray.of(): if the this value passed to typedarray.of is not a constructor, typedarray.of will throw a typeerror, where array.of defaults to creating a new array. typedarray.of uses [[put]] where array.of uses [[defineproperty]]. hence, when working with proxy objects, it calls handler.set to create new elements rather than handler.definep...
TypedArray.prototype.reduce() - JavaScript
nitialvalue, if supplied (see below). currentvalue the current element being processed in the typed array. index the index of the current element being processed in the typed array. array the typed array reduce was called upon. initialvalue optional. object to use as the first argument to the first call of the callback. return value the value that results from the reduction.
description the reduce method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the typed array over which iteration is occurring. the first time the callback is called, previousvalue and currentva...
TypedArray.prototype.reduceRight() - JavaScript
nitialvalue, if supplied (see below). currentvalue the current element being processed in the typed array. index the index of the current element being processed in the typed array. array the typed array reduce was called upon. initialvalue optional. object to use as the first argument to the first call of the callback. return value the value that results from the reduction.
description the reduceright method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the typed array over which iteration is occurring. the call to the reduceright callback would look something lik...
TypedArray.prototype.slice() - JavaScript
d element through the fourth element (elements indexed 1, 2, and 3). a negative index can be used, indicating an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence. if end is omitted, slice extracts through the end of the sequence (typedarray.length). return value a new typed array containing the extracted elements.
description the slice method does not alter. it returns a shallow copy of elements from the original typed array. if a new element is added to either typed array, the other typed array is not affected. polyfill since there is no global object with the name typedarray, polyfilling must be done on an "as needed" basis. if (!uint8array.prototype.slice) { object.defineproperty(uint8array.prototype, 'slice...
TypedArray.prototype.some() - JavaScript
three arguments: currentvalue the current element being processed in the typed array. index the index of the current element being processed in the typed array. array the typed array some was called upon. thisarg optional. value to use as this when executing callback. return value true if the callback function returns a truthy value for any array element; otherwise, false.
description the some method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, some immediately returns true. otherwise, some returns false. callback is invoked with three arguments: the value of the element, the index of the element, and the array object being traversed. if a thisarg paramete...
TypedArray.prototype.subarray() - JavaScript
barray([begin [,end]]) parameters begin optional element to begin at. the offset is inclusive. the whole array will be included in the new view if this value is not specified. end optional element to end at. the offset is exclusive. if not specified, all elements from the one specified by begin to the end of the array are included in the new view. return value a new typedarray object.
description the range specified by begin and end is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. if either begin or end is negative, it refers to an index from the end of the array instead of from the beginning. also note that this is creating a new view on the existing buffer; changes to the new object's contents w...
URIError() constructor - JavaScript
filename optional optional. the name of the file containing the code that caused the exception. linenumber optional optional. the line number of the code that caused the exception. ...
Uint16Array() constructor - JavaScript
. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer. the byteoffset and length parameters specify the memory range that will be exposed by the typed array view. if both are omitted, all of buffer is viewed; if only length is omitted, the remainder of buffer is viewed.
description the uint16array() typed array constructor creates an array of 16-bit unsigned integers in the platform byte order. if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). starting with ecmascript 2015...
WeakMap - JavaScript
primitive data types as keys are not allowed (e.g. a symbol can't be a weakmap key). why weakmap? a map api could be implemented in javascript with two arrays (one for keys, one for values) shared by the four api methods. ...
WeakRef - JavaScript
a weak reference to an object is a reference that does not prevent the object from being reclaimed by the garbage collector. in contrast, a normal (or strong) reference keeps an object in memory. when an object no longer has any strong references to it, the javascript engine's garbage collector may destroy the object and reclaim its memory. if that happens, you can't get the object from a weak reference anymore. ...
WeakSet - JavaScript
just as with sets, each object in a weakset may occur only once; all objects in a weakset's collection are unique. the main differences to the set object are: weaksets are collections of objects only. they cannot contain arbitrary values of any type, as sets can. the weakset is weak, meaning references to objects in a weakset are held weakly. if no other references to an object stored in the weakset exist, those objects can be garbage collected. note: this also means that there is no list of current objects stored in the collection. weaksets are not enumerable. ...
WebAssembly.Module.customSections() - JavaScript
le, sectionname); parameters module the webassembly.module object whose custom sections are being considered. sectionname the string name of the desired custom section. return value a (possibly empty) array containing arraybuffer copies of the contents of all custom sections matching sectionname. exceptions if module is not a webassembly.module object instance, a typeerror is thrown.
description a wasm module is comprised of a sequence of sections. most of these sections are fully specified and validated by the wasm spec, but modules can also contain custom sections that are ignored and skipped over during validation. (read high level structure for information on section structures, and how normal sections ("known sections") and custom sections are distinguished.) this provides develop...
WebAssembly.Module.exports() - JavaScript
syntax webassembly.module.exports(module); parameters module a webassembly.module object. return value an array containing objects representing the exported functions of the given module. exceptions if module is not a webassembly.module object instance, a typeerror is thrown. examples using exports the following example (see our index-compile.html demo on github, and view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends it to a worker using postmessage(). ...
WebAssembly.Module.imports() - JavaScript
syntax webassembly.module.imports(module); parameters module a webassembly.module object. return value an array containing objects representing the imported functions of the given module. exceptions if module is not a webassembly.module object instance, a typeerror is thrown. examples using imports the following example (see imports.html source code; see it live also) compiles the loaded simple.wasm module. this module is then queried for its imports. ...
WebAssembly.Module - JavaScript
can be efficiently shared with workers, and instantiated multiple times. constructor webassembly.module() creates a new module object. static properties webassembly.module.customsections() given a module and string, returns a copy of the contents of all custom sections in the module with the given string name. webassembly.module.exports() given a module, returns an array containing
descriptions of all the declared exports. webassembly.module.imports() given a module, returns an array containing
descriptions of all the declared imports. examples sending a compiled module to a worker the following example (see our index-compile.html demo on github, and view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends the res...
WebAssembly - JavaScript
cript object acts as the namespace for all webassembly-related functionality. unlike most other global objects, webassembly is not a constructor (it is not a function object). you can compare it to math, which is also a namespace object for mathematical constants and functions, or to intl which is the namespace object for internationalization constructors and other language-sensitive functions.
description the primary uses for the webassembly object are: loading webassembly code, using the webassembly.instantiate() function. creating new memory and table instances via the webassembly.memory()/webassembly.table() constructors. providing facilities to handle errors that occur in webassembly via the webassembly.compileerror()/webassembly.linkerror()/webassembly.runtimeerror() constructors. con...
decodeURI() - JavaScript
interactive-examples and send us a pull request. syntax decodeuri(encodeduri) parameters encodeduri a complete, encoded uniform resource identifier. return value a new string representing the unencoded version of the given encoded uniform resource identifier (uri). exceptions throws an urierror ("malformed uri sequence") exception when encodeduri contains invalid character sequences.
description replaces each escape sequence in the encoded uri with the character that it represents, but does not decode escape sequences that could not have been introduced by encodeuri. the character “#” is not decoded from escape sequences. examples decoding a cyrillic url decodeuri('https://developer.mozilla.org/ru/docs/javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "https://developer.mozilla.org...
decodeURIComponent() - JavaScript
hub.com/mdn/interactive-examples and send us a pull request. syntax decodeuricomponent(encodeduri) parameters encodeduri an encoded component of a uniform resource identifier. return value a new string representing the decoded version of the given encoded uniform resource identifier (uri) component. exceptions throws an urierror ("malformed uri sequence") exception when used wrongly.
description replaces each escape sequence in the encoded uri component with the character that it represents. examples decoding a cyrillic url component decodeuricomponent('javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "javascript_шеллы" catching errors try { var a = decodeuricomponent('%e0%a4%a'); } catch(e) { console.error(e); } // urierror: malformed uri sequence decoding query paramet...
encodeURI() - JavaScript
of two "surrogate" characters). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax encodeuri(uri) parameters uri a complete uri. return value a new string representing the provided string encoded as a uri.
description the encodeuri() function does not encode characters that have special meaning (reserved characters) for a uri. the following example shows all the parts that a uri "scheme" can possibly contain. note how certain characters are used to signify special meaning: http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor hence encodeuri() does not encode charac...
encodeURIComponent() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax encodeuricomponent(str); parameters str string. a component of a uri. return value a new string representing the provided string encoded as a uri component.
description encodeuricomponent() escapes all characters except: not escaped: a-z a-z 0-9 - _ . ! ~ * ' ( ) encodeuricomponent() differs from encodeuri as follows: var set1 = ";,/?:@&=+$"; // reserved characters var set2 = "-_.!~*'()"; // unescaped characters var set3 = "#"; // number sign var set4 = "abc abc 123"; // alphanumeric characters + space console.log(encodeuri(set1)); // ;,...
escape() - JavaScript
hich use the format "\xhh". (hh are two hexadecimal digits, and the form \xhh\xhh is used for higher-plane unicode characters.) escaped characters in string literals can be expanded by replacing the \x with %, then using the decodeuricomponent() function. syntax escape(str) parameters str a string to be encoded. return value a new string in which certain characters have been escaped.
description the escape function is a property of the global object. special characters are encoded with the exception of: @*_+-./ the hexadecimal form for characters, whose code unit value is 0xff or less, is a two-digit escape sequence: %xx. for characters with a greater code unit, the four-digit format %uxxxx is used. examples using escape escape('abc123'); // "abc123" escape('äöü'); // ...
eval() - JavaScript
https://github.com/mdn/interactive-examples and send us a pull request. syntax eval(string) parameters string a string representing a javascript expression, statement, or sequence of statements. the expression can include variables and properties of existing objects. return value the completion value of evaluating the given code. if the completion value is empty, undefined is returned.
description eval() is a function property of the global object. the argument of the eval() function is a string. if the string represents an expression, eval() evaluates the expression. if the argument represents one or more javascript statements, eval() evaluates the statements. do not call eval() to evaluate an arithmetic expression; javascript evaluates arithmetic expressions automatically. if you cons...
globalThis - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of globalthis writable yes enumerable no configurable yes
description historically, accessing the global object has required different syntax in different javascript environments. on the web you can use window, self, or frames - but in web workers only self will work. in node.js none of these work, and you must instead use global. the this keyword could be used inside functions running in non–strict mode, but this will be undefined in modules and inside functio...
isFinite() - JavaScript
ive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax isfinite(testvalue) parameters testvalue the value to be tested for finiteness. return value false if the argument is positive or negative infinity or nan or undefined; otherwise, true.
description isfinite is a top-level function and is not associated with any object. you can use this function to determine whether a number is a finite number. the isfinite function examines the number in its argument. if the argument is nan, positive infinity, or negative infinity, this method returns false; otherwise, it returns true. examples using isfinite isfinite(infinity); // false isfinite(nan)...
isNaN() - JavaScript
the isnan() function determines whether a value is nan or not. note, coercion inside the isnan function has interesting rules; you may alternatively want to use number.isnan(), as defined in ecmascript 2015. syntax isnan(value) parameters value the value to be tested. return value true if the given value is nan; otherwise, false.
description the necessity of an isnan function unlike all other possible values in javascript, it is not possible to rely on the equality operators (== and ===) to determine whether a value is nan or not, because both nan == nan and nan === nan evaluate to false. hence, the necessity of an isnan function. origin of nan values nan values are generated when arithmetic operations result in undefined or unrepresentable values. such values do not necessarily rep...
null - JavaScript
value null represents the intentional absence of any object value. it is one of javascript's primitive values and is treated as falsy for boolean operations. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax null
description the value null is written with a literal: null. null is not an identifier for a property of the global object, like undefined can be. instead, null expresses a lack of identification, indicating that a variable points to no object. in apis, null is often retrieved in a place where an object can be expected but no object is relevant. // foo does not exist. it is not defined and has never been i...
parseFloat() - JavaScript
and send us a pull request. syntax parsefloat(string) parameters string the value to parse. if this argument is not a string, then it is converted to one using the tostring abstract operation. leading whitespace in this argument is ignored. return value a floating point number parsed from the given string. or nan when the first non-whitespace character cannot be converted to a number.
description parsefloat is a top-level function and not a method of any object. if parsefloat encounters a character other than a plus sign (+), minus sign (- u+002d hyphen-minus), numeral (0–9), decimal point (.), or exponent (e or e), it returns the value up to that character, ignoring the invalid character and characters following it. a second decimal point also stops parsing (characters up to that ...
parseInt() - JavaScript
tax parseint(string [, radix]) parameters string the value to parse. if this argument is not a string, then it is converted to one using the tostring abstract operation. leading whitespace in this argument is ignored. radix optional an integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the string. be careful—this does not default to 10! the
description below explains in more detail what happens when radix is not provided. return value an integer parsed from the given string. or nan when the radix is smaller than 2 or bigger than 36, or the first non-whitespace character cannot be converted to a number.
description the parseint function converts its first argument to a string, parses that string, then returns an integer or nan. if no...
undefined - JavaScript
perty attributes of undefined writable no enumerable no configurable no the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax undefined
description undefined is a property of the global object. that is, it is a variable in global scope. the initial value of undefined is the primitive value undefined. in modern browsers (javascript 1.8.5 / firefox 4+), undefined is a non-configurable, non-writable property, per the ecmascript 5 specification. (even when this is not the case, avoid overriding it.) a variable that has not been assigned a val...
unescape() - JavaScript
e replaced with the character that it represents. the escape sequences might be introduced by a function like escape. usually, decodeuri or decodeuricomponent are preferred over unescape. note: do not use unescape to decode uris, use decodeuri instead. syntax unescape(str) parameters str a string to be decoded. return value a new string in which certain characters have been unescaped.
description the unescape function is a property of the global object. examples using unescape unescape('abc123'); // "abc123" unescape('%e4%f6%fc'); // "äöü" unescape('%u0107'); // "ć" specifications specification ecmascript (ecma-262)the definition of 'unescape' in that specification. ...
uneval() - JavaScript
the uneval() function creates a string representation of the source code of an object. syntax uneval(object) parameters object a javascript expression or statement. return value a string representing the source code of object. note: this will not return a json representation of object.
description uneval() is a top-level function and is not associated with any object. examples using uneval var a = 1; uneval(a); // returns a string containing 1 var b = '1'; uneval(b); // returns a string containing "1" uneval(function foo() {}); // returns "(function foo(){})" var a = uneval(function foo() { return 'hi'; }); var foo = eval(a); foo(); // returns "hi" specifications not part of any standard. ...
Bitwise AND (&) - JavaScript
the bitwise and operator (&) returns a 1 in each bit position for which the corresponding bits of both operands are 1s. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax a & b
description the operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). numbers with more than 32 bits get their most significant bits discarded. for example, the following integer with more than 32 bits will be converted to a 32 bit integer: before: 11100110111110100000000000000110000000000001 after: 10100000000000000110000000000001 each bit in the first operand is paired with the corres...
Bitwise OR (|) - JavaScript
the bitwise or operator (|) returns a 1 in each bit position for which the corresponding bits of either or both operands are 1s. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax a | b
description the operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). numbers with more than 32 bits get their most significant bits discarded. for example, the following integer with more than 32 bits will be converted to a 32 bit integer: before: 11100110111110100000000000000110000000000001 after: 10100000000000000110000000000001 each bit in the first operand is paired with t...
Bitwise XOR (^) - JavaScript
the bitwise xor operator (^) returns a 1 in each bit position for which the corresponding bits of either but not both operands are 1s. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax a ^ b
description the operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). numbers with more than 32 bits get their most significant bits discarded. for example, the following integer with more than 32 bits will be converted to a 32 bit integer: before: 11100110111110100000000000000110000000000001 after: 10100000000000000110000000000001 each bit in the first operand is paired ...
Conditional (ternary) operator - JavaScript
request. syntax condition ? expriftrue : expriffalse parameters condition an expression whose value is used as a condition. expriftrue an expression which is evaluated if the condition evaluates to a truthy value (one which equals or can be converted to true). expriffalse an expression which is executed if the condition is falsy (that is, has a value which can be converted to false).
description besides false, possible falsy expressions are: null, nan, 0, the empty string (""), and undefined. if condition is any of these, the result of the conditional expression will be the result of executing the expression expriffalse. examples a simple example var age = 26; var beverage = (age >= 21) ? "beer" : "juice"; console.log(beverage); // "beer" handling null values one common usage is t...
Decrement (--) - JavaScript
the decrement operator (--) decrements (subtracts one from) its operand and returns a value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x-- or --x
description if used postfix, with operator after operand (for example, x--), the decrement operator decrements and returns the value before decrementing. if used prefix, with operator before operand (for example, --x), the decrement operator decrements and returns the value after decrementing. examples postfix decrement let x = 3; y = x--; // y = 3 // x = 2 prefix decrement let a = 2; b = --a; // a = 1 // b = 1 specifications spec...
Destructuring assignment - JavaScript
const x = [1, 2, 3, 4, 5]; the destructuring assignment uses similar syntax, but on the left-hand side of the assignment to define what values to unpack from the sourced variable. const x = [1, 2, 3, 4, 5]; const [y, z] = x; console.log(y); // 1 console.log(z); // 2 this capability is similar to ...
Equality (==) - JavaScript
rands are equal, returning a boolean result. unlike the strict equality operator, it attempts to convert and compare operands that are of different types. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax x == y
description the equality operators (== and !=) use the abstract equality comparison algorithm to compare two operands. this can be roughly summarised as follows: if the operands are both objects, return true only if both operands reference the same object. if one operand is null and the other is undefined, return true. if the operands are of different types, try to convert them to the same type before ...
Exponentiation (**) - JavaScript
of raising the first operand to the power of the second operand. it is equivalent to math.pow, except it also accepts bigints as operands. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: var1 ** var2
description the exponentiation operator is right-associative: a ** b ** c is equal to a ** (b ** c). in most languages, such as php, python, and others that have an exponentiation operator (**), the exponentiation operator is defined to have a higher precedence than unary operators, such as unary + and unary -, but there are a few exceptions. for example, in bash, the ** operator is defined to have a lower...
Greater than (>) - JavaScript
the greater than operator (>) returns true if the left operand is greater than the right operand, and false otherwise. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax x > y
description the operands are compared using the abstract relational comparison algorithm. see the documentation for the less than operator for a summary of this algorithm. examples string to string comparison console.log("a" > "b"); // false console.log("a" > "a"); // false console.log("a" > "3"); // true string to number comparison console.log("5" > 3); // true console.log("3" > 3); // false console...
Greater than or equal (>=) - JavaScript
the greater than or equal operator (>=) returns true if the left operand is greater than or equal to the right operand, and false otherwise. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax x >= y
description the operands are compared using the abstract relational comparison algorithm. see the documentation for the less than operator for a summary of this algorithm. examples string to string comparison console.log("a" >= "b"); // false console.log("a" >= "a"); // true console.log("a" >= "3"); // true string to number comparison console.log("5" >= 3); // true console.log("3" >= 3); //...
Grouping operator ( ) - JavaScript
the grouping operator ( ) controls the precedence of evaluation in expressions. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax ( )
description the grouping operator consists of a pair of parentheses around an expression or sub-expression to override the normal operator precedence so that expressions with lower precedence can be evaluated before an expression with higher priority. as it sounds, it groups what's inside of the parentheses. examples using the grouping operator overriding multiplication and division first, then addition and subtraction to evaluate addition first. var a = 1; var b = 2; var c = 3;...
Increment (++) - JavaScript
the increment operator (++) increments (adds one to) its operand and returns a value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x++ or ++x
description if used postfix, with operator after operand (for example, x++), the increment operator increments and returns the value before incrementing. if used prefix, with operator before operand (for example, ++x), the increment operator increments and returns the value after incrementing. examples postfix increment let x = 3; y = x++; // y = 3 // x = 4 prefix increment let a = 2; b = ++a; // a = 3 // b = 3 specifications specification...
Inequality (!=) - JavaScript
are not equal, returning a boolean result. unlike the strict inequality operator, it attempts to convert and compare operands that are of different types. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax x != y
description the inequality operator checks whether its operands are not equal. it is the negation of the equality operator so the following two lines will always give the same result: x != y !(x == y) for details of the comparison algorithm, see the page for the equality operator. like the equality operator, the inequality operator will attempt to convert and compare operands of different types: 3 != "...
Left shift (<<) - JavaScript
ts the first operand the specified number of bits to the left. excess bits shifted off to the left are discarded. zero bits are shifted in from the right. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax a << b
description this operator shifts the first operand the specified number of bits to the left. excess bits shifted off to the left are discarded. zero bits are shifted in from the right. for example, 9 << 2 yields 36: . 9 (base 10): 00000000000000000000000000001001 (base 2) -------------------------------- 9 << 2 (base 10): 00000000000000000000000000100100 (base 2) = 36 (base 10) bitw...
Less than (<) - JavaScript
the less than operator (<) returns true if the left operand is less than the right operand, and false otherwise. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax x < y
description the operands are compared using the abstract relational comparison algorithm, which is roughly summarised below: first, objects are converted to primitives using symbol.toprimitive. if both values are strings, they are compared as strings, based on the values of the unicode code points they contain. otherwise javascript attempts to convert non-numeric types to numeric values: boolean values true and false are converted to 1 a...
Less than or equal (<=) - JavaScript
the less than or equal operator (<=) returns true if the left operand is less than or equal to the right operand, and false otherwise. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax x <= y
description the operands are compared using the abstract relational comparison algorithm. see the documentation for the less than operator for a summary of this algorithm. examples string to string comparison console.log("a" <= "b"); // true console.log("a" <= "a"); // true console.log("a" <= "3"); // false string to number comparison console.log("5" <= 3); // false console.log("3" <= 3); // true...
Logical AND (&&) - JavaScript
ually returns the value of one of the specified operands, so if this operator is used with non-boolean values, it will return a non-boolean value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax expr1 && expr2
description if expr1 can be converted to true, returns expr2; else, returns expr1. if a value can be converted to true, the value is so-called truthy. if a value can be converted to false, the value is so-called falsy. examples of expressions that can be converted to false are: null; nan; 0; empty string ("" or '' or ``); undefined. even though the && operator can be used with operands that are n...
Logical AND assignment (&&=) - JavaScript
the logical and assignment (x &&= y) operator only assigns if x is truthy. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax expr1 &&= expr2
description short-circuit evaluation the logical and operator is evaluated left to right, it is tested for possible short-circuit evaluation using the following rule: (some falsy expression) && expr is short-circuit evaluated to the falsy expression; short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place). logical and assignment short-circuits as ...
Logical NOT (!) - JavaScript
with boolean (logical) values. when used with non-boolean values, it returns false if its single operand can be converted to true; otherwise, returns true. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax !expr
description returns false if its single operand can be converted to true; otherwise, returns true. if a value can be converted to true, the value is so-called truthy. if a value can be converted to false, the value is so-called falsy. examples of expressions that can be converted to false are: null; nan; 0; empty string ("" or '' or ``); undefined. even though the ! operator can be used with oper...
Logical OR (||) - JavaScript
ually returns the value of one of the specified operands, so if this operator is used with non-boolean values, it will return a non-boolean value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax expr1 || expr2
description if expr1 can be converted to true, returns expr1; else, returns expr2. if a value can be converted to true, the value is so-called truthy. if a value can be converted to false, the value is so-called falsy. examples of expressions that can be converted to false are: null; nan; 0; empty string ("" or '' or ``); undefined. even though the || operator can be used with operands that are n...
Logical OR assignment (||=) - JavaScript
the logical or assignment (x ||= y) operator only assigns if x is falsy. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax expr1 ||= expr2
description short-circuit evaluation the logical or operator works like this: x || y; // returns x when x is truthy // returns y when x is not truthy the logical or operator short-circuits: the second operand is only evaluated if the first operand doesn’t already determine the result. logical or assignment short-circuits as well, meaning it only performs an assignment if the logical operation would evaluate the right-hand side. in other words, x ||= y is equivalent to: x...
Logical nullish assignment (??=) - JavaScript
the logical nullish assignment (x ??= y) operator only assigns if x is nullish (null or undefined). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax expr1 ??= expr2
description short-circuit evaluation the nullish coalescing operator is evaluated left to right, it is tested for possible short-circuit evaluation using the following rule: (some expression that is neither null nor undefined) ?? expr is short-circuit evaluated to the left-hand side expression if the left-hand side proves to be neither null nor undefined. short circuit means that the expr part above is not evaluated, hence any side effects of doing...
Object initializer - JavaScript
e compatibility table for support for these notations. in non-supporting environments, these notations will lead to syntax errors. // shorthand property names (es2015) let a = 'foo', b = 42, c = {}; let o = {a, b, c} // shorthand method names (es2015) let o = { property(parameters) {} } // computed property names (es2015) let prop = 'foo' let o = { [prop]: 'hey', ['b' + 'ar']: 'there' }
description an object initializer is an expression that describes the initialization of an object. objects consist of properties, which are used to describe an object. values of object properties can either contain primitive data types or other objects. object literal notation vs json the object literal notation is not the same as the javascript object notation (json). although they look similar, there ar...
Optional chaining (?.) - JavaScript
ful while exploring the content of an object when there's no known guarantee as to which properties are required. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax obj?.prop obj?.[expr] arr?.[index] func?.(args)
description the optional chaining operator provides a way to simplify accessing values through connected objects when it's possible that a reference or function may be undefined or null. for example, consider an object obj which has a nested structure. without optional chaining, looking up a deeply-nested subproperty requires validating the references in between, such as: let nestedprop = obj.first && obj...
Property accessors - JavaScript
property accessors provide access to an object's properties by using the dot notation or the bracket notation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.property object['property']
description one can think of an object as an associative array (a.k.a. map, dictionary, hash, lookup table). the keys in this array are the names of the object's properties. it's typical when speaking of an object's properties to make a distinction between properties and methods. however, the property/method distinction is little more than a convention. a method is simply a property that can be called (for example, if it...
Right shift (>>) - JavaScript
the new leftmost bit has the same value as the previous leftmost bit, the sign bit (the leftmost bit) does not change. hence the name "sign-propagating". the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax a >> b
description this operator shifts the first operand the specified number of bits to the right. excess bits shifted off to the right are discarded. copies of the leftmost bit are shifted in from the left. since the new leftmost bit has the same value as the previous leftmost bit, the sign bit (the leftmost bit) does not change. hence the name "sign-propagating". for example, 9 >> 2 yields 2: . 9 (base 10...
Strict equality (===) - JavaScript
qual, returning a boolean result. unlike the equality operator, the strict equality operator always considers operands of different types to be different. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax x === y
description the strict equality operators (=== and !==) use the strict equality comparison algorithm to compare two operands. if the operands are of different types, return false. if both operands are objects, return true only if they refer to the same object. if both operands are null or both operands are undefined, return true. if either operand is nan, return false. otherwise, compare the two oper...
Strict inequality (!==) - JavaScript
, returning a boolean result. unlike the inequality operator, the strict inequality operator always considers operands of different types to be different. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax x !== y
description the strict inequality operator checks whether its operands are not equal. it is the negation of the strict equality operator so the following two lines will always give the same result: x !== y !(x === y) for details of the comparison algorithm, see the page for the strict equality operator. like the strict equality operator, the strict inequality operator will always consider operands of di...
Unary plus (+) - JavaScript
the unary plus operator (+) precedes its operand and evaluates to its operand but attempts to convert it into a number, if it isn't already. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: +x
description although unary negation (-) also can convert non-numbers, unary plus is the fastest and preferred way of converting something into a number, because it does not perform any other operations on the number. it can convert string representations of integers and floats, as well as the non-string values true, false, and null. integers in both decimal and hexadecimal (0x-prefixed) formats are supported. nega...
Unsigned right shift (>>>) - JavaScript
e sign bit becomes 0, so the result is always non-negative. unlike the other bitwise operators, zero-fill right shift returns an unsigned 32-bit integer. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax a >>> b
description this operator shifts the first operand the specified number of bits to the right. excess bits shifted off to the right are discarded. zero bits are shifted in from the left. the sign bit becomes 0, so the result is always non-negative. unlike the other bitwise operators, zero-fill right shift returns an unsigned 32-bit integer. for non-negative numbers, zero-fill right shift and sign-propagatin...
async function expression - JavaScript
async function [name]([param1[, param2[, ..., paramn]]]) { statements } as of es2015, you can also use arrow functions. parameters name the function name. can be omitted, in which case the function is anonymous. the name is only local to the function body. paramn the name of an argument to be passed to the function. statements the statements which comprise the body of the function.
description an async function expression is very similar to, and has almost the same syntax as, an async function statement. the main difference between an async function expression and an async function statement is the function name, which can be omitted in async function expressions to create anonymous functions. an async function expression can be used as an iife (immediately invoked function expression...
await - JavaScript
the await operator is used to wait for a promise. it can only be used inside an async function. syntax [rv] = await expression; expression a promise or any value to wait for. rv returns the fulfilled value of the promise, or the value itself if it's not a promise.
description the await expression causes async function execution to pause until a promise is settled (that is, fulfilled or rejected), and to resume execution of the async function after fulfillment. when resumed, the value of the await expression is that of the fulfilled promise. if the promise is rejected, the await expression throws the rejected value. if the value of the expression following the await operator is not a promise, it's converted to a resolved promise. an await can split execution flow, allowing the calle...
class expression - JavaScript
al to the class body only. javascript classes use prototype-based inheritance. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const myclass = class [classname] [extends otherclassname] { // class body };
description a class expression has a similar syntax to a class declaration (statement). as with class statements, the body of a class expression is executed in strict mode. there are several differences between class expressions and class statements, however: class expressions may omit the class name ("binding identifier"), which is not possible with class statements. class expressions allow you to red...
delete operator - JavaScript
delete object['property'] parameters object the name of an object, or an expression evaluating to an object. property the property to delete. return value true for all cases except when the property is an own non-configurable property, in which case, false is returned in non-strict mode. exceptions throws typeerror in strict mode if the property is an own non-configurable property.
description unlike what common belief suggests (perhaps due to other programming languages like delete in c++), the delete operator has nothing to do with directly freeing memory. memory management is done indirectly via breaking references. see the memory management page for more details. the delete operator removes a given property from an object. on successful deletion, it will return true, else false w...
function* expression - JavaScript
on* [name]([param1[, param2[, ..., paramn]]]) { statements } parameters name optional the function name. can be omitted, in which case the function is anonymous. the name is only local to the function body. paramn optional the name of an argument to be passed to the function. a function can have up to 255 arguments. statements the statements which comprise the body of the function.
description a function* expression is very similar to and has almost the same syntax as a function* statement. the main difference between a function* expression and a function* statement is the function name, which can be omitted in function* expressions to create anonymous generator functions. see also the chapter about functions for more information. examples using function* the following example defi...
Function expression - JavaScript
m1[, param2[, ..., paramn]]]) { statements } as of es2015, you can also use arrow functions. parameters name optional the function name. can be omitted, in which case the function is anonymous. the name is only local to the function body. paramn optional the name of an argument to be passed to the function. statements optional the statements which comprise the body of the function.
description a function expression is very similar to and has almost the same syntax as a function declaration (see function statement for details). the main difference between a function expression and a function declaration is the function name, which can be omitted in function expressions to create anonymous functions. a function expression can be used as an iife (immediately invoked function expression) ...
instanceof - JavaScript
object. the return value is a boolean value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object instanceof constructor parameters object the object to test. constructor function to test against
description the instanceof operator tests the presence of constructor.prototype in object's prototype chain. // defining constructors function c() {} function d() {} let o = new c() // true, because: object.getprototypeof(o) === c.prototype o instanceof c // false, because d.prototype is nowhere in o's prototype chain o instanceof d o instanceof object // true, because: c.prototype instanceof...
new operator - JavaScript
the new operator lets developers create an instance of a user-defined object type or of one of the built-in object types that has a constructor function. syntax new constructor[([arguments])] parameters constructor a class or function that specifies the type of the object instance. arguments a list of values that the constructor will be called with.
description the new keyword does the following things: creates a blank, plain javascript object; links (sets the constructor of) this object to another object; passes the newly created object from step 1 as the this context; returns this if the function doesn't return an object. creating a user-defined object requires two steps: define the object type by writing a function. create an instance of the object with new. to defi...
new.target - JavaScript
tions invoked using the new operator, new.target returns a reference to the constructor or function. in normal function calls, new.target is undefined. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new.target
description the new.target syntax consists of the keyword new, a dot, and the identifier target. normally, the left-hand side of the dot is the object on which property access is performed, but here, new is not an object. the new.target pseudo-property is available in all functions. in class constructors, it refers to the constructed class. in ordinary functions, it refers to the function itself, assumin...
this - JavaScript
e for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax this value a property of an execution context (global, function or eval) that, in non–strict mode, is always a reference to an object and in strict mode can be any value.
description global context in the global execution context (outside of any function), this refers to the global object whether in strict mode or not. // in web browsers, the window object is also the global object: console.log(this === window); // true a = 37; console.log(window.a); // 37 this.b = "mdn"; console.log(window.b) // "mdn" console.log(b) // "mdn" note: you can always easily get t...
typeof - JavaScript
nteractive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax the typeof operator is followed by its operand: typeof operand typeof(operand) parameters operand an expression representing the object or primitive whose type is to be returned.
description the following table summarizes the possible return values of typeof. for more information about types and primitives, see also the javascript data structure page. type result undefined "undefined" null "object" (see below) boolean "boolean" number "number" bigint (new in ecmascript 2020) "bigint" string "str...
void operator - JavaScript
the void operator evaluates the given expression and then returns undefined. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax void expression
description this operator allows evaluating expressions that produce a value into places where an expression that evaluates to undefined is desired. the void operator is often used merely to obtain the undefined primitive value, usually using "void(0)" (which is equivalent to "void 0"). in these cases, the global variable undefined can be used. it should be noted that the precedence of the void operator should be taken into account and that parentheses can help clarify the...
yield* - JavaScript
ield* expression is used to delegate to another generator or iterable object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax yield* expression; expression the expression which returns an iterable object.
description the yield* expression iterates over the operand and yields each value returned by it. the value of yield* expression itself is the value returned by that iterator when it's closed (i.e., when done is true). examples delegating to another generator in following code, values yielded by g1() are returned from next() calls just like those which are yielded by g2(). function* g1() { yield 2; ...
yield - JavaScript
amples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax [rv] = yield [expression] expression optional defines the value to return from the generator function via the iterator protocol. if omitted, undefined is returned instead. rv optional retrieves the optional value passed to the generator's next() method to resume its execution.
description the yield keyword pauses generator function execution and the value of the expression following the yield keyword is returned to the generator's caller. it can be thought of as a generator-based version of the return keyword. yield can only be called directly from the generator function that contains it. it cannot be called from nested functions or from callbacks. the yield keyword causes the ...
empty - JavaScript
an empty statement is used to provide no statement, although the javascript syntax would expect one. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax ;
description the empty statement is a semicolon (;) indicating that no statement will be executed, even if javascript syntax requires one. the opposite behavior, where you want multiple statements, but javascript only allows a single one, is possible using a block statement, which combines several statements into a single one. examples empty loop body the empty statement is sometimes used with loop statements. see the following example with an empty loop body: ...
async function - JavaScript
statements } parameters name the function’s name. param the name of an argument to be passed to the function. statements the statements comprising the body of the function. the await mechanism may be used. return value a promise which will be resolved with the value returned by the async function, or rejected with an exception thrown from, or uncaught within, the async function.
description async functions can contain zero or more await expressions. await expressions suspend progress through an async function, yielding control and subsequently resuming progress only when an awaited promise-based asynchronous operation is either fulfilled or rejected. the resolved value of the promise is treated as the return value of the await expression. use of async / await enables the use of ord...
block - JavaScript
contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax block statement { statementlist } labelled block statement labelidentifier: { statementlist } statementlist statements grouped within the block statement. labelidentifier an optional label for visual identification or as a target for break.
description the block statement is often called compound statement in other languages. it allows you to use multiple statements where javascript expects only one statement. combining statements into blocks is a common practice in javascript. the opposite behavior is possible using an empty statement, where you provide no statement, although one is required. blocks are commonly used in association with if..
break - JavaScript
d statement. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax break [label]; label optional identifier associated with the label of the statement. if the statement is not a loop or switch, this is required.
description the break statement includes an optional label that allows the program to break out of a labeled statement. the break statement needs to be nested within the referenced label. the labeled statement can be any block statement; it does not have to be preceded by a loop statement. a break statement, with or without a following label, cannot be used within the body of a function that is itself nest...
class - JavaScript
contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. you can also define a class using a class expression. but unlike a class expression, a class declaration doesn't allow an existing class to be declared again and will throw a syntaxerror if attempted. syntax class name [extends othername] { // class body }
description the class body of a class declaration is executed in strict mode. the constructor method is optional. class declarations are not hoisted (unlike function declarations). examples a simple class declaration in the following example, we first define a class named polygon, then extend it to create a class named square. note that super(), used in the constructor, can only be used in constructors...
const - JavaScript
itory. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const name1 = value1 [, name2 = value2 [, ... [, namen = valuen]]]; namen the constant's name, which can be any legal identifier. valuen the constant's value. this can be any legal expression, including a function expression.
description this declaration creates a constant whose scope can be either global or local to the block in which it is declared. global constants do not become properties of the window object, unlike var variables. an initializer for a constant is required. you must specify its value in the same statement in which it's declared. (this makes sense, given that it can't be changed later.) the const declaratio...
continue - JavaScript
or labeled loop, and continues execution of the loop with the next iteration. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax continue [label]; label identifier associated with the label of the statement.
description in contrast to the break statement, continue does not terminate the execution of the loop entirely: instead, in a while loop, it jumps back to the condition. in a for loop, it jumps to the update expression. the continue statement can include an optional label that allows the program to jump to the next iteration of a labeled loop statement instead of the current loop. in this case, the...
export - JavaScript
{ name1 as default, … }; // aggregating modules export * from …; // does not set the default export export * as name1 from …; // draft ecmascript® 2o21 export { name1, name2, …, namen } from …; export { import1 as name1, import2 as name2, …, namen } from …; export { default } from …; namen identifier to be exported (so that it can be imported via import in another script).
description there are two different types of export, named and default. you can have multiple named exports per module but only one default export. each type corresponds to one of the above syntax: named exports: // export features declared earlier export { myfunction, myvariable }; // export individual features (can export var, let, // const, function, class) export let myvariable = math.sqrt(2); export...
for...in - JavaScript
ive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax for (variable in object) statement variable a different property name is assigned to variable on each iteration. object object whose non-symbol enumerable properties are iterated over.
description a for...in loop only iterates over enumerable, non-symbol properties. objects created from built–in constructors like array and object have inherited non–enumerable properties from object.prototype and string.prototype, such as string's indexof() method or object's tostring() method. the loop will iterate over all enumerable properties of the object itself and those the object inherits from ...
function* - JavaScript
nteractive-examples and send us a pull request. you can also define generator functions using the generatorfunction constructor, or the function expression syntax. syntax function* name([param[, param[, ... param]]]) { statements } name the function name. param optional the name of a formal parameter for the function. statements the statements comprising the body of the function.
description generators are functions that can be exited and later re-entered. their context (variable bindings) will be saved across re-entrances. generators in javascript -- especially when combined with promises -- are a very powerful tool for asynchronous programming as they mitigate -- if not entirely eliminate -- the problems with callbacks, such as callback hell and inversion of control. however, an ...
function declaration - JavaScript
ease clone https://github.com/mdn/interactive-examples and send us a pull request. syntax function name([param[, param,[..., param]]]) { [statements] } name the function name. param optional the name of an argument to be passed to the function. maximum number of arguments varies in different engines. statements optional the statements which comprise the body of the function.
description a function created with a function declaration is a function object and has all the properties, methods and behavior of function objects. see function for detailed information on functions. a function can also be created using an expression (see function expression). by default, functions return undefined. to return any other value, the function must have a return statement that specifies the ...
if...else - JavaScript
condition is truthy. can be any statement, including further nested if statements. to execute multiple statements, use a block statement ({ ... }) to group those statements. to execute no statements, use an empty statement. statement2 statement that is executed if condition is falsy and the else clause exists. can be any statement, including block statements and further nested if statements.
description multiple if...else statements can be nested to create an else if clause. note that there is no elseif (in one word) keyword in javascript. if (condition1) statement1 else if (condition2) statement2 else if (condition3) statement3 ... else statementn to see how this works, this is how it would look if the nesting were properly indented: if (condition1) statement1 else if (conditio...
import.meta - JavaScript
normally the left-hand side of the dot is the object on which property access is performed, but here import is not really an object. the import.meta object is created by the ecmascript implementation, with a null prototype. the object is extensible, and its properties are writable, configurable, and enumerable. ...
import - JavaScript
th name to the .js file containing the module. certain bundlers may permit or require the use of the extension; check your environment. only single quoted and double quoted strings are allowed. name name of the module object that will be used as a kind of namespace when referring to the imports. exportn name of the exports to be imported. aliasn names that will refer to the named imports.
description the name parameter is the name of the "module object" which will be used as a kind of namespace to refer to the exports. the export parameters specify individual named exports, while the import * as name syntax imports all of them. below are examples to clarify the syntax. import an entire module's contents this inserts mymodule into the current scope, containing all the exports from the modul...
label - JavaScript
dn/interactive-examples and send us a pull request. note: labeled loops or blocks are very uncommon. usually function calls can be used instead of loop jumps. syntax label : statement label any javascript identifier that is not a reserved word. statement a javascript statement. break can be used with any labeled statement, and continue can be used with looping labeled statements.
description you can use a label to identify a loop, and then use the break or continue statements to indicate whether a program should interrupt the loop or continue its execution. note that javascript has no goto statement, you can only use labels with break or continue. in strict mode code, you can't use "let" as a label name. it will throw a syntaxerror (let is a reserved identifier). examples using ...
let - JavaScript
ctive-examples and send us a pull request. syntax let var1 [= value1] [, var2 [= value2]] [, ..., varn [= valuen]; parameters var1, var2, …, varn the names of the variable or variables to declare. each must be a legal javascript identifier. value1, value2, …, valuen optional for each variable declared, you may optionally specify its initial value to any legal javascript expression.
description let allows you to declare variables that are limited to the scope of a block statement, or expression on which it is used, unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope. the other difference between var and let is that the latter is initialized to a value only when a parser evaluates it (see below). just like const the let ...
return - JavaScript
returned to the function caller. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax return [[expression]]; expression the expression whose value is to be returned. if omitted, undefined is returned instead.
description when a return statement is used in a function body, the execution of the function is stopped. if specified, a given value is returned to the function caller. for example, the following function returns the square of its argument, x, where x is a number. function square(x) { return x * x; } var demo = square(3); // demo will equal 9 if the value is omitted, undefined is returned instead. t...
switch - JavaScript
ched against each case clause. case valuen optional a case clause used to match against expression. if the expression matches the specified valuen, the statements inside the case clause are executed until either the end of the switch statement or a break. default optional a default clause; if provided, this clause is executed if the value of expression doesn't match any of the case clauses.
description a switch statement first evaluates its expression. it then looks for the first case clause whose expression evaluates to the same value as the result of the input expression (using the strict comparison, ===) and transfers control to that clause, executing the associated statements. (if multiple cases match the provided value, the first case that matches is selected, even if the cases are not eq...
throw - JavaScript
block in the call stack. if no catch block exists among caller functions, the program will terminate. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax throw expression; expression the expression to throw.
description use the throw statement to throw an exception. when you throw an exception, expression specifies the value of the exception. each of the following throws an exception: throw 'error2'; // generates an exception with a string value throw 42; // generates an exception with the value 42 throw true; // generates an exception with the value true throw new error('required'); // generates an...
try...catch - JavaScript
statements that are executed if an exception is thrown in the try-block. exception_var_1, exception_var_2 an identifier to hold an exception object for the associated catch-block. condition_1 a conditional expression. finally_statements statements that are executed after the try statement completes. these statements execute regardless of whether an exception was thrown or caught.
description the try statement consists of a try-block, which contains one or more statements. {} must always be used, even for single statements. at least one catch-block, or a finally-block, must be present. this gives us three forms for the try statement: try...catch try...finally try...catch...finally a catch-block contains statements that specify what to do if an exception is thrown in the try-bl...
var - JavaScript
ike to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax var varname1 [= value1] [, varname2 [= value2] ... [, varnamen [= valuen]]]; varnamen variable name. it can be any legal identifier. valuen optional initial value of the variable. it can be any legal expression. default value is undefined.
description var declarations, wherever they occur, are processed before any code is executed. this is called hoisting, and is discussed further below. the scope of a variable declared with var is its current execution context and closures thereof, which is either the enclosing function and functions declared within it, or, for variables declared outside any function, global. duplicate variable declarations...
with - JavaScript
use of the with statement is not recommended, as it may be the source of confusing bugs and compatibility issues. see the "ambiguity contra" paragraph in the "
description" section below for details. the with statement extends the scope chain for a statement. syntax with (expression) statement expression adds the given expression to the scope chain used when evaluating the statement. the parentheses around the expression are required. statement any statement. to execute multiple statements, use a block statement ({ ... }) to group those statements.
description javascript looks up an unqualified name by searching a scope chain associated with the execution context of the script or function containing that unqualified name. the 'with' statement adds the given object to the head ...
Template literals (Template strings) - JavaScript
template literals are string literals allowing embedded expressions. you can use multi-line strings and string interpolation features with them. they were called "template strings" in prior editions of the es2015 specification. syntax `string text` `string text line 1 string text line 2` `string text ${expression} string text` tag`string text ${expression} string text`
description template literals are enclosed by the backtick (` `) (grave accent) character instead of double or single quotes. template literals can contain placeholders. these are indicated by the dollar sign and curly braces (${expression}). the expressions in the placeholders and the text between the backticks (` `) get passed to a function. the default function just concatenates the parts into a single string. if there...
JavaScript typed arrays - JavaScript
write the contents of the buffer. typed array views typed array views have self-descriptive names and provide views for all the usual numeric types like int8, uint32, float64 and so forth. there is one special typed array view, the uint8clampedarray. it clamps the values between 0 and 255. this is useful for canvas data processing, for example. ...
dir - Web app manifests
the base direction in which to display direction-capable members of the manifest. together with the lang member, it helps to correctly display right-to-left languages. the dir member can be set to one of the following values: auto — text direction is determined by the user agent ltr — left to right rtl — right to left the directionality-capable members are: name short_name
description note: if the value is omitted or set to auto, the browser will use the unicode bidirectional algorithm to make a best guess about the text's direction. example "dir": "rtl", "lang": "ar", "short_name": "!أنا من التطبيق" specification specification status comment feedback web app manifestthe definition of 'dir' in that specification. ...
display - Web app manifests
is full-screened). note: if the display member is not specified, it defaults to browser. note: you can selectively apply css to your app based on the display mode, using the display-mode media feature. this can be used to provide a consistent user experience between launching a site from an url and launching it from a desktop icon. values the possible values are: display mode
description fallback display mode fullscreen all of the available display area is used and no user agent chrome is shown. standalone standalone the application will look and feel like a standalone application. this can include the application having a different window, its own icon in the application launcher, etc. in this mode, the user agent will exclude ui elements for co...
icons - Web app manifests
tem preferences. examples "icons": [ { "src": "icon/lowres.webp", "sizes": "48x48", "type": "image/webp" }, { "src": "icon/lowres", "sizes": "48x48" }, { "src": "icon/hd_hi.ico", "sizes": "72x72 96x96 128x128 256x256" }, { "src": "icon/hd_hi.svg", "sizes": "72x72" } ] values image objects may contain the following values: member
description sizes a string containing space-separated image dimensions. src the path to the image file. if src is a relative url, the base url will be the url of the manifest. type a hint as to the media type of the image. the purpose of this member is to allow a user agent to quickly ignore images with media types it does not support. purpose defines ...
related_applications - Web app manifests
lications to true. examples "related_applications": [ { "platform": "play", "url": "https://play.google.com/store/apps/details?id=com.example.app1", "id": "com.example.app1" }, { "platform": "itunes", "url": "https://itunes.apple.com/app/example-app1/id123456789" } ] related application values application objects may contain the following values: member
description platform the platform on which the application can be found. list of available values url the url at which the application can be found. id the id used to represent the application on the specified platform. specification specification status comment feedback web app manifestthe definition of 'related_applications' in ...
serviceworker - Web app manifests
type object mandatory no the serviceworker member describes a service worker that the developer intends to install to control the pwa. examples "serviceworker": { "src": "./serviceworker.js", "scope": "/app", "type": "", "update_via_cache": "none" } values service worker contain the following values (only src is required): member
description src the url to download the service worker script from. this is the only required member of the serviceworker member. scope a string 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, relative to the base url of the application. by default, the scope value for a servic...
shortcuts - Web app manifests
er agent can use these values to assemble a context menu to be displayed by the operating system when a user engages with the web app's icon. when user invokes a shortcut, the user agent will navigate to the address given by shortcut's url member. examples the following is a list of shortcuts a calendar app might have: "shortcuts" : [ { "name": "today's agenda", "url": "/today", "
description": "list of events planned for today" }, { "name": "new event", "url": "/create/event" }, { "name": "new reminder", "url": "/create/reminder" } ] specification specification status comment feedback web app manifestthe definition of 'shortcuts' in that specification. working draft initial definition. ...
Values - MathML
lengths several mathml presentation elements have attributes that accept length values used for size or spacing. mathml accepts different units and constants for specifying lengths. units unit
description em font-relative unit ex font-relative unit. (the "x"-height of the element, 1ex ≈ 0.5em in many fonts) px pixels in inches (1 inch = 2.54 centimeters) cm centimeters mm millimeters pt points (1 point = 1/72 inch) pc picas (1 pica = 12 points) % percentage of the default value. constants a replacement for the deprecated constants below is: veryverythinmathspace => 0.05555555555555555em verythinmathspace => 0.1111111111111111em thinmathspace => 0...
MathML attribute reference - MathML
lements accept all attributes of all mathml presentation elements. see values for notes on values and units in mathml. the attributes background, color, fontfamily, fontsize, fontstyle, fontweight and xlink:href are deprecated. the xlink attributes on mathml elements: xlink:actuate, xlink:href, xlink:show and xlink:type are deprecated as well. name elements accepting attribute
description accent <mo>, <mover>, <munderover> a boolean value specifying whether the operator should be treated as an accent. accentunder <munder>, <munderover> a boolean value specifying whether the operator should be treated as an accent. actiontype <maction> a string value specifying the action happening for this element. align <mtable> <...
<menclose> - MathML
u can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. notation a list of notations, separated by white space, to apply to the child elements. the symbols are each drawn as if the others are not present, and therefore may overlap. possible values are: value sample rendering rendering in your browser
description longdiv (default) a2 + b2 long division symbol actuarial a2 + b2 actuarial symbol radical a2 + b2 square root symbol. deprecated. use <msqrt> instead. box a2 + b2 box roundedbox a2 + b2 rounded box circle a2 + b2 circle ...
Digital audio concepts - Web media technologies
owever, an audio frame is always comprised of all of the data for all available channels. the number of frames that comprise a single second of audio varies depending on the sample rate used when recording the sound. since the sample rate corresponds to the number of "slices" a sound wave is divided into for each second of time, it's sometimes thought of as a frequency (in the sense that it's a
description of something that repeats periodically, not in terms of actual audio frequency), and the samples per second measurement therefore uses the hertz as its unit. the most common sample rates are: 8000 hz the international g.711 standard for audio used in telephony uses a sample rate of 8000 hz (8 khz). this is enough for human speech to be comprehensible. 44100 hz the 44.1 khz sample rate is u...
Web video codec guide - Web media technologies
ively stationary, but if there is a great deal of motion in the frame, the number of differences between frames can be so great that compression doesn't do any good. motion compensation is a technique that looks for motion (either of the camera or of objects in the frame of view) and determines how many pixels the moving object has moved in each direction. then that shift is stored, along with a
description of the pixels that have moved that can't be described just by that shift. in essence, the encoder finds the moving objects, then builds an internal frame of sorts that looks like the original but with all the objects translated to their new locations. in theory, this approximates the new frame's appearance. then, to finish the job, the remaining differences are found, then the set of object shift...
Codecs used by WebRTC - Web media technologies
st the way we want (see below). finally, we call the rtcrtptransceiver's setcodecpreferences() method to specify that the given send and receive codecs are allowed, in the newly rearranged order. that's done for each transceiver on the rtcpeerconnection; once all of the transceivers have been updated, we call the onnegotiationneeded event handler, which will create a new offer, update the local
description, send the offer along to the remote peer, and so on, thereby triggering the renegotiation of the connection. the prefercodec() function called by the code above looks like this to move a specified codec to the top of the list (to be prioritized during negotiation): function prefercodec(codecs, mimetype) { let othercodecs = []; let sortedcodecs = []; let count = codecs.length; codecs.fo...
Recommended Web Performance Timings: How long is too long? - Web Performance
but what does that mean? a second should be considered a rule in the maximum amount of time to indicate to a user that the request for new content was made and will load, such as the browser displaying the page title and the background color of the page displaying. the first asset retrieved from a request is usually an html document, which then makes calls for additional assets. as noted in the
description of the critical rendering path, when received, browsers immediately start processing the html, rendering the content as it is received rather than waiting for additional assets to load. yes, one second for loading is a goal, but it's something few sites achieve. expectations differ. a 'hello world' on the corporate network would be expected to load in milliseconds, but a user downloading a cat v...
Privacy, permissions, and information security
reaching your web app code and the efforts it takes to secure itself and the data the user entrusts to it. there are several web technologies and features at play to manage privacy and security. the following list includes features affecting both, since many of these features are used for both. ...
Add to Home screen - Progressive web apps (PWAs)
when the added-to-home screen app is launched. note that this has to be a relative url pointing to the site index, relative to the url of the manifest. also, be aware that chrome requires this before it will display the install banner, whereas firefox doesn't require it for showing the home-with-a-plus icon. the manifest for our sample app looks like this: { "background_color": "purple", "
description": "shows random fox pictures. hey, at least it isn't cats.", "display": "fullscreen", "icons": [ { "src": "icon/fox-icon.png", "sizes": "192x192", "type": "image/png" } ], "name": "awesome fox pictures", "short_name": "foxes", "start_url": "/pwa-examples/a2hs/index.html" } appropriate icon as shown in the above manifest listing, we are including a 192 x 192...
Progressive loading - Progressive web apps (PWAs)
g <img> tags with <a> elements pointing at the target images, so the user can click and access them when desired. we won't do that because the app itself is dependent on javascript — without it, the list of games wouldn't even be loaded, and the service worker code wouldn't be executed. we could rewrite the loading process to load not only the images, but the complete items consisting of full
descriptions and links. it would work like an infinite scroll — loading the items on the list only when the user scrolls the page down. that way the initial html structure would be minimal, loading time even smaller, and we would have even greater performance benefits. conclusion less files to load initially, smaller files split into modules, use of placeholders, and loading more content on demand — th...
clip-rule - SVG: Scalable Vector Graphics
"..." /> </clippath> <rect clip-path="url(#myclip)" clip-rule="evenodd" ... /> </g> as a presentation attribute, it also can be used as a property directly inside a css stylesheet usage context categories presentation attribute value nonzero | evenodd | inherit animatable yes normative document svg 1.1 (2nd edition) nonzero see
description of fill-rule property. evenodd see
description of fill-rule property. example <svg width="100" viewbox="0 0 100 90" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- define star path --> <defs> <path d="m50,0 21,90 98,35 2,35 79,90z" id="star" /> </defs> <!-- left: evenodd --> <clippath id="emptystar"> <use xlink:href="#star" clip-rule="evenodd" /> </clippath> <re...
color-profile - SVG: Scalable Vector Graphics
pecified within content data. for images that do have a profile built into their data, that profile is used. for images that do not have a profile, the srgb profile is used. srgb the source profile is assumed to be srgb. this differs from auto in that it overrides an embedded profile inside an image. <name> a name corresponding to a defined color profile that is in the browser's color profile
description database. the browser searches the color profile
description database for a color profile
description entry whose name descriptor matches <name> and uses the last matching entry that is found. if a match is found, the corresponding profile overrides an embedded profile inside an image. if no match is found, then the embedded profile inside the image is used. <iri> an iri reference to the source...
display - SVG: Scalable Vector Graphics
specifications specification status comment scalable vector graphics (svg) 2the definition of 'display' in that specification. candidate recommendation refers to the css 2 specification of the display property, but outlines the differences regarding svg. scalable vector graphics (svg) 1.1 (second...
filter - SVG: Scalable Vector Graphics
> element. html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <filter id="blur"> <fegaussianblur stddeviation="2" /> </filter> <rect x="10" y="10" width="80" height="80" filter="url(#blur)" /> </svg> usage notes value none | <filter-function-list> default value none animatable yes for a
description of the values see the css filter property. specifications specification status comment filter effects module level 1the definition of 'filter' in that specification. working draft extended the values by several special filter functions. scalable vector graphics (svg) 1.1 (second edition)the definition of 'filter' in that specification. recommendatio...
font-family - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 4the definition of 'generic font families' in that specification. working draft adds new generic font families, specifically: system-ui, emoji, math, and fangsong. css fonts module level 3the definition of 'font-family' in tha...
font-size - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 3the definition of 'font-size' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'font-size' in that specification. recommendation initial defini...
font-style - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 4the definition of 'font-style' in that specification. working draft no change css fonts module level 3the definition of 'font-style' in that specification. candidate recommendation no change scalable vector grap...
font-variant - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 4the definition of 'font-variant' in that specification. working draft no change css fonts module level 3the definition of 'font-variant' in that specification. candidate recommendation added many more keywords for diff...
font-weight - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 4the definition of 'font-weight' in that specification. working draft defines font-weight to accept any numbers between 1 and 1000. css fonts module level 3the definition of 'font-weight' in that specification. candidate re...
href - SVG: Scalable Vector Graphics
d and the animation element can be used as syncbase in an identical fashion to when the url refers to a valid target element. if the href attribute or the deprecated xlink:href attribute is not provided, then the target element will be the immediate parent element of the current animation element. if both xlink:href and href are specified, the value of the latter attribute is used. refer to the
descriptions of the individual animation elements for any restrictions on what types of elements can be targets of particular types of animations. except for any svg-specific rules explicitly mentioned in this specification, the normative definition for this attribute is the smil animation specification. in particular, see smil animation: specifying the animation target. value <url> de...
letter-spacing - SVG: Scalable Vector Graphics
prior to firefox 72 firefox ignored letter-spacing and renders text without. specifications specification status comment css text module level 3the definition of 'letter-spacing' in that specification. working draft svg 2 just refers to the definition in css text 3. scalable vector graphi...
mode - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'mode' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'mode' in that specification. recommendation initial definition ...
name - SVG: Scalable Vector Graphics
this value is the name which is used as the first parameter for icc color specifications within fill, stroke, stop-color, flood-color and lighting-color property values to identify the color profile to use for the icc color specification and the name which can be the value of the color-profile property. note: if no name is provided, it will be impossible to reference the given color profile
description. the name "srgb" is predefined; any color profile
descriptions with <name> set to "srgb" (case-insensitively) will be ignored. font-face-name for <font-face-name>, name defines the name of the font face. value <name> default value none animatable yes <name> this value specifies the name of a local font. unlike the syntax allowed between the pa...
orient - SVG: Scalable Vector Graphics
angle in degrees. the marker is oriented such that the specified angle is that measured between the shape's positive x-axis and the marker's positive x-axis. specifications specification status comment scalable vector graphics (svg) 2the definition of 'orient' in that specification. candidate recommendation added the auto-start-reverse value and simplified the
descriptions of the values. scalable vector graphics (svg) 1.1 (second edition)the definition of 'orient' in that specification. recommendation initial definition ...
overflow - SVG: Scalable Vector Graphics
specifications specification status comment css level 2 (revision 1)the definition of 'overflow' in that specification. recommendation definition in css scalable vector graphics (svg) 2the definition of 'overflow' in that specification. candidate recommendation simplifies the definition and out...
text-decoration - SVG: Scalable Vector Graphics
specifications specification status comment css text decoration module level 3the definition of 'text-decoration' in that specification. candidate recommendation defines the property as a shorthand for text-decoration-line, text-decoration-style, and text-decoration-color. scalable vector...
u1 - SVG: Scalable Vector Graphics
if a given unicode character within the set has multiple corresponding <glyph> elements (i.e., there are multiple <glyph> elements with the same unicode attribute value but different glyph-name values), then all such glyphs are included in the set. comma is the separator character; thus, to kern a comma, specify the comma as part of a range of unicode characters or as a glyph name using the g1 attribute. ...
u2 - SVG: Scalable Vector Graphics
if a given unicode character within the set has multiple corresponding <glyph> elements (i.e., there are multiple <glyph> elements with the same unicode attribute value but different glyph-name values), then all such glyphs are included in the set. comma is the separator character; thus, to kern a comma, specify the comma as part of a range of unicode characters or as a glyph name using the g2 attribute. ...
unicode-bidi - SVG: Scalable Vector Graphics
e css unicode-bidi property for more information. as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value normal | embed | isolate | bidi-override | isolate-override | plaintext default value normal animatable no for a
description of the values, please refer to the css unicode-bidi property. specifications specification status comment css writing modes module level 3the definition of 'unicode-bidi' in that specification. proposed recommendation svg 2 only refers to css writing modes. introduced isolate, isolate-override, and plaintext keywords. scalable vector graphics (svg)...
word-spacing - SVG: Scalable Vector Graphics
prior to firefox 72 firefox ignored word-spacing and renders text without. specifications specification status comment css text module level 3the definition of 'word-spacing' in that specification. working draft svg 2 just refers to the definition in css text 3. scalable vector graphic...
xlink:href - SVG: Scalable Vector Graphics
of this animation and which therefore will be modified over time. the target element must be part of the current svg document fragment. the value must point to exactly one target element which is capable of being the target of the given animation. if the xlink:href attribute is not provided, the target element will be the immediate parent element of the current animation element. refer to the
descriptions of the individual animation elements for any restrictions on what types of elements can be targets of particular types of animations. value <iri> default value none animatable no color-profile for <color-profile>, xlink:href defines the location of an icc profile resource. value <iri> default value none animatable ...
<a> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <...
<circle> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment ...
<ellipse> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment ...
<g> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>...
<line> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment ...
<marker> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <...
<path> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment svg pathsth...
<polygon> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment ...
<polyline> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment ...
<rect> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment ...
<svg> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>...
<symbol> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>...
<text> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, text content elementpermitted contentcharacter data and any number of the following elements, in any order:animation elementsdescriptive elementstext content elements<a> specifications specifica...
<textPath> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:title usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatec...
<title> — the SVG accessible name element - SVG: Scalable Vector Graphics
text in a <title> element is not rendered as part of the graphic, but browsers usually display it as a tooltip. if an element can be described by visible text, it is recommended to reference that text with an aria-labelledby attribute rather than using the <title> element. note: for backward compatibility with svg 1.1, <title> elements should be the first child element of their parent. ...
<tspan> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> ...
<use> - SVG: Scalable Vector Graphics
aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-role
description, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:href, xlink:title usage notes categoriesgraphics element, graphics referencing element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements speci...
Paths - SVG: Scalable Vector Graphics
d. there is no real performance penalty or bonus for using one or the other. curve commands there are three different commands that can be used to create smooth curves. two of those curves are bézier curves, and the third is an "arc" or part of a circle. you might have already gained practical experience with bézier curves using path tools in inkscape, illustrator or photoshop. for a complete
description of the math behind bézier curves, go to a reference like the one on wikipedia. there are an infinite number of bézier curves, but only two simple ones are available in <path> elements: a cubic one, called with c, and a quadratic one, called with q. bézier curves the cubic curve, c, is the slightly more complex curve. cubic béziers take in two control points for each point. therefore, to cre...
SVG Filters Tutorial - SVG: Scalable Vector Graphics
with the filter element <filter> it is possible to add these effects and later on attach them to an object. filters act like layers. when creating them, try applying and testing the effect step by step. this element has different attributes that help us create the clipping region. between the filter tags, we can define the primitives that allow us to implement the desired effect. one of these primitives is the fegaussianblur. the keyword sourcealpha identifies the input for this primitive, is in this case input 'in'. ...
SVG fonts - SVG: Scalable Vector Graphics
it was not meant for compatibility with other formats like postscript or otf, but rather as a simple means of embedding glyph information into svg when rendered. svg fonts are currently supported only in safari and android browser. ...
XML introduction - XML: Extensible Markup Language
defined the <warning> tag, the document above wouldn't be valid. most browsers offer a debugger that can identify poorly-formed xml documents. entities like html, xml offers methods (called entities) for referring to some special reserved characters (such as a greater than sign which is used for tags). there are five of these characters that you should know: entity character
description < < less than sign > > greater than sign & & ampersand " " one double-quotation mark ' ' one apostrophe (or single-quotation mark) even though there are only 5 declared entities, more can be added using the document's document type definition. for example, to create a new &warning; entity, yo...
Axes - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes there are thirteen different axes in the xpath specification. an axis represents a relationship to the context node, and is used to locate nodes relative to that node on the tree. the following is an extremely brief
description of the thirteen available axes and the degree of support available in gecko. for further information on using xpath expressions, please see the for further reading section at the end of transforming xml with xslt document. also see the 'axes' section in the xpath spec. ancestor indicates all the ancestors of the context node beginning with the parent node and traveling through to the root node. ancestor-or-self indicates the context node and all of its ancestors, including ...
Functions - XPath
for further information on using xpath/xslt functions, please see the for further reading page. ...
Introduction to using XPath in JavaScript - XPath
note that if the result is a node-set then unordered_node_iterator_type is always the resulting type. number_type 1 a result containing a single number. this is useful for example, in an xpath expression using the count() function. string_type 2 ...
XPath
le other browsers implement it to a lesser extent, if at all. if you need a polyfill, you may consider js-xpath or wicked-good-xpath. documentation introduction to using xpath in javascript describes a non-xslt use of xpath. xpath:axes list and definition of the axes defined in the xpath specification. axes are used to describe the relationships between nodes. xpath:functions list and
description of the core xpath functions and xslt-specific additions to xpath. transforming xml with xslt xslt uses xpath to address code segments in an xml document that it wishes to transform. xpath snippets these are javascript utility functions, that can be used in your own code, based on dom level 3 xpath apis. what is xslt? this extensive introduction to xslt and xpath assumes no prior knowledge ...
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
uation is substituted for the xpath expression. for example, assume that a variable "image-dir" is defined as follows: <xsl:variable name="image-dir">/images</xsl:variable> the expression to be evaluated is placed inside curly brackets: <img src="{$image-dir}/mygraphic.jpg"/> this would result in the following: <img src="/images/mygraphic.jpg"/> the element annotations that follow include a
description, a syntax listing, a list of required and optional attributes, a
description of type and position, its source in the w3c recommendation and an explanation of the degree of present gecko support. use the {{listsubpages}} macro once the bcd for <xsl:fallback>, <xsl:import>, <xsl:namespace-alias>, <xsl:number>, <xsl:output>, <xsl:stylesheet>, <xsl:text> and <xsl:value-of> is fully migrated. <xsl:a...
Index - XSLT: Extensible Stylesheet Language Transformations
e place between highly heterogeneous machines linked by a network. 14 an overview needshelp, needsmarkupwork, transforming_xml_with_xslt, xml, xslt the extensible stylesheet language/transform is a very powerful language, and a complete discussion of it is well beyond the scope of this article, but a brief discussion of some basic concepts will be helpful in understanding the
description of netscape's capabilities that follows. 15 for further reading needscontent, needshelp, transforming_xml_with_xslt, xml, xslt http://www.amazon.com/xslt-programme.../dp/0764543814 16 resources extensions, needscontent, needsexample, needslivesample, xml, xsl no summary! 17 the netscape xslt/xpath reference netscape, reference, xslt, axes ...
Web technology for developers
l markup language makes it possible to display complex mathematical equations and syntax. temporary the stuff below here is temporary to help keep track of things while organization work is ongoing. pay it no mind. ...
Compiling from Rust to WebAssembly - WebAssembly
), so when we call this function we will see an alert box with "hello, steve!" in it. now that our library is written, let's build it. compiling our code to webassembly to compile our code correctly, we first need to configure it with cargo.toml. open this file, and change its contents to look like this: [package] name = "hello-wasm" version = "0.1.0" authors = ["your name <you@example.com>"]
description = "a sample project with wasm-pack" license = "mit/apache-2.0" repository = "https://github.com/yourgithubusername/hello-wasm" [lib] crate-type = ["cdylib"] [dependencies] wasm-bindgen = "0.2" fill in your own repository and use the same info that git uses for the authors field. the big part to add is the stuff at the bottom. the first part — [lib] — tells rust to build a cdylib version o...